-
Notifications
You must be signed in to change notification settings - Fork 839
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
[INFRA] Parallelize Buildkite test
job, take 2
#7209
Conversation
…ss test to BK runner.
This reverts commit be2d304.
…failures in unit tests.
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.
Left some inline comments explaining decisions. If we want to run snapshots against React 17 in cases where I've limited them to React 18, that should be easy enough. If the snapshots rewrite for different versions, I'll take that as a sign to refactor to unit tests.
- command: .buildkite/scripts/pipeline_test.sh | ||
label: ":jest: TS unit tests" | ||
agents: | ||
provider: "gcp" | ||
env: | ||
TEST_TYPE: 'unit:ts' | ||
if: build.branch != "main" |
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.
Once this PR merges, I want to find a way to build our Docker image once, and use a cached version for each command
step. This works, but is downloading the Docker image multiple times so it's not as efficient as it could be.
I'm looking at a couple of options for building a safe cached Docker container that could be possibilities after I reduce the image complexity (Puppeteer user and associated libs).
testOnReactVersion(['18'])( | ||
'collapses from a push flyout to an overlay flyout once the screen is smaller than 3x the flyout width', | ||
() => { | ||
mockWindowResize(600); | ||
const { baseElement } = render( | ||
<EuiCollapsibleNavBeta>Nav content</EuiCollapsibleNavBeta> | ||
); | ||
expect(baseElement).toMatchSnapshot(); | ||
} | ||
); | ||
|
||
testOnReactVersion(['18'])( | ||
'makes the overlay flyout full width once the screen is smaller than 1.5x the flyout width', | ||
() => { | ||
mockWindowResize(320); | ||
const { baseElement } = render( | ||
<EuiCollapsibleNavBeta>Nav content</EuiCollapsibleNavBeta> | ||
); | ||
expect(baseElement).toMatchSnapshot(); | ||
} | ||
); | ||
|
||
it('makes the overlay flyout full width once the screen is smaller than 1.5x the flyout width', () => { | ||
it('dauptes the overlay controls once the screen is smaller than 1.5x the flyout width', () => { | ||
mockWindowResize(320); | ||
const { baseElement, getByTestSubject } = render( | ||
const { baseElement, getByLabelText, getByTestSubject } = render( | ||
<EuiCollapsibleNavBeta>Nav content</EuiCollapsibleNavBeta> | ||
); | ||
expect(getByLabelText('Toggle navigation open')).toBeInTheDocument(); | ||
fireEvent.click(getByTestSubject('euiCollapsibleNavButton')); | ||
expect(baseElement).toMatchSnapshot(); | ||
expect(getByLabelText('Toggle navigation closed')).toBeInTheDocument(); |
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 refactored this to two React 18 snapshot tests and an actual unit test for mobile adaptive behavior on Cee's recommendation in a Slack chat. The prior snapshot tests were rewriting themselves when I ran them in React 16, so this felt a better approach with respect to test coverage.
Preview staging links for this PR:
|
💚 Build Succeeded
History
cc @1Copenut |
test
job, take 2test
job, take 2
} else { | ||
Adapter = require('enzyme-adapter-react-16'); |
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.
Just curious, what tests were failing when this wasn't being used?
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.
A large number of unit tests were failing, over a third, spread across multiple suites.
Closing this PR as |
Summary
This PR is a second attempt to split our Buildkite
test
job and run the linter, unit tests, and Cypress tests in parallel. It switches back to usingnpm
instead ofyarn
. This allows us to allocate more resources in Node to prevent test failures. See #7197 for the previous iteration of this PR.This improved version will split Jest TSX tests and Cypress tests to run against React version
[16, 17, 18]
.QA
QA will be done manually by verifying the test runs on Buildkite UI.
(.ts|.js)
unit tests ran.tsx
ran on React 18