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: run website tests against netlify deployment #6212

Merged
merged 3 commits into from Feb 20, 2023

Conversation

JamesHenry
Copy link
Member

@JamesHenry JamesHenry commented Dec 14, 2022

Rather than running an extra dev-server on localhost within the Github agent, which has proven to be flaky, this runs the website tests against the actual Netlify deployment which we are doing anyway as part of our workflow.

In my initial implementation I had a very convoluted way of achieving it via Netlify build hooks and a webhook handler which triggered an additional workflow.

It has proven to be much simpler by leveraging the Netlify API instead (which was already done by an existing Github Action from the community)

@nx-cloud
Copy link

nx-cloud bot commented Dec 14, 2022

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 4d2544f. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 46 targets

Sent with 💌 from NxCloud.

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @JamesHenry!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint.

@netlify
Copy link

netlify bot commented Dec 14, 2022

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit 4d2544f
🔍 Latest deploy log https://app.netlify.com/sites/typescript-eslint/deploys/63f343359a6b0f000885517f
😎 Deploy Preview https://deploy-preview-6212--typescript-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@JamesHenry JamesHenry force-pushed the run-website-tests-against-netlify-deployment branch from 898afe4 to f57d58f Compare December 14, 2022 14:37
@JamesHenry JamesHenry force-pushed the run-website-tests-against-netlify-deployment branch from f57d58f to db1ef3d Compare February 20, 2023 09:15
@JamesHenry JamesHenry force-pushed the run-website-tests-against-netlify-deployment branch from db1ef3d to b0b3d63 Compare February 20, 2023 09:26
@@ -15,8 +15,6 @@ test.describe('Website', () => {
}
});
await page.goto('/');
expect(errorMessages).toStrictEqual([
"[error] Warning: ReactDOM.render is no longer supported in React 18. Use createRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot",
Copy link
Member Author

Choose a reason for hiding this comment

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

This error message was only applicable to the local dev-server and is not shown to our users on production builds. A nice extra benefit of this approach is that our testing is more representative of our end UX

@JamesHenry JamesHenry marked this pull request as ready for review February 20, 2023 09:51
@JamesHenry
Copy link
Member Author

JamesHenry commented Feb 20, 2023

The remaining website test failure is consistent with the same failure on the latest main run, so it is not related to the changes.

UPDATE: confirms the failure happens locally too

@@ -179,26 +179,38 @@ jobs:
contents: read # to fetch code (actions/checkout)

name: Website tests
# We technically do not need to wait for build within the pipeline any more because the build we care about is happening within Netlify, however,
# it is highly likely that if the CI one fails, the Netlify one will as well, so in order to not waste unncessary Github Actions minutes/resources,
# we do still keep this requirement here.
Copy link
Member

Choose a reason for hiding this comment

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

chuckles in #5573

Copy link
Member

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

⚡ yess!!!

@JamesHenry JamesHenry merged commit a26afcf into main Feb 20, 2023
@JamesHenry JamesHenry deleted the run-website-tests-against-netlify-deployment branch February 20, 2023 16:00
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants