-
Notifications
You must be signed in to change notification settings - Fork 363
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Regression Tests: Run only tests associated with updated example dire…
…ctory (pull #1100) These changes Cut down the number of tests run on each PR. * Tests are run by example directory, so all tests for all examples in an example directory will always be run at once. * But if only one example directory is updated, then only the tests for that example directory will run. * If any code in `examples/js` or `examples/css` is edited, then all tests are run. * If `test/index.js` or any code in `test/util` is edited, then all tests are run. * If package.json is updated, then all tests are run. * Changes the name format for the test files. All test files must be prepended with the directory of the example they are testing in order to easily filter tests. * Test report will report bad test file names. * Changes the format of the output from AVA's format to TAP.
- Loading branch information
1 parent
ecdb87a
commit d40a173
Showing
47 changed files
with
60 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
|
||
if ! git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qP '(test/|examples/|package\.json)' | ||
then | ||
echo "Examples files were not updated, not running example regression tests." | ||
exit | ||
fi | ||
|
||
TEST_DIRS=$(git diff --name-only $TRAVIS_COMMIT_RANGE | grep -oP 'test/tests/\K[\w-]+(?=_)' | uniq) | ||
EXAMPLE_DIRS=$(git diff --name-only $TRAVIS_COMMIT_RANGE | grep -oP 'examples/\K[\w-]+(?=/)' | uniq) | ||
|
||
# Only add match args if the example/js or example/css directories or test/index.hs | ||
# or the test/utils.js directories have not been edited | ||
|
||
TEST_INFRA=$(git diff --name-only $TRAVIS_COMMIT_RANGE | grep -oP 'test/(util|index)') | ||
EXAMPLE_INFRA=$(echo "$EXAMPLE_DIRS" | grep -P '^(js|css)$') | ||
|
||
ARGS='' | ||
|
||
if [ -z $TEST_INFRA ] && [ -z $EXAMPLE_INFRA ] | ||
then | ||
for D in $EXAMPLE_DIRS | ||
do | ||
ARGS="${ARGS} --match ${D}/*" | ||
done | ||
|
||
for F in $TEST_DIRS | ||
do | ||
ARGS="${ARGS} --match ${F}/*" | ||
done | ||
fi | ||
|
||
AVACMD="npm run regression -- -t -c 1 test/tests ${ARGS}" | ||
echo "$ $AVACMD" | ||
|
||
$AVACMD |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters