This is an automated email from the ASF dual-hosted git repository.

hgruszecki pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iggy.git


The following commit(s) were added to refs/heads/master by this push:
     new 3bcf7ff5e ci(go): merge BDD and e2e test coverage into Go SDK Codecov 
reports (#2859)
3bcf7ff5e is described below

commit 3bcf7ff5e23d693c8033f2a672901ea412298c52
Author: Atharva Lade <[email protected]>
AuthorDate: Mon Mar 9 13:41:52 2026 -0500

    ci(go): merge BDD and e2e test coverage into Go SDK Codecov reports (#2859)
    
    Co-authored-by: Hubert Gruszecki <[email protected]>
---
 .github/actions/go/pre-merge/action.yml | 25 +++++++++++++++++++++++--
 .github/workflows/_test.yml             |  4 ++--
 .github/workflows/post-merge.yml        | 24 ++++++++++++++++++++++--
 3 files changed, 47 insertions(+), 6 deletions(-)

diff --git a/.github/actions/go/pre-merge/action.yml 
b/.github/actions/go/pre-merge/action.yml
index 4219c2b0e..8a9ca155e 100644
--- a/.github/actions/go/pre-merge/action.yml
+++ b/.github/actions/go/pre-merge/action.yml
@@ -138,10 +138,31 @@ runs:
         # Ensure ginkgo is in PATH
         export PATH="${PATH}:$(go env GOPATH)/bin"
 
-        # Run foreign/go e2e tests
+        # Create reports directory
+        mkdir -p reports
+
+        # Run foreign/go e2e tests with coverage
         echo "Running foreign/go e2e tests..."
         cd foreign/go
-        go test -v -race ./...
+        go test -v -race \
+          -coverprofile=../../reports/go-coverage-e2e-sdk.out \
+          ./...
+
+        # Run BDD tests with coverage of foreign/go packages
+        # Only tcp_test suite (ginkgo); godog leader_redirection tests
+        # require a multi-node cluster not available in CI.
+        echo "Running BDD tests..."
+        cd ../../bdd/go
+        go test -v -race \
+          -coverpkg=github.com/apache/iggy/foreign/go/... \
+          -coverprofile=../../reports/go-coverage-e2e-bdd.out \
+          ./tests/tcp_test/...
+
+        # Merge e2e coverage profiles
+        cd ../..
+        head -1 reports/go-coverage-e2e-sdk.out > reports/go-coverage-e2e.out
+        tail -n +2 reports/go-coverage-e2e-sdk.out >> 
reports/go-coverage-e2e.out
+        tail -n +2 reports/go-coverage-e2e-bdd.out >> 
reports/go-coverage-e2e.out
 
     - name: Stop server after e2e tests
       if: always() && inputs.task == 'e2e'
diff --git a/.github/workflows/_test.yml b/.github/workflows/_test.yml
index e2b8d3487..4a713d3ca 100644
--- a/.github/workflows/_test.yml
+++ b/.github/workflows/_test.yml
@@ -122,11 +122,11 @@ jobs:
           task: ${{ inputs.task }}
 
       - name: Upload Go coverage to Codecov
-        if: inputs.component == 'sdk-go' && inputs.task == 'test'
+        if: inputs.component == 'sdk-go' && (inputs.task == 'test' || 
inputs.task == 'e2e')
         uses: codecov/codecov-action@v5
         with:
           token: ${{ secrets.CODECOV_TOKEN }}
-          files: reports/go-coverage.out
+          files: reports/${{ inputs.task == 'test' && 'go-coverage.out' || 
'go-coverage-e2e.out' }}
           disable_search: true
           flags: go
           fail_ci_if_error: false
diff --git a/.github/workflows/post-merge.yml b/.github/workflows/post-merge.yml
index 2fddfe13b..4c4f31da0 100644
--- a/.github/workflows/post-merge.yml
+++ b/.github/workflows/post-merge.yml
@@ -520,11 +520,31 @@ jobs:
         id: iggy
         uses: ./.github/actions/utils/server-start
 
-      - name: Run tests with coverage
+      - name: Run unit tests with coverage
         run: |
           cd foreign/go
           mkdir -p ../../reports
-          go test -v -race -coverprofile=../../reports/go-coverage.out ./...
+          go test -v -race -coverprofile=../../reports/go-coverage-unit.out 
./...
+
+      - name: Run BDD tests with coverage
+        run: |
+          cd bdd/go
+          mkdir -p ../../reports
+          # Run only tcp_test suite (ginkgo); godog leader_redirection
+          # tests require a multi-node cluster not available in CI.
+          go test -v -race \
+            -coverpkg=github.com/apache/iggy/foreign/go/... \
+            -coverprofile=../../reports/go-coverage-bdd.out \
+            ./tests/tcp_test/...
+
+      - name: Merge coverage profiles
+        run: |
+          mkdir -p reports
+          # Start with the mode line from the unit profile
+          head -1 reports/go-coverage-unit.out > reports/go-coverage.out
+          # Append data lines (skip mode line) from both profiles
+          tail -n +2 reports/go-coverage-unit.out >> reports/go-coverage.out
+          tail -n +2 reports/go-coverage-bdd.out >> reports/go-coverage.out
 
       - name: Stop Iggy server
         if: always()

Reply via email to