Skip to content

Commit

Permalink
Reorganize code
Browse files Browse the repository at this point in the history
  • Loading branch information
llrs-roche committed Jan 31, 2025
1 parent aff016a commit c142c72
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions .github/workflows/build-check-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -532,18 +532,25 @@ jobs:
# tests/testthat/test-shinytest2-foo.R -> foo
# R/foo.R -> foo
base_name=$(basename "$file" .R | sed s/test-shinytest2-//g)
# Find matching test files (parenthesis to not match arguments)
test_files=$(grep -l "$base_name(" "$test_dir"test-shinytest2-*.R)
# Find matching test files
test_files=$(grep -l "$base_name" "$test_dir"test-shinytest2-*.R)
if [ -z "$test_files" ]; then
echo "No test files found for modified file about $base_name."
else
echo "${file} matches ${test_files}"
# Modify in place so that only modified modules are tested.
if [[ -n "$test_files" ]]
then {
sed -i 's/skip_if_too_deep(5)/skip_if_too_deep(3)/g' "$test_files"
fi
TESTING_DEPTH=3
} else {
# Flag for helpers
helper_modified="yes"
} fi
# R file without corresponding test file: assume it affects all
if [[ -n "$helper_modified" ]]
then {
TESTING_DEPTH=5
} fi
done
TESTING_DEPTH=3
shell: bash

- name: Build R package 🏗
Expand Down

0 comments on commit c142c72

Please sign in to comment.