Skip to content

Commit

Permalink
Merge pull request #99 from Appsilon/develop
Browse files Browse the repository at this point in the history
main <- develop
  • Loading branch information
jakubnowicki committed Jan 9, 2023
2 parents 4cbf87e + c3e3e4b commit 0708d84
Show file tree
Hide file tree
Showing 95 changed files with 3,333 additions and 344 deletions.
6 changes: 6 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
^.*\.Rproj$
^\.Rproj\.user$
.github
.lintr
tests/end2end
pkgdown
docs
vignettes
31 changes: 31 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
### Link to the Issue

...

### Definition of Done

...

### How to test changes

...


### Tasks for PR author

- [ ] Test your change and ensure there is no regression
- [ ] Change has a corresponding issue. ***Ensure it is linked in GitHub***
- [ ] Author of the change opened a pull request and assigned a reviewer

### General policy:

- If applicable - add instructions for testing
- If there’s no issue, create it. Each issue needs to be well defined and described.
- All interaction with a user, user-facing messages, plots, reports etc. are written from the perspective of the person using or receiving it. They are understandable and helpful to this person. If a user sees an error message, there is a call to action, i.e. the user knows what to do to fix it.
- README, other documentation and code comments that we have is updated with all information related to the change.
- All code has been peer-reviewed before merging into any main branch
- All changes have been merged into the main branch we use for development.
- Continuous integration checks (linter, unit tests, integration tests) are configured and pass.
- Optional: unit tests added for all new or changed logic.
- All task requirements satisfied. If not describe it here. The reviewer is responsible to verify each aspect of the task.
- Change covers only things in task. Please create new PR if you want to fix something else.
64 changes: 64 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
on: push

name: R-CMD-check

jobs:
main:
name: ${{ matrix.config.os }} (${{ matrix.config.r }})

runs-on: ${{ matrix.config.os }}

timeout-minutes: 30

strategy:
fail-fast: false
matrix:
config:
- {os: macOS-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-22.04, r: 'devel'}
- {os: ubuntu-22.04, r: 'release'}
- {os: ubuntu-22.04, r: 'oldrel'}

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install R
uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}

- name: Install R package dependencies
uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: local::. # Necessary to avoid object usage linter errors.

- name: R CMD check
if: always()
uses: r-lib/actions/check-r-package@v2
with:
error-on: '"note"'

- name: Lint
if: always()
shell: Rscript {0}
run: |
lints <- lintr::lint_package()
for (lint in lints) print(lint)
quit(status = length(lints) > 0)
- name: Spell Check
if : always()
shell: Rscript {0}
run: |
spell_check <- spelling::spell_check_package(use_wordlist = TRUE)
if (nrow(spell_check) > 0) {
print(spell_check)
}
quit(status = nrow(spell_check) > 0)
- name: Test coverage
if: matrix.config.os == 'ubuntu-22.04' && matrix.config.r == 'release'
run: |
Rscript -e 'covr::codecov(token = "${{secrets.CODECOV_TOKEN}}")'
34 changes: 34 additions & 0 deletions .github/workflows/pkgdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches:
- main
workflow_dispatch:

name: pkgdown

jobs:
pkgdown:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::pkgdown, local::.
needs: website

- name: Deploy to gh-pages branch
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com"
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'
100 changes: 100 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
on: push

name: package-usage-tests

defaults:
run:
working-directory: ./tests/end2end/app/

jobs:
main:
name: ${{ matrix.config.os }} (${{ matrix.config.r }})

runs-on: ${{ matrix.config.os }}

timeout-minutes: 30

strategy:
fail-fast: false
matrix:
config:
- {os: macOS-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-22.04, r: 'devel'}
- {os: ubuntu-22.04, r: 'release'}
- {os: ubuntu-22.04, r: 'oldrel'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install R
uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}

- name: Install R package dependencies
uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: local::. # Necessary to avoid object usage linter errors.

- name: Install shiny.benchmark
run: |
Rscript -e "install.packages('remotes')"
Rscript -e "remotes::install_local('../../../', quiet = TRUE)"
- name: Create app structure
run: |
bash ./../setting_branches.sh
- name: Check basic functionality - Cypress
run: |
Rscript ../run_tests.R cypress master,develop tests/cypress/ use_this_one_1 FALSE 1
- name: Check basic functionality - shinytest2
run: |
Rscript ../run_tests.R shinytest2 master,develop tests/ use_this_one_1 FALSE 1
- name: Check if it fails when renv not present - Cypress
run: |
Rscript ./../run_tests.R cypress renv_missing,renv_shiny1,renv_shiny2 tests/cypress/ use_this_one_1 FALSE 1
- name: Check if it fails when renv not present - shinytest2
run: |
Rscript ./../run_tests.R shinytest2 renv_missing,renv_shiny1,renv_shiny2 tests/ use_this_one_1 FALSE 1
- name: Check if it can handle renv - Cypress
run: |
Rscript ./../run_tests.R cypress renv_missing,renv_shiny1,renv_shiny2 tests/cypress/ use_this_one_1 TRUE 1
- name: Check if it can handle renv - shinytest2
run: |
Rscript ./../run_tests.R shinytest2 renv_missing,renv_shiny1,renv_shiny2 tests/ use_this_one_1 TRUE 1
- name: Check if it can handle multiple files - Cypress
run: |
Rscript ./../run_tests.R cypress renv_shiny1,renv_shiny2 tests/cypress/,fake_folder/tests/cypress/ use_this_one_1 TRUE 1
- name: Check if it can handle multiple files - shinytest2
run: |
Rscript ./../run_tests.R shinytest2 renv_shiny1,renv_shiny2 tests/,fake_folder/tests/ use_this_one_1 TRUE 1
- name: Check if we can replicate tests - Cypress
run: |
Rscript ./../run_tests.R cypress master,develop tests/cypress/ use_this_one_1 FALSE 2
- name: Check if we can replicate tests - shinytest2
run: |
Rscript ./../run_tests.R shinytest2 master,develop tests/ use_this_one_1 FALSE 2
- name: Check if we can run tests based on file patterns - Cypress
run: |
Rscript ./../run_tests.R cypress master,develop tests/cypress/ use_this_one_[0-9] FALSE 1
- name: Check if we can run tests based on file patterns - shinytest2
run: |
Rscript ./../run_tests.R shinytest2 master,develop tests/ use_this_one_[0-9] FALSE 1
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,7 @@ vignettes/*.pdf

# R Environment Variables
.Renviron

# documentation page
docs
inst/doc
8 changes: 8 additions & 0 deletions .lintr
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
linters:
linters_with_defaults(
line_length_linter = line_length_linter(100)
)
exclusions:
c(
"vignettes"
)
44 changes: 32 additions & 12 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,21 +1,41 @@
Package: shiny.performance
Title: Compare performance of several versions of a shiny app
Version: 0.1.0
Package: shiny.benchmark
Title: Benchmark the Performance of Shiny Applications
Version: 0.1.1
Authors@R:
c(
person(given = "Douglas", family = "Azevedo", email = "douglas@appsilon.com", role = "aut"),
person(given = "Pedro", family = "Silva", email = "pedro@appsilon.com", role = "aut"),
person("Developers", "Appsilon", email = "support+opensource@appsilon.com", role = "cre"),
person(family = "Appsilon Sp. z o.o.", role = "cph")
person(given = "Douglas", family = "Azevedo", email = "opensource+douglas@appsilon.com", role = c("aut", "cre")),
person(family = "Appsilon Sp. z o.o.", role = "cph", email = "opensource@appsilon.com")
)
Description: Compare performance of several versions of a shiny app based on commit hashs
License: LGPL-3 + file LICENSE
URL: https://github.com/Appsilon/shiny.performance
SystemRequirements: yarn 1.22.17 or higher, cypress 9.4.1 or higher, xvfb
Description: Compare performance between different versions of a Shiny application based on Git references.
License: LGPL-3
URL: https://github.com/Appsilon/shiny.benchmark, https://github.com/Appsilon/shiny.benchmark
BugReports: https://github.com/Appsilon/shiny.benchmark/issues
SystemRequirements: yarn 1.22.17 or higher, Node 12 or higher
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.1.2
RoxygenNote: 7.2.3
VignetteBuilder: knitr
Depends:
R (>= 3.1.0)
Suggests:
covr,
knitr,
lintr,
rcmdcheck,
rmarkdown,
mockr,
spelling
Imports:
dplyr,
ggplot2,
glue,
jsonlite,
methods,
progress,
renv,
shinytest2,
stringr,
testthat,
fs
Language: en-US
26 changes: 23 additions & 3 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,8 +1,28 @@
# Generated by roxygen2: do not edit by hand

export(performance_tests)
export(run_performance_test)
importFrom(git2r,checkout)
S3method(plot,shiny_benchmark)
S3method(print,shiny_benchmark)
S3method(summary,shiny_benchmark)
export(benchmark)
export(benchmark_cypress)
export(benchmark_shinytest2)
export(load_example)
export(run_cypress_ptest)
export(run_shinytest2_ptest)
export(shiny_benchmark_class)
exportClasses(shiny_benchmark)
import(dplyr)
import(ggplot2)
importFrom(glue,glue)
importFrom(jsonlite,write_json)
importFrom(methods,new)
importFrom(progress,progress_bar)
importFrom(renv,activate)
importFrom(renv,restore)
importFrom(shinytest2,test_app)
importFrom(stats,median)
importFrom(stringr,str_trim)
importFrom(testthat,ListReporter)
importFrom(utils,globalVariables)
importFrom(utils,menu)
importFrom(utils,read.table)
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# 0.1.1

Adding a minimal example using `shinytest2`

0 comments on commit 0708d84

Please sign in to comment.