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

chore: Browser E2E tests for compass-web sandbox COMPASS-7598 COMPASS-7599 #5439

Merged
merged 26 commits into from
Feb 19, 2024

Conversation

lerouxb
Copy link
Contributor

@lerouxb lerouxb commented Feb 9, 2024

Extracted from #5355

This only runs the time before first query tests in compass-web / the browser. Future tickets will un-skip more tests.

I was going to add it to CI in a separate PR, but then figured it is better to prove that it works and the change for that is quite small.

There are two new npm run scripts in compass-e2e-tests:

    "test-web": "env DEBUG=hadron*,mongo*,compass* npm run test -- --test-compass-web",
    "test-web-noserver": "env DEBUG=hadron*,mongo*,compass* npm run test -- --test-compass-web --disable-start-stop --bail",

test-web just mirrors test and it will run some e2e tests against the compass-web sandbox. It starts the database using mongodb-runner and it starts compass-web itself. Then closes those at the end.
test-web-noserverver won't start the database or compass-web and won't stop them. It also bails on the first test failure. This is useful during e2e test development for maximum speed where you can start these things once and keep them running.

These commands also support the new env var BROWSER_NAME which defaults to "chrome". The other value that's currently supported is "firefox". This picks the browser to use in testing.

And then this PR also adds two new tasks (test-web-sandbox-chrome and test-web-sandbox-firefox) to the ubuntu build variant to run these tests in chrome and firefox. We're only doing the ubuntu variant for now because we don't have any platform differences in compass-web yet.

@@ -121,6 +125,10 @@ describe('Atlas Login', function () {
});

after(async function () {
if (TEST_COMPASS_WEB) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately mocha still calls after() if you this.skip() in before() and that's by design: mochajs/mocha#3120

try {
if (compassWeb.pid) {
debug(`killing compass-web [${compassWeb.pid}]`);
kill(compassWeb.pid);
Copy link
Contributor Author

@lerouxb lerouxb Feb 13, 2024

Choose a reason for hiding this comment

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

This is tree-kill because for some reason I had trouble killing the compass web webpack process on linux. Works locally on mac, but then would hit the 10 minute evergreen timeout at the end for linux in CI. I used why-is-node-running to see what's going on and it is clearly all of compass-web that's still sitting around.

I also looked at what we have in helpers/compass.ts to kill compass. That didn't seem to help here either.

It seems to be something specific to webpack. Another alternative is to just npm run compile and then serve up the static files, but the output of dist/ doesn't seem to work for that as is yet.

@lerouxb lerouxb merged commit bfe49e4 into main Feb 19, 2024
8 of 10 checks passed
@lerouxb lerouxb deleted the compass-web-e2e-browsers branch February 19, 2024 13:13
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.

4 participants