-
Notifications
You must be signed in to change notification settings - Fork 247
chore(e2e): refactor compass-web with atlas tests to run against real atlas instead of sandbox with proxy COMPASS-10280 #7739
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
Conversation
…las-cloud-external logic
… cloud url instead of local sandbox with atlas proxy
| 'application/octet-stream', | ||
| }); | ||
| if (req.method === 'GET') { | ||
| fs.createReadStream(requestedPath).pipe(res); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Snyk gets erroneously triggered on this line and I don't know how to tell it that the issue it suggests exists is false 😕
This became flaky in firefox all of a sudden
…om the previous select
| ...browserCapabilities[context.browserName], | ||
|
|
||
| // from https://github.com/webdriverio-community/wdio-electron-service/blob/32457f60382cb4970c37c7f0a19f2907aaa32443/packages/wdio-electron-service/src/launcher.ts#L102 | ||
| 'wdio:enforceWebDriverClassic': true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I initially removed this trying to use browser.mock to replace the assets instead of redirect web extension, but this didn't work out for a couple of reasons (firefox support, weird behavior after re-launches). We don't need to disable webdriver bidi protocol for web testing though, so I'm keeping this change
|
Started another manual patch (✅) with tests after some clean-up around sign in commands |
nbbeeken
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good!
| return; | ||
| } | ||
|
|
||
| res.writeHead(401); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| res.writeHead(401); | |
| res.writeHead(405); |
not really important but unauthorized vs method not allowed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should just start putting 418 every time I can't remember the exact code for client error :P
…e already acceptable url for no good reason
|
This is so silly, I added a suggested fix to shut Snyk up and it's still saying that url is not sanitized, what a useful tool we have |
This patch changes the current e2e test flow for compass-web with atlas proxy via local sandbox to run against an actual cloud url with the compass-web assets swapped to the local version. This works as follows: we create a web extension that handles the redirect and preload it in the browser before running the tests. Atlas project that tests are running against has a feature flag for loading compass from external activated, this external entrypoint matches the regex in the extension and redirects to the localhost file server that serves the local build. This local build is as close to the real one that we will release as possible with the exception for a few internals that we have to expose for testing purposes.
This change is a bit more involved than a previous PR I opened and it kinda needs to happen at the same time, so not much I can split out here to separate PRs. I did my best to make sure that every commit is self contained and has a meaningful commit message.
We don't allow these e2e tests to run on patches, so I had to spawn them manually with a modified evergreen config file: one (is already green) and two (also green, started it after moving some code around)
You can also run these tests locally, but this requires some extra setup upfront. The process is described in
.evergreen/start-atlas-cloud-cluster.shfile and you would additionally need to enable themms.featureFlag.dataExplorerCompassWeb.loadFromCDNand disablemms.featureFlag.dataExplorerCompassWeb.restoreWorkspacesfeature flags for the project you create.