Skip to content

Fix local RSpec tests due to bug in `webpack_bundle_tag`

Mike Greiling requested to merge fix-local-rspec-tests into master

What does this MR do?

The force_same_domain argument added to webpack_bundle_tag in gitlab-org/gitlab-ce!16459 inadvertently breaks our ability to run RSpec tests locally. In order for RSpec to communicate with webpack-dev-server it needs to reference the hostname and port for the dev server rather than referencing an absolute path, and this change blocks that from happening.

In addition to this, the webpack_bundle_tag implementation was taking in a force_same_domain argument, but was subsequently ignoring it and always passing in true. This effectively disables any CDN settings for webpack asset paths and breaks RSpec for every feature test run with webpack-dev-server.

This merge request fixes the latter bug, but we should also open a follow-up issue to clean up the overall implementation of this force_same_domain argument.

/cc @ClemMakesApps @jschatz1 @jivanvl @rspeicher @timzallmann

Are there points in the code the reviewer needs to double check?

Why was this MR needed?

Screenshots (if relevant)

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Related: #42454 (moved), Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/42368

Edited by Clement Ho

Merge request reports