-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: Add directory filter for IT #1344
Conversation
7f1288f
to
6384de4
Compare
Timestamp: 2020-11-24 11:51:54 |
6384de4
to
f6dd4a6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tested it locally using:
#!/bin/bash
git diff --name-only --diff-filter=AMDR HEAD^ HEAD > diffs.txt
echo "---------------"
cat diffs.txt
echo "---------------"
SHOULD_RUN='false'
while IFS= read -r file
do
if [[ $file == test_runner/* ]] || [[ $file == integration_tests/* ]]; then
SHOULD_RUN='true'
break
fi
done < diffs.txt
rm diffs.txt
echo "::set-output name=should_run::$SHOULD_RUN"
running on a 1313-add-it-test-cases
78eeed3:
MacBook-Pro-jan-gogo:flank-review jan-gogo$ ./testscr.sh
---------------
integration_tests/src/test/kotlin/integration/AllTestFilteredIT.kt
integration_tests/src/test/kotlin/integration/IgnoreFailedIT.kt
integration_tests/src/test/kotlin/integration/IntergrationTestsUtils.kt
integration_tests/src/test/kotlin/integration/MultipleApksIT.kt
integration_tests/src/test/kotlin/integration/MultipleDevicesIT.kt
integration_tests/src/test/kotlin/integration/RunTimeoutIT.kt
integration_tests/src/test/kotlin/integration/SanityRoboIT.kt
integration_tests/src/test/kotlin/integration/TestFilteringIT.kt
---------------
::set-output name=should_run::true
running on master
8e3bc14:
MacBook-Pro-jan-gogo:flank-review jan-gogo$ ./testscr.sh
---------------
buildSrc/src/main/kotlin/Versions.kt
---------------
::set-output name=should_run::false
Look like the bash script works fine 👍
Codecov Report
@@ Coverage Diff @@
## master #1344 +/- ##
============================================
- Coverage 77.83% 77.79% -0.05%
Complexity 705 705
============================================
Files 244 244
Lines 4692 4692
Branches 901 901
============================================
- Hits 3652 3650 -2
Misses 550 550
- Partials 490 492 +2 |
f6dd4a6
to
7c490ed
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First I try to use this script on 1313-add-it-test-cases
Output
---------------
integration_tests/src/test/kotlin/integration/MultipleDevicesIT.kt
---------------
Should run IT: true
::set-output name=should_run::true
and on master:
---------------
.github/workflows/release.yml
flank-actions/sendMessage.kts
---------------
Should run IT: false
::set-output name=should_run::false
I think script works fine! 👍
Fixes #1337
This PR adds step for IT workflow. It checks with
git diff
if any modified/removed/created/moved files were intest_runner
and/orintegration_tests
directory.Test Plan
No straightforward way to do this. The added step is a simple bash script that sets output either to true or false.
To verify you can copy the script and run locally
If case there are any files changed in
test_runner
/integration_tests
echo "::set-output name=should_run::true"
should be printed. Otherwiseecho "::set-output name=should_run::false"