Open
Conversation
…hat-widget.spec.js
…or SSL certificates
…ptimize page navigation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
After upgrading from Playwright
1.45.3to1.58.2, the old E2E setup based onhttp://primo-explore-devenv:8003became unstable. Chromium/Chrome started surfacingsecure-context / private-networkerrors likerequest client is not a secure contextandresource is in more-private address space 'local', see here, so the direct HTTP entrypoint was no longer reliable. To fix that, a dedicated HTTPS proxy (e2e-tls) was introduced and Playwright was moved to a single browser-facing origin:https://e2e.nyu.primo.exlibrisgroup.com, withignoreHTTPSErrors: truefor the self-signed certs.That solved the main local blocker, but CircleCI still failed because
e2e-tlsdepended on a bind-mounted nginx config. In remote Docker, nginx came up without the expected config, healthchecks failed, and the container never became healthy.The final fix was to bake
nginx/conf.d-e2eintoDockerfile.nginx-e2e, keep a simple local/healthzendpoint for proxy health, and keep a separate readiness wait in the e2e entrypoint for the real app route. That split made the E2E stack stable again locally and in CircleCI remote Docker: Docker checks‘nginx is up’the entrypoint checks‘the app is ready’and Playwright runs against one secure origin withignoreHTTPSErrors: true.About the new nginx proxy setup: nginx now sits in front of the whole E2E flow and gives the browser a single secure origin,
https://e2e.nyu.primo.exlibrisgroup.com. From there it routes requests internally to the right backend: Primo app traffic goes toprimo-explore-devenv, customization assets go tocdn-server, and selected upstream paths can still fall through toEx Libris. It also rewrites JS responses that still contain baked CDN URLs so those assets are pulled back through the same E2E origin instead of crossing origins in the browser. That is why the nginx config is larger than a normal reverse proxy: it is not just terminating TLS, it is also enforcing the same-origin model that made the Playwright runs reliable again.modifyCSPHeaderwas deprecated and removed because it was only a workaround for the old E2E setup. It strippedupgrade-insecure-requestsfrom Primo’s CSP in Playwright so the browser would not interfere with insecure or cross-origin startup requests. After moving the suite behind the HTTPSe2e-tlsproxy and a single browser-facing origin, that browser-side CSP patch was no longer needed. Nginx was solving the problem structurally, so the helper and its unit tests were removed.An obsolete E2E spec,
matching-url-pattern.spec.js, was also removed. That test only exercised a Playwright-side response interception pattern that strippedupgrade-insecure-requestsfrom the CSP header for/discovery/search. After the move to the HTTPSe2e-tlsproxy and single browser-facing origin, that approach was no longer part of the active E2E design. The test was therefore validating a deprecated workaround rather than current system behavior, so it was deleted.CONTAINER_MODEwas removed for the same reason. Once the Docker-based HTTPS proxy setup became the only supported E2E path, there was no longer a need for the codebase to branch between container and non-container behavior. KeepingCONTAINER_MODEwould have preserved an obsolete execution mode that no longer matched the actual test environment, so it was removed along with the non-container path.A small CircleCI diagnostics step was also added for failures. When the E2E job fails, Circle now captures Docker state such as container status,
app-e2e-tls-1logs, and container inspect output. That made it possible to see that the CI problem was not the upstream app, but thate2e-tlswas starting without the expected nginx config and never becoming healthy.