New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make Bazel npm outputs match current packages #5451
Make Bazel npm outputs match current packages #5451
Conversation
@@ -1,6 +1,6 @@ | |||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file was not renamed. e2e/webpack_test/app.js is a new file, and version_test.ts was deleted since it's now generated by Bazel.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the fix, Matt! It looks much cleaner!
Reviewable status: complete! 1 of 1 approvals obtained (waiting on @mattsoulanille)
tfjs-core/src/BUILD.bazel, line 87 at r1 (raw file):
:version_test
Is it possible to only run version_test in release flow? Similarly, we may also want to run bundle size tests in release or nightly flow. How can we support this use case? Just curious whether it's possible, the actual solution can be in a separate PR.
tools/make_version_test_file.ts, line 69 at r1 (raw file):
core
Consider parameterize this part too to accomodate other version tests, such as:
converter: https://github.com/tensorflow/tfjs/blob/master/tfjs-converter/src/version_test.ts
wasm: https://github.com/tensorflow/tfjs/blob/master/tfjs-backend-wasm/src/version_test.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review!
Reviewable status: complete! 1 of 1 approvals obtained (waiting on @lina128)
tfjs-core/src/BUILD.bazel, line 87 at r1 (raw file):
Previously, lina128 (Na Li) wrote…
:version_test
Is it possible to only run version_test in release flow? Similarly, we may also want to run bundle size tests in release or nightly flow. How can we support this use case? Just curious whether it's possible, the actual solution can be in a separate PR.
That's an interesting question. For the version test, it's more difficult to test only during release because it is added to the tests.ts
file due to being a dependency of the rule that generates it, and there isn't a good way to change dependencies based on development vs release (as far as I know).
The bundle size rules are also tricky since they run in the current PR's branch and the master branch (by cloning a copy of it). The first part is easy with Bazel. We can just write a test rule that checks the output size of the bundles. The second part, comparing the size to the master branch, is more difficult since it requires running tests in a completely different Bazel workspace which has the exact same name as the current workspace. This is likely not easy to do with Bazel, and may actually be impossible. This script may need to remain as a shell script.
tools/make_version_test_file.ts, line 69 at r1 (raw file):
Previously, lina128 (Na Li) wrote…
core
Consider parameterize this part too to accomodate other version tests, such as:
converter: https://github.com/tensorflow/tfjs/blob/master/tfjs-converter/src/version_test.ts
wasm: https://github.com/tensorflow/tfjs/blob/master/tfjs-backend-wasm/src/version_test.ts
That's a good point. We may want to pass a template file to the make_version_test_file rule to allow different packages to use it with their own version test logic, although maybe the pattern is similar enough to implement with code generation. I think this is best addressed when we convert another package that has a version test.
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, it fixes a bug in version tests that was caused by setting
package_name
of a js_library andmodule_name
of a ts_library to the same value. See this for more details.Fixes #5382
To see the logs from the Cloud Build CI, please join either our discussion or announcement mailing list.
This change is