Skip to content

Commit

Permalink
workflows: make unit tests build mandatory in GitHub Actions
Browse files Browse the repository at this point in the history
And delete related TC scripts. Note that the unit tests job in GitHub
Actions subsumes the unit test jobs in TC as well as the UI lint and UI
test job.

Epic: CRDB-8308
Release note: None
  • Loading branch information
rickystewart committed Apr 23, 2024
1 parent 6aa8810 commit c331a4d
Show file tree
Hide file tree
Showing 13 changed files with 30 additions and 91 deletions.
2 changes: 1 addition & 1 deletion .github/bors.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# List of commit statuses that must pass on the merge commit before it is
# pushed to master.
status = [
"Bazel Essential CI (Cockroach)",
"acceptance",
"check_generated_code",
"docker_image_amd64",
Expand All @@ -16,6 +15,7 @@ status = [
"local_roachtest_fips",
"macos_amd64_build",
"macos_arm64_build",
"unit_tests",
"windows_build",
]

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/github-actions-essential-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ jobs:
- name: clean up
run: ./build/github/cleanup-engflow-keys.sh
if: always()
EXPERIMENTAL_unit_tests:
unit_tests:
runs-on: [self-hosted, basic_runner_group]
steps:
- uses: actions/checkout@v4
Expand All @@ -282,7 +282,7 @@ jobs:
- run: ./build/github/get-engflow-keys.sh
- run: ./build/github/prepare-summarize-build.sh
- name: run tests
run: bazel test //pkg:all_tests //pkg/ui:lint //pkg/ui:test --config crosslinux --jobs 300 --remote_download_minimal --bes_keywords ci-unit-test --config=use_ci_timeouts --build_event_binary_file=bes.bin $(./build/github/engflow-args.sh)
run: ./build/github/unit-tests.sh
- name: upload test results
run: ./build/github/summarize-build.sh bes.bin
if: always()
Expand Down
17 changes: 17 additions & 0 deletions build/github/unit-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

set -euxo pipefail

EXTRA_PARAMS=""

if [ "$GITHUB_ACTIONS_BRANCH" == "staging" ]; then
# enable up to 1 retry (2 attempts, worst-case) per test executable to report flakes but only on release branches and staging.
EXTRA_PARAMS=" --flaky_test_attempts=2"
fi


bazel test //pkg:all_tests //pkg/ui:lint //pkg/ui:test \
--config crosslinux --jobs 300 --remote_download_minimal \
--bes_keywords ci-unit-test --config=use_ci_timeouts \
--build_event_binary_file=bes.bin $(./build/github/engflow-args.sh) \
$EXTRA_PARAMS
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,11 @@

set -euo pipefail

source build/teamcity/cockroach/ci/tests/unit_tests.sh
dir="$(dirname $(dirname $(dirname $(dirname $(dirname "${0}")))))"

source "$dir/teamcity-support.sh" # For $root
source "$dir/teamcity-bazel-support.sh" # For run_bazel

tc_start_block "Run unit tests"
BAZEL_SUPPORT_EXTRA_DOCKER_ARGS="-e TC_BUILD_BRANCH -e GITHUB_API_TOKEN -e BUILD_VCS_NUMBER -e TC_BUILD_ID -e TC_SERVER_URL -e TC_BUILDTYPE_ID -e GITHUB_REPO" run_bazel build/teamcity/cockroach/ci/tests-aws-linux-arm64-bigvm/unit_tests_impl.sh
tc_end_block "Run unit tests"
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ if tc_bors_branch; then
fi

$(bazel info bazel-bin --config=ci)/pkg/cmd/bazci/bazci_/bazci -- test --config=ci --config=use_ci_timeouts -c fastbuild \
//pkg:ccl_tests \
--profile=/artifacts/profile.gz $EXTRA_PARAMS
//pkg:all_tests \
--profile=/artifacts/profile.gz $EXTRA_PARAMS

This file was deleted.

12 changes: 0 additions & 12 deletions build/teamcity/cockroach/ci/tests/ui_lint.sh

This file was deleted.

6 changes: 0 additions & 6 deletions build/teamcity/cockroach/ci/tests/ui_lint_impl.sh

This file was deleted.

12 changes: 0 additions & 12 deletions build/teamcity/cockroach/ci/tests/ui_test.sh

This file was deleted.

6 changes: 0 additions & 6 deletions build/teamcity/cockroach/ci/tests/ui_test_impl.sh

This file was deleted.

12 changes: 0 additions & 12 deletions build/teamcity/cockroach/ci/tests/unit_tests.sh

This file was deleted.

12 changes: 0 additions & 12 deletions build/teamcity/cockroach/ci/tests/unit_tests_ccl.sh

This file was deleted.

20 changes: 0 additions & 20 deletions build/teamcity/cockroach/ci/tests/unit_tests_impl.sh

This file was deleted.

0 comments on commit c331a4d

Please sign in to comment.