-
-
Notifications
You must be signed in to change notification settings - Fork 219
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
[webpack] Migrate most js tests #35623
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Notably, in requirejs, tests do not include "base_main" js, which includes a bunch of global UI-oriented code: analytics, modals for accounting and for inactivity, etc. In webpack, these are part of the "commcarehq" bundle, which can end up in the dependency tree for tests - as an example, for hqwebapp, hqwebapps/js/widgets is a dependency of tests, and it includes commcarehq. To deal with this, I'm updating this template to not error out on this UI code. This is why the language script is moved up (by moving it above webpack.html, it's now available to all of the js in tests), and why the commcarehq-urls block is added (without this, notifications_service, which is part of base_main, errors out because it depends on querying the notifications url).
This is necessary because the mocha app itself doesn't have any templates that use webpack. It just has mocha/base.html, which is only used as a parent for templates in other apps.
…p-module-source-map This is necessary to get proper line numbers to show up in mocha stack traces.
Mocha templates are part of the django app they test, but they inherit from base.html in the mocha django app, and they use B3 unless they'rr part of a split app that has both B3 and B5 tests. See https://github.com/dimagi/commcare-hq/blob/98629eaea9bb2cd9984fc374eb25d3dd3a37d87a/corehq/apps/mocha/views.py#L13-L21
b0606df
to
597d81d
Compare
Silences warnings along the lines of "Managed item ... isn't a directory or doesn't contain a package.json"
This module was implemented for requirejs and is not needed for webpack.
597d81d
to
4a79d7e
Compare
millerdev
approved these changes
Jan 15, 2025
Co-authored-by: Daniel Miller <[email protected]>
'yarn build' no longer includes dev dependencies, but 'yarn dev' uses the --watch flag so it never returns.
…mmcare-hq into jls/mocha-experimental
millerdev
approved these changes
Jan 15, 2025
This was referenced Jan 15, 2025
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
dependencies
Pull requests that update a dependency file
product/invisible
Change has no end-user visible impact
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Technical Summary
This makes some updates to js testing infrastructure to support js tests that use webpack, and it migrates js tests except for reports and cloudcare.
I'm waiting on migrating reports & userreports tests until #35599 is live, just in case that one needs to be rolled back.
For cloudcare tests, I'll either incorporate them into #35594 or do them after that PR is released.
https://dimagi.atlassian.net/browse/SAAS-15985
Safety Assurance
Safety story
Primarily affects tests. There is one non-tests change (1f43a0f). I've verified that translations still show up on webpack pages.
Automated test coverage
yep
QA Plan
nope
Rollback instructions
Labels & Review