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

Bundle JavaScript on-demand for JS feature specs #6392

Merged
merged 1 commit into from May 20, 2022

Conversation

aduth
Copy link
Member

@aduth aduth commented May 20, 2022

Why: So that developers don't need to be aware of and expend the effort to run yarn build every time before running a JavaScript-enabled feature spec, in order to avoid CSP errors related to the external Webpack dev server host.

Testing Instructions:

  1. Run rspec spec/features/visitors/i18n_spec.rb:68
  2. Observe in output...
Bundling JavaScript...
yarn build
...

**Why**: So that developers don't need to be aware of and expend the effort to run "yarn build" every time before running a JavaScript-enabled feature spec, in order to avoid CSP errors related to the external Webpack dev server host.

changelog: Internal, Automated Testing, Improve developer ergonomics for running JavaScript-enabled integration specs
@aduth aduth requested a review from solipet May 20, 2022 19:29
Copy link
Contributor

@zachmargolis zachmargolis left a comment

Choose a reason for hiding this comment

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

LGTM

@aduth aduth merged commit 01d473d into main May 20, 2022
@aduth aduth deleted the aduth-js-spec-yarn-build branch May 20, 2022 20:20
aduth added a commit that referenced this pull request May 23, 2022
**Why**: Avoid potential conflicts for...

1. Environment variables which can affect intended build output expecting Webpack dev server
2. False negatives for Make "nothing to do" if environment variable would impact build artifact

Previously: #6392

changelog: Internal, Automated Testing, Improve developer ergonomics for running JavaScript-enabled integration specs
sheldon-b added a commit that referenced this pull request May 23, 2022
* Run feature specs prebuild with unset Webpack env

**Why**: Avoid potential conflicts for...

1. Environment variables which can affect intended build output expecting Webpack dev server
2. False negatives for Make "nothing to do" if environment variable would impact build artifact

Previously: #6392

changelog: Internal, Automated Testing, Improve developer ergonomics for running JavaScript-enabled integration specs

* before all -> before suite

So that it's run only once for all tests

Co-Authored-By: Zach Margolis <zbmargolis@gmail.com>
Co-Authored-By: Sheldon Bachstein <bachsteinsk@gmail.com>

* Use global to run webpack build once

* Bundle CSS

Co-authored-by: Zach Margolis <zbmargolis@gmail.com>
Co-authored-by: Sheldon Bachstein <bachsteinsk@gmail.com>
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.

None yet

2 participants