Skip to content
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

Basic HTML property testing for WebAssembly #425

Merged
merged 6 commits into from
Jun 21, 2022

Conversation

jerinphilip
Copy link
Contributor

@jerinphilip jerinphilip commented Jun 21, 2022

Imports
https://gist.github.com/jelmervdl/a4c8b6b92ad88a885e1cbd51c6ad4902 and
attach it to CI. NodeJS-14 is failing on trying to use the WebAssembly
binary. So we use node-16 independently setup. This paves way for more
complicated testing for WebAssembly bindings in the future. It should be possible
to remove minimal builds in favour of closer to WebAssembly tests following this
change.

mozilla/firefox-translations#353 phases out wormhole.
This change removes the .js and .wasm with wormhole from the GitHub
release done. (This does not edit Mozilla's CircleCI or files, nor attempt to
remove WORMHOLE completely).

This also includes a fix for a .js and .wasm release broken in #424.
GitHub CI code verified to work as intended at at fork
(https://github.com/jerinphilip/bergamot-translator).

Related to: #421, #330

Import
https://gist.github.com/jelmervdl/a4c8b6b92ad88a885e1cbd51c6ad4902 and
attach it to CI.  NodeJS-14 is failing on trying to use the WebAssembly
binary. So we use node-16 independently setup.  This paves way for more
complicated testing for WebAssembly bindings in the future.
@jerinphilip jerinphilip requested a review from jelmervdl June 21, 2022 09:44
const output = service.translate(model, input, options);

// Get output from std::vector<Response>
console.log(output.get(0).getTranslatedText());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it check the output to be "Hallo Welt!", to detect whether it is producing rubbish or not?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm more in favour of property based testing. Input valid non-empty HTML, did I get valid non-empty HTML translation out, that sort. I expect such stuff to grow if we start exposing a JS library as mentioned in #330. Adding ASSERT_EQUALS will give us pain if compiler etc changes, which often happened in BRT.

jelmervdl
jelmervdl previously approved these changes Jun 21, 2022
Copy link
Member

@jelmervdl jelmervdl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jerinphilip jerinphilip changed the title Add 'it works' CI to WebAssembly Basic HTML property testing for WebAssembly Jun 21, 2022
@jerinphilip jerinphilip merged commit 8771078 into browsermt:main Jun 21, 2022
@jerinphilip jerinphilip deleted the wasm-ci-cleanup branch June 21, 2022 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants