Deploy

Published

2024-09-23

Expand the callout boxes below to review the previous testing chapters:

Test suite covers:

  1. Getting started with 14.2 Setting up testthat tests in your app-package

  2. An introduction to 14.3.4 BDD test functions

  3. Make running tests during development easier by setting 14.4.1 Keyboard shortcuts

Specifications dives into:

  1. The differences between 15.1 Application requirements, 15.1.1 User Specifications, 15.1.2 Features, and 15.1.3 Functional Requirements

  2. The 15.3 BDD and testthat functions (describe() and it()) are introduced

  3. Tracking features, requirements and tests with a 15.4 Traceability Matrix

The applications in Chapter 11 (Specifications) can be accessed with the launch() or get() functions from the shinypak R package:

# install.packages('pak')
pak::pak('mjfrigaard/shinypak')
library(shinypak)

Chapter 11 applications:

list_apps(regex = '^11')
## # A tibble: 2 × 2
##   branch         last_updated       
##   <chr>          <dttm>             
## 1 11_debug-print 2024-11-20 22:09:54
## 2 11_tests-specs 2024-09-03 22:33:22

Test tools covers:

  1. Where to store and how to use test 16.1 Test fixtures and 16.2 Test helpers

  2. Checking test coverage during 16.2.2 Test development

  3. Creating snapshots and 16.3.1 Reviewing _snaps/

The applications in Chapter 12 (Test tools) can be accessed with the launch() or get() functions from the shinypak R package:

# install.packages('pak')
pak::pak('mjfrigaard/shinypak')
library(shinypak)

Chapter 12 applications:

list_apps(regex = '^12')
## # A tibble: 3 × 2
##   branch               last_updated       
##   <chr>                <dttm>             
## 1 12.1_tests-fixtures  2024-09-14 07:13:41
## 2 12.2_tests-helpers   2024-09-03 22:39:27
## 3 12.3_tests-snapshots 2024-11-06 08:09:57

Testing modules includes strategies for:

  1. Testing returned values with 17.1.1 Testing return values

  2. Passing module arguments with 17.1.3 Testing module parameters

  3. Checking 17.2 Module test coverage and 17.2.1 Testing module outputs

The applications in Chapter 13 (Testing modules) can be accessed with the launch() or get() functions from the shinypak R package:

# install.packages('pak')
pak::pak('mjfrigaard/shinypak')
library(shinypak)

Chapter 13 applications:

list_apps(regex = '^13')
## # A tibble: 1 × 2
##   branch           last_updated       
##   <chr>            <dttm>             
## 1 13_tests-modules 2024-09-03 23:11:59
  1. Introduction to 18.2 Setting up shinytest2

  2. Using shinytest2 to 18.3 Record a test

  3. Exporting test values with 18.5 The test.mode option

The applications in Chapter 14 (System tests) can be accessed with the launch() or get() functions from the shinypak R package:

# install.packages('pak')
pak::pak('mjfrigaard/shinypak')
library(shinypak)

Chapter 14 applications:

list_apps(regex = '^14')
## # A tibble: 1 × 2
##   branch          last_updated       
##   <chr>           <dttm>             
## 1 14_tests-system 2024-09-03 23:23:17

Deploy

This section covers two common methods for deploying a Shiny app-package: 1) Docker images and containers, 2) using GitHub Actions for Continuous Integration (CI) and Continuous Deployment (CD), and 3) building and deploying a package website.

Docker

Docker covers how using Docker can simplify setting up your R environment and reduce the “it works on my machine” problem:

GitHub Actions

Continuous Integration/Continuous Deployment (CI/CD) can be implemented for your Shiny app-package using GitHub actions. This chapter covers the following workflows:

Package websites

pkgdown helps us easily create websites for our app-packages. This chapter covers: