-
Notifications
You must be signed in to change notification settings - Fork 24
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
Me 18059 esm tests over preview build #727
Conversation
✅ Deploy Preview for cld-video-player ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for cld-vp-esm-pages ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
LGTM 💪
I am not approving since i think Refael knows better about Playwright APIs than me
@@ -6,7 +6,7 @@ import { defineConfig, devices } from '@playwright/test'; | |||
export default defineConfig({ | |||
testMatch: /test\/e2e\/specs\/.*(\.spec.ts)/, | |||
|
|||
timeout: 45000, | |||
timeout: 150000, |
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.
Why did you have to increase the timeout?
(just curious why you needed this change)
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.
Ok i see now it is for the deployment preview to be loaded
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.
Yes. The page can take some time to be loaded so the timeout was increased.
|
||
const EDGE_ESM_URL = 'https://cld-vp-esm-pages.netlify.app/'; | ||
// On PR level it will use the preview deploy URL and locally it will use the latest EDGE. | ||
const ESM_URL = process.env.PREVIEW_URL || EDGE_ESM_URL; |
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.
const ESM_URL = process.env.PREVIEW_URL || EDGE_ESM_URL; | |
const ESM_URL = process.env.PREVIEW_URL ?? EDGE_ESM_URL; |
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.
Changed. Thanks.
// On PR level it will use the preview deploy URL and locally it will use the latest EDGE. | ||
const ESM_URL = process.env.PREVIEW_URL || EDGE_ESM_URL; | ||
// Flag to indicate if the deploy preview URL is ready | ||
let PREVIEW_URL_LOADED = false; |
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.
since this is a changing variable i think it is better to name it like isPreviewURLLoaded
... since a snake case is often associated with constant variables
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.
Changed. Thanks
* Waits for a deploy preview URL to become available by making repeated requests and check that link is visible. | ||
*/ | ||
async function waitForDeployPreviewUrl(link: ExampleLinkType, page: Page): Promise<void> { | ||
console.log('Waiting for deploy preview to be ready...'); |
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.
console.log('Waiting for deploy preview to be ready...'); |
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.
The print was added to get indication that we're waiting for the preview and not just wait long time without any indication which can feel like something is stuck.
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.
Print was removed
The change is to run on the ESM test over deploy preview build instead from edge.
Local tests (if needed to run from the branch) will be executed against latest EDGE (https://cld-vp-esm-pages.netlify.app/)
Also added waitForDeployPreviewUrl function to check if deploy URL is ready
Relevant task: https://cloudinary.atlassian.net/browse/ME-18059