From bbe97efd956655fbb3e81c88d585a6c120045090 Mon Sep 17 00:00:00 2001 From: Yannick Assogba Date: Mon, 5 Oct 2020 23:14:53 -0400 Subject: [PATCH] Link to custom bundle binary directly in e2e tests (#4024) INTERNAL --- e2e/custom_bundle/blazeface/package.json | 2 +- e2e/script_tag_tests/symbols_and_basic_api_test.js | 7 +++++-- e2e/scripts/run-custom-builds.sh | 3 +++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/e2e/custom_bundle/blazeface/package.json b/e2e/custom_bundle/blazeface/package.json index 8a31b50caf5..a9f83d19496 100644 --- a/e2e/custom_bundle/blazeface/package.json +++ b/e2e/custom_bundle/blazeface/package.json @@ -5,7 +5,7 @@ "main": "app.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", - "make-custom-tfjs-modules": "npx --no-install tfjs-custom-bundle --config app_tfjs_config.json", + "make-custom-tfjs-modules": "node ./node_modules/@tensorflow/tfjs/dist/tools/custom_bundle/cli.js --config app_tfjs_config.json", "rollup:full": "rollup -c", "rollup:custom": "rollup -c --useCustomTfjs", "webpack:full": "webpack", diff --git a/e2e/script_tag_tests/symbols_and_basic_api_test.js b/e2e/script_tag_tests/symbols_and_basic_api_test.js index 25802d1be5f..6410a54cb12 100644 --- a/e2e/script_tag_tests/symbols_and_basic_api_test.js +++ b/e2e/script_tag_tests/symbols_and_basic_api_test.js @@ -45,9 +45,12 @@ describe('tfjs union sub-packages', () => { }); }); -describe('ops', async () => { - await tf.setBackend('cpu'); +describe('ops', () => { + beforeAll(async() => { + await tf.setBackend('cpu'); + }); + it('should support basic math', () => { tf.tidy(() => { const a = tf.scalar(3); diff --git a/e2e/scripts/run-custom-builds.sh b/e2e/scripts/run-custom-builds.sh index a3575813758..5408ee8b82e 100755 --- a/e2e/scripts/run-custom-builds.sh +++ b/e2e/scripts/run-custom-builds.sh @@ -25,6 +25,9 @@ e2e_root_path=$PWD cd custom_bundle/blazeface yarn +# Ensure that we test agaisnt freshly generated custom modules. +rm -f ./custom_tfjs_blazeface/*.js +echo "npm version $(npm --version)" yarn make-custom-tfjs-modules # TODO(yassogba) once blazeface kernels are modularized in cpu # switch the config to cpu and also run and test rollup bundle.