-
Notifications
You must be signed in to change notification settings - Fork 841
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 3 #7242
Changes from 5 commits
c2a6f6c
9511160
612d2ec
71301a0
f59bcbf
92cb6e3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,72 @@ | ||
# 🏠/.buildkite/pipelines/pipeline_pull_request_test.yml | ||
|
||
steps: | ||
- agents: | ||
- command: .buildkite/scripts/pipeline_test.sh | ||
label: ":typescript: Linting" | ||
agents: | ||
provider: "gcp" | ||
command: .buildkite/scripts/pipeline_test.sh | ||
if: build.branch != "main" # We're skipping testing commits in main for now to maintain parity with previous Jenkins setup | ||
env: | ||
TEST_TYPE: 'lint' | ||
if: build.branch != "main" # This job is triggered by the combined test and deploy docs for every PR | ||
|
||
- command: .buildkite/scripts/pipeline_test.sh | ||
label: ":jest: TS unit tests" | ||
agents: | ||
provider: "gcp" | ||
env: | ||
TEST_TYPE: 'unit:ts' | ||
if: build.branch != "main" | ||
|
||
- command: .buildkite/scripts/pipeline_test.sh | ||
label: ":jest: TSX unit tests on React 16" | ||
agents: | ||
provider: "gcp" | ||
env: | ||
TEST_TYPE: 'unit:tsx:16' | ||
if: build.branch != "main" | ||
|
||
- command: .buildkite/scripts/pipeline_test.sh | ||
label: ":jest: TSX unit tests on React 17" | ||
agents: | ||
provider: "gcp" | ||
env: | ||
TEST_TYPE: 'unit:tsx:17' | ||
if: build.branch != "main" | ||
|
||
- command: .buildkite/scripts/pipeline_test.sh | ||
label: ":jest: TSX unit tests on React 18" | ||
agents: | ||
provider: "gcp" | ||
env: | ||
TEST_TYPE: 'unit:tsx' | ||
if: build.branch != "main" | ||
|
||
- command: .buildkite/scripts/pipeline_test.sh | ||
label: ":cypress: Cypress tests on React 16" | ||
agents: | ||
provider: "gcp" | ||
env: | ||
TEST_TYPE: 'cypress:16' | ||
if: build.branch != "main" | ||
artifact_paths: | ||
- "cypress/screenshots/**/*.png" | ||
|
||
- command: .buildkite/scripts/pipeline_test.sh | ||
label: ":cypress: Cypress tests on React 17" | ||
agents: | ||
provider: "gcp" | ||
env: | ||
TEST_TYPE: 'cypress:17' | ||
if: build.branch != "main" | ||
artifact_paths: | ||
- "cypress/screenshots/**/*.png" | ||
|
||
- command: .buildkite/scripts/pipeline_test.sh | ||
label: ":cypress: Cypress tests on React 18" | ||
agents: | ||
provider: "gcp" | ||
env: | ||
TEST_TYPE: 'cypress:18' | ||
if: build.branch != "main" | ||
artifact_paths: | ||
- "cypress/screenshots/**/*.png" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,17 +2,63 @@ | |
|
||
set -euo pipefail | ||
|
||
docker run \ | ||
-i --rm \ | ||
--env GIT_COMMITTER_NAME=test \ | ||
--env GIT_COMMITTER_EMAIL=test \ | ||
--env HOME=/tmp \ | ||
--user="$(id -u):$(id -g)" \ | ||
--volume="$(pwd):/app" \ | ||
--workdir=/app \ | ||
docker.elastic.co/eui/ci:5.3 \ | ||
bash -c "/opt/yarn*/bin/yarn \ | ||
&& yarn cypress install \ | ||
&& yarn lint \ | ||
&& yarn test-unit --node-options=--max_old_space_size=2048 \ | ||
&& yarn test-cypress --node-options=--max_old_space_size=2048" | ||
DOCKER_OPTIONS=( | ||
-i --rm | ||
--env GIT_COMMITTER_NAME=test | ||
--env GIT_COMMITTER_EMAIL=test | ||
--env HOME=/tmp | ||
--user="$(id -u):$(id -g)" | ||
--volume="$(pwd):/app" | ||
--workdir=/app | ||
docker.elastic.co/eui/ci:5.3 | ||
) | ||
|
||
case $TEST_TYPE in | ||
lint) | ||
echo "[TASK]: Running linters" | ||
DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn lint") | ||
;; | ||
|
||
unit:ts) | ||
echo "[TASK]: Running .ts and .js unit tests" | ||
DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn test-unit --node-options=--max_old_space_size=2048 --testMatch=non-react") | ||
;; | ||
|
||
unit:tsx:16) | ||
echo "[TASK]: Running Jest .tsx tests against React 16" | ||
DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn test-unit --node-options=--max_old_space_size=2048 --react-version=16 --testMatch=react") | ||
;; | ||
|
||
unit:tsx:17) | ||
echo "[TASK]: Running Jest .tsx tests against React 17" | ||
DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn test-unit --node-options=--max_old_space_size=2048 --react-version=17 --testMatch=react") | ||
;; | ||
|
||
unit:tsx) | ||
echo "[TASK]: Running Jest .tsx tests against React 18" | ||
DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn test-unit --node-options=--max_old_space_size=2048 --testMatch=react") | ||
;; | ||
|
||
cypress:16) | ||
echo "[TASK]: Running Cypress tests against React 16" | ||
DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn test-cypress --node-options=--max_old_space_size=2048 --react-version=16") | ||
;; | ||
|
||
cypress:17) | ||
echo "[TASK]: Running Cypress tests against React 17" | ||
DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn test-cypress --node-options=--max_old_space_size=2048 --react-version=17") | ||
;; | ||
|
||
cypress:18) | ||
echo "[TASK]: Running Cypress tests against React 18" | ||
DOCKER_OPTIONS+=(bash -c "/opt/yarn*/bin/yarn && yarn test-cypress --node-options=--max_old_space_size=2048") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we still need to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I'm not a super huge fan of that because it's another fragility point between local and CI that could fall out of date if we forget (e.g. we update package.json but not the dockerfile). It's 100% happened in the past before as well, so I'd rather the Docker container reuse There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's valid. I'll add the |
||
;; | ||
|
||
*) | ||
echo "[ERROR]: Unknown task" | ||
echo "Exit code: 1" | ||
exit 1 | ||
;; | ||
esac | ||
|
||
docker run "${DOCKER_OPTIONS[@]}" |
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.
these labels and icons are heckin beautiful!