From f86222be682f92eb77e236872180476f3d8a69b3 Mon Sep 17 00:00:00 2001 From: Na Li Date: Tue, 24 Mar 2020 17:59:50 -0700 Subject: [PATCH 1/4] [core]Move variations of the same set of tests to nightly. --- tfjs-core/scripts/test-ci.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tfjs-core/scripts/test-ci.sh b/tfjs-core/scripts/test-ci.sh index 67f51d33b5d..a993509b187 100755 --- a/tfjs-core/scripts/test-ci.sh +++ b/tfjs-core/scripts/test-ci.sh @@ -20,6 +20,8 @@ yarn lint # Test in node (headless environment). yarn test-node-ci +if [ "$NIGHTLY" = true ] +then # Run the first karma separately so it can download the BrowserStack binary # without conflicting with others. yarn run-browserstack --browsers=bs_safari_mac,bs_ios_11 --testEnv webgl1 --flags '{"WEBGL_CPU_FORWARD": false, "WEBGL_SIZE_UPLOAD_UNIFORM": 0}' @@ -38,3 +40,6 @@ yarn rollup -c --ci # Safari doesn't have offscreen canvas so test cpu in a webworker. # Chrome has offscreen canvas, so test webgl in a webworker. yarn test-webworker --browsers=bs_safari_mac,bs_chrome_mac +else +yarn run-browserstack --browsers=bs_chrome_mac +fi From 3233bc18383d3b7058a8d0834fbb2ef9b1838e96 Mon Sep 17 00:00:00 2001 From: Na Li Date: Tue, 24 Mar 2020 18:38:48 -0700 Subject: [PATCH 2/4] Change the logic of run-build.sh --- scripts/run-build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/run-build.sh b/scripts/run-build.sh index c5dabdf7595..118b9693830 100755 --- a/scripts/run-build.sh +++ b/scripts/run-build.sh @@ -17,6 +17,6 @@ set -e DIR=$1 -if test -f "$DIR/run-ci"; then +if [[ -f "$DIR/run-ci" || "$NIGHTLY" = true ]]; then gcloud builds submit . --config=$DIR/cloudbuild.yml fi From 58155ab0da8d1b5075ad02250f9b078c82922ebf Mon Sep 17 00:00:00 2001 From: Na Li Date: Tue, 24 Mar 2020 19:03:48 -0700 Subject: [PATCH 3/4] Pass env NIGHTLY to Core. --- cloudbuild.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/cloudbuild.yml b/cloudbuild.yml index 4824a4906be..30c0ac949cc 100644 --- a/cloudbuild.yml +++ b/cloudbuild.yml @@ -22,6 +22,7 @@ steps: id: 'tfjs-core' args: ['./scripts/run-build.sh', 'tfjs-core'] waitFor: ['find-affected-packages'] + env: ['NIGHTLY=$_NIGHTLY'] # Converter. - name: 'gcr.io/cloud-builders/gcloud' From 8ed34639673af5462af9e417cf08543bbf4778ac Mon Sep 17 00:00:00 2001 From: Na Li Date: Wed, 25 Mar 2020 09:53:23 -0700 Subject: [PATCH 4/4] Indent body. --- tfjs-core/scripts/test-ci.sh | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/tfjs-core/scripts/test-ci.sh b/tfjs-core/scripts/test-ci.sh index a993509b187..4f32b82f01b 100755 --- a/tfjs-core/scripts/test-ci.sh +++ b/tfjs-core/scripts/test-ci.sh @@ -22,24 +22,24 @@ yarn test-node-ci if [ "$NIGHTLY" = true ] then -# Run the first karma separately so it can download the BrowserStack binary -# without conflicting with others. -yarn run-browserstack --browsers=bs_safari_mac,bs_ios_11 --testEnv webgl1 --flags '{"WEBGL_CPU_FORWARD": false, "WEBGL_SIZE_UPLOAD_UNIFORM": 0}' + # Run the first karma separately so it can download the BrowserStack binary + # without conflicting with others. + yarn run-browserstack --browsers=bs_safari_mac,bs_ios_11 --testEnv webgl1 --flags '{"WEBGL_CPU_FORWARD": false, "WEBGL_SIZE_UPLOAD_UNIFORM": 0}' -# Run the rest of the karma tests in parallel. These runs will reuse the -# already downloaded binary. -npm-run-all -p -c --aggregate-output \ - "run-browserstack --browsers=bs_safari_mac,bs_ios_11,bs_android_9 --flags '{\"HAS_WEBGL\": false}' --testEnv cpu" \ - "run-browserstack --browsers=bs_firefox_mac,bs_chrome_mac" \ - "run-browserstack --browsers=bs_chrome_mac,win_10_chrome,bs_android_9 --testEnv webgl2 --flags '{\"WEBGL_CPU_FORWARD\": false, \"WEBGL_SIZE_UPLOAD_UNIFORM\": 0}'" \ - "run-browserstack --browsers=bs_chrome_mac --testEnv webgl2 --flags '{\"WEBGL_PACK\": false}'" \ + # Run the rest of the karma tests in parallel. These runs will reuse the + # already downloaded binary. + npm-run-all -p -c --aggregate-output \ + "run-browserstack --browsers=bs_safari_mac,bs_ios_11,bs_android_9 --flags '{\"HAS_WEBGL\": false}' --testEnv cpu" \ + "run-browserstack --browsers=bs_firefox_mac,bs_chrome_mac" \ + "run-browserstack --browsers=bs_chrome_mac,win_10_chrome,bs_android_9 --testEnv webgl2 --flags '{\"WEBGL_CPU_FORWARD\": false, \"WEBGL_SIZE_UPLOAD_UNIFORM\": 0}'" \ + "run-browserstack --browsers=bs_chrome_mac --testEnv webgl2 --flags '{\"WEBGL_PACK\": false}'" \ -### The next section tests TF.js in a webworker. -# Make a dist/tf-core.min.js file to be imported by the web worker. -yarn rollup -c --ci -# Safari doesn't have offscreen canvas so test cpu in a webworker. -# Chrome has offscreen canvas, so test webgl in a webworker. -yarn test-webworker --browsers=bs_safari_mac,bs_chrome_mac + ### The next section tests TF.js in a webworker. + # Make a dist/tf-core.min.js file to be imported by the web worker. + yarn rollup -c --ci + # Safari doesn't have offscreen canvas so test cpu in a webworker. + # Chrome has offscreen canvas, so test webgl in a webworker. + yarn test-webworker --browsers=bs_safari_mac,bs_chrome_mac else -yarn run-browserstack --browsers=bs_chrome_mac + yarn run-browserstack --browsers=bs_chrome_mac fi