-
Notifications
You must be signed in to change notification settings - Fork 55
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
[Tech Debt] Update tests to be able to run against live staging/production environments #146
base: master
Are you sure you want to change the base?
Conversation
9cb499d
to
b104083
Compare
…ction environments
b104083
to
e12ebbd
Compare
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’m torn between this approach (where the running test site supports all different environments and the user of the test site chooses which one to use on a page-by-page basis at runtime with query params) vs an approach where the test site environment is set at execution-time (via something like npm run test-site-dev
vs npm run test-site-staging
).
I would guess that one is usually not switching environments during a single testing session (so the flexibility of approach 1 is less useful) and it’s probably simpler to execute a test if you don’t have to deal with setting the environment each time you load a page (so approach 2 would make it easier both to write automated tests and to perform manual tests against the test site).
let dapCodeLocation; | ||
dapScriptTag.id = "_fed_an_ua_tag"; | ||
dapScriptTag.async = 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.
There aren't any automated tests hitting it yet but I guess this would need to be replicated on the youtube.html
page too.
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.
Can something like Server Side Includes be used to insert this script in the <head>
of every page in the test site? I should have thought about that when I first committed this file.
I agree that it would really odd to switch environments in the middle of a testing session, so we probably don't have to account for that case. The only advantage I can think of for keeping the env setting in the test runner is to be able to customize test expectations by environment. But this also seems to only be useful for a small set of tests currently that check for unexpected request hostnames and there are workarounds for it. |
I agree with your assessment. I think I prefer approach 2 (for ease of executing tests) however I don't feel strongly and I'm happy to approve this approach too. |
No description provided.