Skip to content

Commit 5719594

Browse files
authored
Fix default testing depth (#296)
# Pull Request - Fallback to a default TESTING_DEPTH if a helper file is included - Make the check agnostic of the target - Remove redundant code --------- Signed-off-by: André Veríssimo <211358+averissimo@users.noreply.github.com>
1 parent 447a037 commit 5719594

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

.github/workflows/build-check-install.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,6 @@ jobs:
537537
uses: tj-actions/changed-files@a284dc1814e3fd07f2e34267fc8f81227ed29fb8
538538
with:
539539
path: ${{ github.event.repository.name }}/${{ inputs.package-subdirectory }}
540-
base_sha: "main"
541540
files: |
542541
tests/testthat/*.R
543542
R/*.R
@@ -553,11 +552,12 @@ jobs:
553552
commit_msg=$( git log -1 --pretty=%B )
554553
555554
# Set default TESTING_DEPTH
556-
td=$TESTING_DEPTH
557-
if [ -z "$td" ]
555+
WORKFLOW_TESTING_DEPTH=$TESTING_DEPTH
556+
if [ -z "$WORKFLOW_TESTING_DEPTH" ]
558557
then {
559558
echo "No TESTING_DEPTH default."
560559
TESTING_DEPTH=5
560+
WORKFLOW_TESTING_DEPTH=5
561561
echo "Setting TESTING_DEPTH=${TESTING_DEPTH}"
562562
echo "TESTING_DEPTH=${TESTING_DEPTH}" >> "$GITHUB_ENV"
563563
} fi
@@ -606,12 +606,11 @@ jobs:
606606
then {
607607
git restore $test_dir
608608
echo "Run all tests: Helpers modifications detected."
609-
TESTING_DEPTH="${td}";
609+
TESTING_DEPTH="${WORKFLOW_TESTING_DEPTH}";
610610
break;
611611
} else {
612612
sed -i 's/skip_if_too_deep(5)/skip_if_too_deep(3)/g' "$test_files"
613613
TESTING_DEPTH=3
614-
echo "TESTING_DEPTH=${TESTING_DEPTH}" >> "$GITHUB_ENV"
615614
echo "Testing with shinytest2 only for $test_files";
616615
} fi
617616
done

0 commit comments

Comments
 (0)