Commit Graph

52 Commits

Author SHA1 Message Date
Matthew Soulanille 78345c5f33
Move PR Continuous Integration to Github Actions (#8534)
Move GCP presubmits to Github actions. This allows us to run WebGL / WebGPU tests, since Github Actions have a MacOS runner with a GPU. This should unblock several PRs.
2025-04-23 10:55:01 -07:00
Matthew Soulanille 97f1531a09
Fix iOS nightly device deprecated by updating device (#8348) 2024-08-06 10:15:19 -07:00
Linchenn 00831deee1
Update iOS and OSX versions for testing (#8023)
* update versions

* upd

* upd

* upd

* Update karma.conf.js
2023-10-23 14:56:32 -07:00
Matthew Soulanille 0bd03f7e58
Re-enable nightly firefox tests (#7954)
* Re-enable nightly firefox tests

* Use ios 15 webgl2 for layers tests

---------

Co-authored-by: Ping Yu <4018+pyu10055@users.noreply.github.com>
2023-09-12 17:50:57 -07:00
Matthew Soulanille 84ee729089
Use bs-local.com for safari browserstack tests (#7940)
* Use bs-local.com for browserstack tests

* Only use bs-local for safari and ios
2023-08-28 22:34:18 +00:00
Matthew Soulanille d500a0d039
Disable firefox browserstack tests temporarily (#7935)
* Disable firefox browserstack tests temporarily

* Remove unused WebGL scripts

* Update test-ci.sh

* Always use port 9876 for karma

* Always use port 9200 for karma

Browserstack supports ports 9200-9400 for safari
testing (https://www.browserstack.com/question/39572), and when karma launches
and its port is in use, it automatically increments the port. Starting at 9200
ensures the port is always supported by BrowserStack.

* Fix bash npm-run-all script

* Fix tfjs-vis test script

* Update karma.conf.js

* Update automl macos test version

---------

Co-authored-by: Ping Yu <4018+pyu10055@users.noreply.github.com>
2023-08-25 17:05:49 -07:00
Jiajia Qin eb1b329c41
webgpu: Update readme and simplify flags (#7652)
* webgpu: Use chrome stable to test

* simplify linux flags

* recover webgpu flag for browserstack

* update readme

* nits
2023-05-04 09:31:59 -07:00
Yang Gu a05ad9a1a5
webgpu: Change the Chrome macOS flags in BrowserStack (#7625) 2023-04-28 13:05:08 +08:00
Matthew Soulanille 6a002b730c
Update rollup and its plugins to 3.20.2 (#7579)
Change the config file extension from .js to .mjs. This update only applies to
Bazel packages.
2023-04-12 20:14:42 -07:00
Matthew Soulanille ef89355b04
Add WebGPU CI BrowserStack test on MacOS (#7546)
Test the WebGPU backend on BrowserStack using MacOS. Windows machines appear to
be VMs, and WebGPU can not get context on them. MacOS devices seem to be real, so they work.
2023-04-11 13:23:49 -07:00
Matthew Soulanille 9716650cfb
Switch from android 9 to 10 for tests (#7132) 2022-12-01 10:26:17 -08:00
Matthew Soulanille 7cf8aa4472
Load tflite and tfdf wasm files with http_archive (#7124)
tfjs-tfdf and tfjs-tflite both depend on pre-compiled WASM files. These WASM files are downloaded by scripts (i.e. curl) during the build step. This violates Bazel's hermeticity requirements because build steps should not access remote resources. This PR fixes this by downloading these WASM files using http_archive in the WORKSPACE file.

Fixes #7103
2022-11-29 14:01:53 -08:00
Matthew Soulanille 0b49122e07
Run Karma Chrome tests headlessly (#6997)
Avoid opening a bunch of browser pages when running karma chrome tests where possible. This excludes WebGPU on Linux because headless webgpu is not supported on linux yet.

Add the flag `--//:headless=true|false` (default true) to control this and set it to false on Windows.
2022-11-02 17:58:38 -07:00
Matthew Soulanille feb0eebe9f
Use a predetermined seed for tfjs-layers tests (#6878)
Run tfjs-layers tests in a static, non-random order. This is a temporary fix for #6543.
2022-09-30 00:27:57 -07:00
Matthew Soulanille f6cc075c8d
Upgrade nodejs to 18.7.0 (#6863)
* Upgrade nodejs to 18.7.0

* Fix hash table test string not passed as base64
2022-09-28 20:02:17 -07:00
Matthew Soulanille 92f09d88f2
Upgrade windows BrowserStack chrome to 104 (#6866) 2022-09-27 17:27:02 -07:00
Matthew Soulanille 11901540a2
Enable WebGPU testing on Linux (#6591)
Enable testing the WebGPU backend on Linux using Chrome Dev (105) instead of Chrome Canary (even though base: 'ChromeCanary' is listed, it launches Chrome Dev on Linux). Fix incorrect passing of flags to Chrome. Flags enabled in chrome://flags need to appear between --flag-switches-begin and --flag-switches-end.

Note that not all tests are passing on Linux. This could be due to Chrome Dev being behind Chrome Canary, or due to a lack of testing on Linux before this PR.
2022-07-11 15:16:07 -07:00
Matthew Soulanille ea051d40ba
Print karma jasmine seed to terminal and in CI (#6609) 2022-07-07 11:28:52 -07:00
Matthew Soulanille e744307c0d
Fix iOS and macOS Safari CI Failures (#6608)
Update iOS from 11 to 12.3.

Remove #/usr/bin/env node from test_async_backends.ts

Disable iOS worker tests, which need to load absolute URLs (unsupported in BrowserStack right now).

Fixes #6598
2022-07-06 16:07:52 -07:00
Matthew Soulanille 0aa4080b9e
Add missing Bazel deps to tfjs_web_test macro (#6589)
tfjs_web_test breaks when run in Bazel with --spawn_strategy=sandboxed because it does not have all its dependencies declared. This PR fixes it.
2022-06-30 10:39:09 -07:00
Matthew Soulanille 189ac32bca
Update Jasmine from 3.1.0 to 4.2.1 (#6520)
Update jasmine from 3.1.0 to 4.2.1 for Bazel packages. Update karma from 6.3.16 to 6.4.0.

Remove deprecated use of async function and done callback at the same time in Jasmine tests.

Add karma-jasmine-html-reporter to show test status in the browser window.
2022-06-29 16:25:09 -07:00
Matthew Soulanille 6c9ec9fa7c
Add an experimental remote build execution config based on Angular's (#6576)
Add an experimental remote build execution config to run highly parallel builds on remote machines. Currently, only Linux is supported. Adding --config=rbe to any Bazel command (or any yarn command that uses Bazel) will make the build execute remotely. Note that this is only enabled for members of the TFJS team.
2022-06-29 14:48:37 -07:00
Matthew Soulanille 060f16b654
Add tslib, which es5 bundling depends on (#6536)
tslib was formerly included by chance since typescript depends on it. With this change, we explicitly depend on it and add it as a dependency to the tfjs_bundle Bazel rule. Rollup uses the es5 downleveling plugin, which uses tslib for bundle size optimization.
2022-06-16 10:45:07 -07:00
Matthew Soulanille 2745ea9de9
[wasm] Build tfjs-backend-wasm entirely with Bazel (#6458)
Build tfjs-backend-wasm with Bazel. tfjs-backend-wasm already uses Bazel for Emscripten. This PR makes it use Bazel for TypeScript as well and replaces the build scripts with a single pkg_npm target.

Fixes #5282
2022-06-14 10:18:02 -07:00
Matthew Soulanille 6df72d8f6b
Fix Bazel karma ignoring custom browsers that don't use BrowserStack (#6515)
#6504 broke Karma tests that run with custom browsers other than BrowserStack. This PR fixes it.

Tested by running yarn test in tfjs-backend-webgl, which uses Chrome Canary (although I'm on Linux, which doesn't have a Chrome Canary build, so I saw "No binary for ChromeCanary browser on your platform.").
2022-06-09 09:52:34 -07:00
Matthew Soulanille 42db7c5f99
Modularize rollup templates so they can be more easily reused (#6503)
Create tools/make_rollup_config.ts, which exports a function to create a tfjs rollup configuration. The only thing tools/rollup_template.config.js does now is import and call that function.

Move the custom es5 downleveling plugin to its own file.

Co-authored-by: Na Li <linazhao@google.com>
2022-06-08 09:48:12 -07:00
Matthew Soulanille a53aae8fd9
Refactor karma template to check if a browser runs on browserstack (#6504) 2022-06-07 12:49:18 -07:00
Ping Yu 2098237dbc
Fixed nightly failures (#6488)
Disable cpu forwarding for the new gather_nd tests that target webgl implementation.

Lock windows chrome version to 101.0 on browserstack, given the latest chrome (102.0) failed to provide webgl2 context.

Remove unused karma.config files.

Temporarily limit concurrent Bazel jobs to 25 (the number of browserstack tests we can run at the same time).
2022-06-02 13:40:54 -07:00
Matthew Soulanille 41202650a7
Make ts_library tsconfig.json extend root tsconfig (#6451)
* Make ts_library tsconfig.json extend root tsconfig

* Remove tsetse settings from main tsconfig

* Remove baseUrl and paths from ts_library tsconfig

* Revert "Remove baseUrl and paths from ts_library tsconfig"

Reverted since this PR should not change the tsconfig behavior (although I don't really think this change does affect behavior).

This reverts commit 2a72331b1c.

* Lint bazel
2022-05-26 13:45:37 -07:00
Jiajie Hu 00b88b8323
[webgpu] Make testing with Chrome Canary a little easier (#6424) 2022-05-25 17:24:46 +08:00
Matthew Soulanille de739706ab
Upgrade rules_nodejs to 5.4.2 (#6404)
* Upgrade rules_nodejs to 5.4.2

* Lint and fix Bazel files
2022-05-12 14:04:16 -07:00
Matthew Soulanille e9de9e7761
Fix grep for browser tests (#6109)
Add the command line flag "--//:grep=test_to_grep_for" to support running only matching tests.
2022-02-10 09:17:34 -08:00
Matthew Soulanille 17bb843345
Fix TS development on Apple silicon (#6090)
Upgrade Bazel version to 4.2.2 (supported by m1), rules_nodejs to 4.6.1 (required for node 16.13.2), and node to 16.13.2 (same as our CI docker image and required for m1 compatibility).

tfjs-backend-wasm will be fixed in #6098.

Not yet working:
* tfjs-converter python. #6089 may fix this if you have a working python2.7 homebrew install.
2022-02-04 14:36:02 -08:00
Matthew Soulanille 1d0c63f3be
Add 'leave_as_require' option to tfjs_bundle (#6005)
BUG
* Allow bundles to keep 'require' calls as 'require' calls

@rollup/plugin-commonjs rewrites 'require' calls to 'import' statements, but this is not always desirable. This commit adds the 'leave_as_require' option to 'tfjs_bundle', which allows specifying a list of modules to leave as 'require' calls.

This commit also disables @rollup/plugin-commonjs when targeting commonjs, since require calls do not need to be transpiled for commonjs.

* Always use the commonjs plugin

It is required even for node cjs bundles because we still want to bundle the commonjs modules. Without the plugin, they're left as 'require()' calls, but with the plugin, their contents are included in the bundle.
2022-01-12 16:47:24 -08:00
Ping Yu 7006846a84
[layers] [webgl] fixed failing nightly tests (#6001)
* fix layers nightly

* limited to webgl2

* limited to webgl2

* fix windows

* fix lint

* fix webgl test failures

* fix nan propagate errors

* increate timeout

* fix nan prop

* fix shader issue

* fixed log_loss error caused by negative input to log op

* disable android 9 tests for layers

* add comments
2022-01-11 12:13:43 -08:00
Matthew Soulanille a71a4368f3
Display better error message when missing browserstack credentials (#5995) 2022-01-07 11:46:55 -08:00
Hao Yunfei ff2668df5c
Ignore 'this is undefined' warning in rollup bundle building (#5957) 2022-01-04 10:37:20 -08:00
Hao Yunfei e34d7c3b74
Build tfjs-backend-webgpu with Bazel (#5362)
DEV
INTERNAL
* Build tfjs-backend-webgpu with Bazel

* update

* bazel format

* use node:11 for yarn test-ci

* Revert "use node:11 for yarn test-ci"

This reverts commit 46b2e6ddd2f7afb08e402a4d534b4371bb007be5.

* add bazel test and test-dev

* update commands in package.json

* rebase

* bazel lint

* update setup_test structure

* save

* Use central `yarn lint` instead of mono webgpu backend

* Make WebGPU local testing run chrome with flag

* update yarn.lock

* bazel format

* skip browserstack testing for WebGPU

* update dependency

* Address comments

* lint

* lint

* update tsconfig.test.json

* Address Matt's comments
2021-11-12 11:22:05 -08:00
Matthew Soulanille 7d7fe57ddb
Fix tfjs_web_test in Chrome on WSL (#5745)
Pass the correct bash variables to Karma when running under Windows Subsystem for Linux (WSL). Add instructions for setting up WSL to build and test tfjs.
2021-10-28 10:39:49 -07:00
Matthew Soulanille 9e547530eb
[webgl] Fix nightly browser configurations (#5687)
Run the correct browsers in nightly and pass the correct parameters to them to match the original test-ci.sh file.

Pin Firefox to 90.

Fix square test comparison precision on Safari webgl1.
2021-10-01 15:15:20 -07:00
Ping Yu ed94a27288
[tfjs-layers] Bazel migration (#5672)
FEATURE
INTERNAL
* add more bazel build files

* remove the integration test directory

* enumerate tests

* require tests files

* fix tests

* fixed spyOn test errors

* fix more tests

* keep function name for esbuild

* fix more tests

* allow random flag for jasmine test

* updated deps

* merged

* fixed bazel lint

* fixed layers snippet tests

* fixed tests

* fix test failure

* fix bazel tests

* addressed comments

* addressed comments

* fix test

* fix bazel failure
2021-09-30 22:50:20 -07:00
Matthew Soulanille 27734906b8
Upgrade rules_nodejs to 4.2.0 (#5671)
Make the default ts_library macro behave like pre-4.0 versions of rules_nodejs by automatically setting package_name to module_name if its not set.

Temporarily mark webgl tests as not testonly to work around bazelbuild/rules_nodejs#2984 until the next release.

Add package_name to pkg_npm targets.
2021-09-28 09:59:58 -07:00
Matthew Soulanille 4c23b3dfbd
Only start browserstack tunnel when running on BrowserStack (#5651)
* Update root yarn.lock

* Only start browserstack tunnel when running on BrowserStack
2021-09-22 14:19:18 -07:00
Matthew Soulanille 2a7ce55363
[webgl] Build tfjs-backend-webgl with Bazel (#5562)
PROCESS
2021-09-22 10:03:32 -07:00
Matthew Soulanille b2068571a3
Make Bazel npm outputs match current packages (#5451)
Make npm packages generated by Bazel match what we currently publish to npm.

Also, add a webpack regression test to e2e that makes sure webpack can consume the npm packages we publish.

Additionally, fix a bug in version tests that was caused by setting package_name of a js_library and module_name of a ts_library to the same value. See the following link for more details:
4e73b8820a/tools/defaults.bzl (L206-L218)

Fixes #5382
2021-08-11 10:35:23 -07:00
Matthew Soulanille 80b5a04d7a
Extend default web test timeout to 15 minutes (#5443)
Co-authored-by: ahmedsabie <ahmedsabie@google.com>
2021-08-06 14:57:43 -04:00
Matthew Soulanille 8f0d17046a
Fix enumerate_tests.bzl on Windows (#5424)
* Fix enumerate_tests.bzl on Windows

Pass test file paths in a temp file instead of through command line arguments.

* Formatting
2021-08-03 11:14:10 -07:00
Matthew Soulanille a32cc50dbd
Run enumerate-tests with Bazel (#5361)
Add an enumerate_tests Bazel rule that generates a typescript file containing import statements for a list of files. See tools/enumerate_tests.bzl for details.
2021-08-02 15:11:46 -07:00
Matthew Soulanille 7965cdf816
Run only one browser per test in presubmit tests (#5372)
Add a presubmit_browsers option to tfjs_web_test that controls which browsers run on PR presubmits. If not specified, tfjs_web_test runs only the first browser in the browsers list for PR presubmits. All browsers run in nightly.

Add the nightly Bazel tag to enable running tests in nightly without also making them run in PR presubmits. Tests tagged with ci will run as presubmit tests and in nightly. Tests tagged with nightly will run in nightly only (unless also tagged with ci).
2021-07-26 13:29:26 -07:00
Matthew Soulanille 49ca772728
Use es5 for ts_library commonjs outputs (#5347)
Our node bundles are transpiled down to es5, so the ts_library commonjs outputs used by node should be es5 as well.

Co-authored-by: Ping Yu <4018+pyu10055@users.noreply.github.com>
2021-07-23 11:07:19 -07:00