diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 570204aa..d3777293 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -68,10 +68,10 @@ 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: @@ -85,6 +85,18 @@ jobs: - 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: + - 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: Run unit tests run: make test @@ -289,7 +301,8 @@ jobs: needs: - lint - tidy - - build-and-unit-test + - build + - unit-test - e2e - gateway-integration-test - orchestrator-integration-test diff --git a/Makefile b/Makefile index 0e7f84ef..cae7104c 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()