Skip to content

Commit

Permalink
[e2e] Run regression tests in PR presubmits (#6896)
Browse files Browse the repository at this point in the history
Regression tests don't take too long to run, and they can catch more errors. This PR enables them for PR presubmits.

Co-authored-by: Ping Yu <4018+pyu10055@users.noreply.github.com>
  • Loading branch information
mattsoulanille and pyu10055 authored Oct 5, 2022
1 parent 9ebe08f commit 6b7ec59
Showing 1 changed file with 28 additions and 36 deletions.
64 changes: 28 additions & 36 deletions e2e/scripts/test-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,61 +16,53 @@

set -e

# Smoke tests run in PR and nightly builds.
TAGS="#SMOKE"
# Smoke and regression tests run in PR and nightly builds.
TAGS="#SMOKE,#REGRESSION"

# Regression tests run in nightly builds.
if [[ "$NIGHTLY" = true || "$RELEASE" = true ]]; then
TAGS="${TAGS},#REGRESSION"
fi
# Generate canonical layers models and inputs.
./scripts/create_save_predict.sh

# Additional setup for regression tests.
if [[ "$TAGS" == *"#REGRESSION"* ]]; then
# Generate canonical layers models and inputs.
./scripts/create_save_predict.sh
cd integration_tests

cd integration_tests
source ../scripts/setup-py-env.sh --dev

source ../scripts/setup-py-env.sh --dev
echo "Load equivalent keras models and generate outputs."
python create_save_predict.py

echo "Load equivalent keras models and generate outputs."
python create_save_predict.py
echo "Create saved models and convert."
python convert_predict.py

echo "Create saved models and convert."
python convert_predict.py
echo "Convert model with user defined metadata."
python metadata.py

echo "Convert model with user defined metadata."
python metadata.py
# Cleanup python env.
source ../scripts/cleanup-py-env.sh

# Cleanup python env.
source ../scripts/cleanup-py-env.sh
cd ..

cd ..
# Generate custom bundle files for tests
./scripts/run-custom-builds.sh

# Generate custom bundle files for tests
./scripts/run-custom-builds.sh
# Test webpack
cd webpack_test
yarn
yarn build
cd ..

# Test webpack
cd webpack_test
yarn
yarn build
cd ..
fi
node ../scripts/run_flaky.js "yarn run-browserstack --browsers=win_10_chrome --tags '$TAGS'"

if [[ "$NIGHTLY" = true || "$RELEASE" = true ]]; then
node ../scripts/run_flaky.js "yarn run-browserstack --browsers=bs_safari_mac --tags '$TAGS' --testEnv webgl --flags '{"\""WEBGL_VERSION"\"": 1, "\""WEBGL_CPU_FORWARD"\"": false, "\""WEBGL_SIZE_UPLOAD_UNIFORM"\"": 0}'"
# Test script tag bundles
node ../scripts/run_flaky.js "karma start ./script_tag_tests/tfjs/karma.conf.js --browserstack --browsers=bs_chrome_mac --testBundle tf.min.js"

# Additional tests to run in nightly only.
if [[ "$NIGHTLY" = true || "$RELEASE" = true ]]; then
node ../scripts/run_flaky.js "yarn run-browserstack --browsers=bs_ios_12 --tags '$TAGS' --testEnv webgl --flags '{"\""WEBGL_VERSION"\"": 1, "\""WEBGL_CPU_FORWARD"\"": false, "\""WEBGL_SIZE_UPLOAD_UNIFORM"\"": 0}'"
node ../scripts/run_flaky.js "yarn run-browserstack --browsers=bs_safari_mac --tags '$TAGS' --testEnv webgl --flags '{"\""WEBGL_VERSION"\"": 1, "\""WEBGL_CPU_FORWARD"\"": false, "\""WEBGL_SIZE_UPLOAD_UNIFORM"\"": 0}'"

node ../scripts/run_flaky.js "yarn run-browserstack --browsers=bs_firefox_mac --tags '$TAGS'"
node ../scripts/run_flaky.js "yarn run-browserstack --browsers=bs_chrome_mac --tags '$TAGS'"
node ../scripts/run_flaky.js "yarn run-browserstack --browsers=win_10_chrome --tags '$TAGS'"
node ../scripts/run_flaky.js "yarn run-browserstack --browsers=bs_android_9 --tags '$TAGS'"

# Test script tag bundles
node ../scripts/run_flaky.js "karma start ./script_tag_tests/tfjs/karma.conf.js --browserstack --browsers=bs_chrome_mac --testBundle tf.min.js"

node ../scripts/run_flaky.js "karma start ./script_tag_tests/tfjs-core-cpu/karma.conf.js --browserstack --browsers=bs_chrome_mac"
else
node ../scripts/run_flaky.js "yarn run-browserstack --browsers=bs_chrome_mac --tags '$TAGS'"
fi

0 comments on commit 6b7ec59

Please sign in to comment.