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-07-01 22:42:51

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-07-01 22:44:45
## 2 12.2_tests-helpers   2024-07-01 22:48:30
## 3 12.3_tests-snapshots 2024-07-02 08:21:14

Testing modules includes strategies for:

  1. Testing returned values with 13.1.1 session$returned()

  2. Passing module arguments with 13.1.3 args = list()

  3. Checking 13.2 Module test coverage and 13.2.1 Testing output$s

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-07-02 13:43:56
  1. Introduction to 14.1.1 shinytest2

  2. Using shinytest2 to 14.2 Record a test

  3. Exporting test values with 14.3 test.mode

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-07-02 14:20:12

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

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

    • 15.1 What is Docker? and how does it provide a consistent environment for the application, ensuring it works seamlessly across different computers.

    • How to write 15.3 The Dockerfile in your app-package (and launching your app in a virtual container)

CI/CD with GitHub Actions

Package websites

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