From 1308eb2b9734c73fbe1592a35cf8fce82de26024 Mon Sep 17 00:00:00 2001 From: Preetam Dwivedi Date: Thu, 10 Sep 2026 22:53:17 -0700 Subject: [PATCH 1/2] fix(ci): fail hung unit tests and skip a redundant bazel build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary ### Why? Build and Unit Test on PR CI sat on `//service/runway/server:go_default_test` until Bazel's 300s timeout because a consumer test sent a message with no tenant. After tenant sharding the consumer rejects that delivery before Process, so the nack path never closed `done`. `make test` then swallowed the Bazel failure with `|| echo`, so the job still went green. ### What? Set `Tenant` on the mock message so the delivery reaches Process. Drop the `|| echo` so `make test` fails when Bazel does. Add `--build_tests_only` and remove the extra `make build` step from that CI job; `bazel test` already compiles what the tests need. ## Test Plan ✅ `bazel test //service/runway/server:go_default_test` PASSED in 5.5s (was TIMEOUT 300s) Co-authored-by: Cursor --- .github/workflows/ci.yml | 3 --- Makefile | 2 +- service/runway/server/main_test.go | 1 + 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 570204aa..f9f7306c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -82,9 +82,6 @@ jobs: persist-credentials: false - uses: ./.github/actions/setup - - name: Build project - run: make build - - name: Run unit tests run: make test diff --git a/Makefile b/Makefile index fdca0005..f738a3c0 100644 --- a/Makefile +++ b/Makefile @@ -622,7 +622,7 @@ run-queue-admin: ## Run queue-admin CLI (use ARGS to pass arguments, e.g. make r test: ## Run unit tests @echo "Running unit tests..." - @$(BAZEL) test //... --test_tag_filters=-manual,-integration || echo "No unit tests found (only integration tests exist)" + @$(BAZEL) test //... --test_tag_filters=-manual,-integration --build_tests_only test-no-cache: ## Run unit tests without cache (force re-run) @echo "Running unit tests (no cache)..." diff --git a/service/runway/server/main_test.go b/service/runway/server/main_test.go index ac297ba5..654dba91 100644 --- a/service/runway/server/main_test.go +++ b/service/runway/server/main_test.go @@ -123,6 +123,7 @@ func TestPrimaryConsumer_GitFailureDisposition(t *testing.T) { require.NoError(t, serviceConsumer.Start(context.Background())) message := entityqueue.NewMessage("git-test-message", []byte("payload"), "partition", nil) + message.Tenant = "git-test" delivery := queuemock.NewMockDelivery(ctrl) delivery.EXPECT().Message().Return(message).AnyTimes() delivery.EXPECT().Attempt().Return(1).AnyTimes() From 9e1ff14034364c60ed0f5d39236522abb27dfec7 Mon Sep 17 00:00:00 2001 From: Preetam Dwivedi Date: Thu, 10 Sep 2026 22:58:19 -0700 Subject: [PATCH 2/2] fix(ci): run make build in parallel with unit tests ## Summary ### Why? A sequential `make build` then `make test` made the unit-test job wait on a full compile that tests already cover. Dropping build entirely skipped the compile-only gate (`bazel build //...`). ### What? Split Build and Unit Test into two jobs that start together. Build still runs `make build`. Unit Test still runs `make test` with `--build_tests_only`. Required Checks waits on both. Each job keeps its own Bazel cache key (`github.job`). ## Test Plan CI on this PR: Build and Unit Test jobs run concurrently; Required Checks includes both. Co-authored-by: Cursor --- .github/workflows/ci.yml | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f9f7306c..d3777293 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -68,10 +68,25 @@ jobs: run: make check-gazelle # --------------------------------------------------------------------------- - # BUILD AND UNIT TESTS + # BUILD AND UNIT TESTS (parallel jobs, separate Bazel caches) # --------------------------------------------------------------------------- - build-and-unit-test: - name: Build and Unit Test + build: + name: Build + if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + with: + # This job executes untrusted PR code (make build/test/lint). Don't + # leave the GITHUB_TOKEN in the workspace git config while it runs. + persist-credentials: false + - uses: ./.github/actions/setup + + - name: Build project + run: make build + + unit-test: + name: Unit Test if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }} runs-on: ubuntu-latest steps: @@ -286,7 +301,8 @@ jobs: needs: - lint - tidy - - build-and-unit-test + - build + - unit-test - e2e - gateway-integration-test - orchestrator-integration-test