File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change 246246 required : false
247247 type : boolean
248248 default : false
249+ fast-tests :
250+ description : |
251+ Should shinytests2 tests only run per modified teal module? If enabled if only there is a module modificated only that shinytest2 file will be tested.
252+ required : false
253+ type : string
254+ default : false
249255
250256concurrency :
251257 group : r-cmd-${{ inputs.concurrency-group }}-${{ github.event.pull_request.number || github.ref }}
@@ -515,13 +521,13 @@ jobs:
515521 key : additional-caches-${{ runner.os }}
516522
517523 - name : Check only affected modules 🎯
518- if : startsWith(${{ github.event.repository.name }}, 'teal.') && github.event_name == 'pull_request'
524+ if : ${{ inputs.fast-tests }} != 'true' && startsWith(${{ github.event.repository.name }}, 'teal.') && github.event_name == 'pull_request'
519525 run : |
520526 # Set working directory where the git repo is
521527 cd ${{ github.event.repository.name }}/${{ inputs.package-subdirectory }}
522528
523- # Debugging
524529
530+ test_all=git log -1 --pretty=%B | grep -F " [run-all-tests] "
525531
526532 # Get the list of R files that have changed
527533 # https://github.com/cloudnativeto/envoy/blob/de67446fa8af973761bb4716f5143d73643baf8b/.github/workflows/get_build_targets.sh_bak#L9
@@ -543,19 +549,21 @@ jobs:
543549 td=$TESTING_DEPTH
544550
545551 # Modify in place so that only modified modules are tested.
546- if [[ -n "$test_files" ]]
552+ if [[ -n "$test_files" && ! -n "$test_all" ]]
547553 then {
548554 sed -i 's/skip_if_too_deep(5)/skip_if_too_deep(3)/g' "$test_files"
549555 TESTING_DEPTH=3
556+ echo "Testing with shinytest2 for $test_files"
550557 } else {
551558 # Flag for helpers
552559 helper_modified="yes"
553560 git restore .
561+ echo "Run all tests"
554562 break
555563 } fi
556564
557565 # R file without corresponding test file: reset the testing depth
558- if [[ -n "$helper_modified" ]]
566+ if [[ -n "$helper_modified" || -n "$test_all" ]]
559567 then {
560568 TESTING_DEPTH=td
561569 } fi
You can’t perform that action at this time.
0 commit comments