Deploy

Expand the callout boxes below to review what we’ve covered in the last five chapters:

Test suite covers:

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

  2. An introduction to 10.3.4 BDD test functions

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

Specifications dives into:

  1. The differences between 11.1 Application requirements, 11.1.1 User Specifications, 11.1.2 Features, and 11.1.3 Functional Requirements

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

  3. Tracking features, requirements and tests with a 11.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: 1 × 2
##   branch         last_updated       
##   <chr>          <dttm>             
## 1 11_tests-specs 2024-08-01 08:05:02

Test tools covers:

  1. Where to store and how to use test 12.1 Test fixtures and 12.2 Test helpers

  2. Checking test coverage during 12.2.2 Test development

  3. Creating snapshots and 12.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-08-01 08:16:53
## 2 12.2_tests-helpers   2024-08-01 08:37:13
## 3 12.3_tests-snapshots 2024-08-01 08:40:05

Testing modules includes strategies for:

  1. Testing returned values with 13.1.1 Testing return values

  2. Passing module arguments with 13.1.3 Testing module parameters

  3. Checking 13.2 Module test coverage and 13.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-08-01 09:53:57
  1. Introduction to 14.2 Setting up shinytest2

  2. Using shinytest2 to 14.3 Record a test

  3. Exporting test values with 14.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-08-01 10:57:45

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: