Skip to content

Commit

Permalink
Only test UI on master, release, merge, and UI branches (#11813)
Browse files Browse the repository at this point in the history
  • Loading branch information
ncabatoff authored Jun 10, 2021
1 parent 13e61a8 commit 8377459
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 16 deletions.
25 changes: 14 additions & 11 deletions .circleci/config.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions .circleci/config/commands/exit-if-branch-does-not-need-test-ui.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
description: >
Check if branch name starts with ui/ or docs/ and if so, exit.
steps:
- run:
working_directory: ~/
name: Check branch name
command: |
case "$CIRCLE_BRANCH" in
master|ui/*|release/*|merge*) ;;
*) # If the branch being tested doesn't match one of the above patterns,
# we don't need to run test-ui and can abort the job.
circleci-agent step halt
;;
esac
# exit with success either way
exit 0
1 change: 0 additions & 1 deletion .circleci/config/jobs/test-go-nightly.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
executor: go-machine
steps:
- check-branch-name
- setup-go
- checkout
- go_test:
Expand Down
2 changes: 1 addition & 1 deletion .circleci/config/jobs/test-go-race-remote-docker.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
executor: docker-env-go-test-remote-docker
parallelism: 8
steps:
- check-branch-name
- exit-if-ui-or-docs-branch
- checkout
- setup_remote_docker:
version: 18.09.3
Expand Down
2 changes: 1 addition & 1 deletion .circleci/config/jobs/test-go-race.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
executor: docker-env-go-test-race
parallelism: 8
steps:
- check-branch-name
- exit-if-ui-or-docs-branch
- checkout
- go_test:
extra_flags: "-race"
Expand Down
2 changes: 1 addition & 1 deletion .circleci/config/jobs/test-go-remote-docker.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
executor: docker-env-go-test-remote-docker
parallelism: 8
steps:
- check-branch-name
- exit-if-ui-or-docs-branch
- checkout
- setup_remote_docker:
version: 18.09.3
Expand Down
2 changes: 1 addition & 1 deletion .circleci/config/jobs/test-go.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
executor: docker-env-go-test
parallelism: 8
steps:
- check-branch-name
- exit-if-ui-or-docs-branch
- checkout
- go_test:
log_dir: "/tmp/testlogs"
Expand Down
1 change: 1 addition & 0 deletions .circleci/config/jobs/test-ui.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
executor: node
resource_class: xlarge
steps:
- exit-if-branch-does-not-need-test-ui
- checkout
- restore_yarn_cache
- attach_workspace:
Expand Down
7 changes: 7 additions & 0 deletions .circleci/config/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ jobs:
requires:
- install-ui-dependencies
- build-go-dev
# Only master, UI, release and merge branches need to run UI tests.
# We don't filter here however because test-ui is configured in github as
# required so it must run, instead we short-circuit within test-ui.
- test-ui-browserstack:
requires:
- install-ui-dependencies
Expand All @@ -24,9 +27,13 @@ jobs:
- test-go:
requires:
- pre-flight-checks
# We don't filter here because this is a required CI check;
# instead we short-circuit within the test command so it ends quickly.
- test-go-remote-docker:
requires:
- pre-flight-checks
# We don't filter here because this is a required CI check;
# instead we short-circuit within the test command so it ends quickly.
- test-go-race:
requires:
- pre-flight-checks
Expand Down

0 comments on commit 8377459

Please sign in to comment.