Skip to content

Commit 67b9381

Browse files
committed
Rework test runners
1 parent 972b412 commit 67b9381

File tree

5 files changed

+14
-7
lines changed

5 files changed

+14
-7
lines changed

.Rbuildignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
^codecov\.yml$
1313
movies.png
1414
requirements.txt
15-
document.sh
15+
run_tests.sh

.travis.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@ r:
66
- devel
77

88
before_script:
9-
- cd vignettes
10-
- ../scripts/translate_examples.py Examples.ipynb _R_Examples.ipynb
11-
- ../scripts/expand_run_magic.py _R_Examples.ipynb Examples_R.ipynb
12-
- cd ..
9+
- scripts/prepare_for_tests.sh
1310

1411
after_success:
1512
- Rscript -e 'covr::codecov()'

run_tests.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
./scripts/prepare_for_tests.sh
3+
Rscript -e 'devtools::test()'

scripts/prepare_for_tests.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
cd vignettes
3+
../scripts/translate_examples.py Examples.ipynb _R_Examples.ipynb
4+
../scripts/expand_run_magic.py _R_Examples.ipynb Examples_R.ipynb
5+
mkdir -p ../inst
6+
cp Examples_R.ipynb ../inst
7+
cd ..

tests/testthat/test-examples.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ expect_doppelganger = vdiffr::expect_doppelganger
44

55
test_that("The examples in documentation work as expected", {
66

7-
examples_notebook = jsonlite::fromJSON('../../vignettes/Examples_R.ipynb')
8-
cells = jsonlite::fromJSON('../../vignettes/Examples_R.ipynb')[['cells']]
7+
examples_notebook = jsonlite::fromJSON(system.file('Examples_R.ipynb', package='ComplexUpset'))
8+
cells = examples_notebook[['cells']]
99

1010
example_title = 'Example'
1111
last_title = example_title

0 commit comments

Comments
 (0)