Skip to content

Commit 3e8c0b8

Browse files
committed
Fixup coverage failure
1 parent ecf9cd6 commit 3e8c0b8

File tree

3 files changed

+248
-23
lines changed

3 files changed

+248
-23
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
# Copyright 2021, 2024 Oracle Corporation and/or its affiliates.
2+
# Licensed under the Universal Permissive License v 1.0 as shown at
3+
# https://oss.oracle.com/licenses/upl.
4+
5+
# ---------------------------------------------------------------------------
6+
# Coherence Go Client GitHub Actions CI build Against v22.06+ against v1.2.2
7+
# ---------------------------------------------------------------------------
8+
name: CI Compatability v22.06 - v1.2.2
9+
10+
on:
11+
workflow_dispatch:
12+
push:
13+
branches:
14+
- '*'
15+
schedule:
16+
# Every day at midnight
17+
- cron: '0 0 * * *'
18+
19+
jobs:
20+
build:
21+
runs-on: ubuntu-22.04
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
coherenceVersion:
26+
- 22.06.10
27+
- 22.06.11-SNAPSHOT
28+
go-version:
29+
- 1.19.x
30+
- 1.20.x
31+
- 1.21.x
32+
- 1.22.x
33+
- 1.23.x
34+
35+
# Checkout the source, we need a depth of zero to fetch all of the history otherwise
36+
# the copyright check cannot work out the date of the files from Git.
37+
steps:
38+
- uses: actions/checkout@v4
39+
with:
40+
fetch-depth: 0
41+
42+
- name: Get Docker Images
43+
shell: bash
44+
run: |
45+
docker pull gcr.io/distroless/java17
46+
47+
- name: Set up JDK 11 for Build
48+
uses: actions/setup-java@v4
49+
with:
50+
java-version: '11'
51+
distribution: 'zulu'
52+
53+
- name: Cache Go Modules
54+
uses: actions/cache@v4
55+
with:
56+
path: ~/go/pkg/mod
57+
key: ${{ runner.os }}-go-mods-${{ hashFiles('**/go.sum') }}
58+
restore-keys: |
59+
${{ runner.os }}-go-mods-
60+
61+
- name: Cache Maven packages
62+
uses: actions/cache@v4
63+
with:
64+
path: ~/.m2
65+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
66+
restore-keys: ${{ runner.os }}-m2
67+
68+
- name: Set up Go
69+
uses: actions/setup-go@v5
70+
with:
71+
go-version: '${{ matrix.go-version }}'
72+
73+
- name: E2E Local Tests
74+
env:
75+
COH_VERSION: ${{ matrix.coherenceVersion }}
76+
shell: bash
77+
run: |
78+
get checkout v1.2.2
79+
echo "Running verify against $COH_VERSION"
80+
go get google.golang.org/grpc/cmd/[email protected]
81+
COHERENCE_BASE_IMAGE=gcr.io/distroless/java17 INCLUDE_LONG_RUNNING=true COHERENCE_VERSION=$COH_VERSION PROFILES=,-jakarta,javax make clean generate-proto build-test-images test-e2e-standalone
82+
83+
- name: E2E Local Tests With Scope
84+
env:
85+
COH_VERSION: ${{ matrix.coherenceVersion }}
86+
shell: bash
87+
run: |
88+
go get google.golang.org/grpc/cmd/[email protected]
89+
COHERENCE_BASE_IMAGE=gcr.io/distroless/java17 COHERENCE_VERSION=$COH_VERSION PROFILES=,-jakarta,javax,scope make clean generate-proto build-test-images test-e2e-standalone-scope
90+
91+
- uses: actions/upload-artifact@v4
92+
if: failure()
93+
with:
94+
name: test-output-${{ matrix.go-version }}-${{ matrix.coherenceVersion }}
95+
path: build/_output/test-logs
96+
97+
- uses: actions/upload-artifact@v4
98+
if: failure()
99+
with:
100+
name: test-output-${{ matrix.go-version }}-${{ matrix.coherenceVersion }}
101+
path: build/_output/test-logs
102+
103+
- name: E2E Local Tests SSL
104+
env:
105+
COH_VERSION: ${{ matrix.coherenceVersion }}
106+
shell: bash
107+
run: |
108+
echo "Running verify against $COH_VERSION"
109+
go get google.golang.org/grpc/cmd/[email protected]
110+
COHERENCE_BASE_IMAGE=gcr.io/distroless/java17 SECURE=true COHERENCE_IGNORE_INVALID_CERTS=true INCLUDE_LONG_RUNNING=true \
111+
COHERENCE_TLS_CERTS_PATH=`pwd`/test/utils/certs/guardians-ca.crt \
112+
COHERENCE_TLS_CLIENT_CERT=`pwd`/test/utils/certs/star-lord.crt \
113+
COHERENCE_TLS_CLIENT_KEY=`pwd`/test/utils/certs/star-lord.key \
114+
COHERENCE_VERSION=$COH_VERSION PROFILES=,secure,-jakarta,javax make clean certs generate-proto build-test-images test-e2e-standalone
115+
116+
- uses: actions/upload-artifact@v4
117+
if: failure()
118+
with:
119+
name: test-output-${{ matrix.go-version }}-${{ matrix.coherenceVersion }}
120+
path: build/_output/test-logs
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
# Copyright 2022, 2024 Oracle Corporation and/or its affiliates.
2+
# Licensed under the Universal Permissive License v 1.0 as shown at
3+
# https://oss.oracle.com/licenses/upl.
4+
5+
# ---------------------------------------------------------------------------
6+
# Coherence Go Client GitHub Actions CI build Against v23.03+ for v1.2.2
7+
# ---------------------------------------------------------------------------
8+
name: CI Compatability Jakarta - v1.2.2.
9+
10+
on:
11+
workflow_dispatch:
12+
push:
13+
branches:
14+
- '*'
15+
schedule:
16+
# Every day at midnight
17+
- cron: '0 0 * * *'
18+
19+
jobs:
20+
build:
21+
runs-on: ubuntu-22.04
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
coherenceVersion:
26+
- 24.09
27+
go-version:
28+
- 1.19.x
29+
- 1.20.x
30+
- 1.21.x
31+
- 1.22.x
32+
- 1.23.x
33+
34+
# Checkout the source, we need a depth of zero to fetch all of the history otherwise
35+
# the copyright check cannot work out the date of the files from Git.
36+
steps:
37+
- uses: actions/checkout@v4
38+
with:
39+
fetch-depth: 0
40+
41+
- name: Get Docker Images
42+
shell: bash
43+
run: |
44+
docker pull gcr.io/distroless/java17
45+
46+
- name: Set up JDK 17 for Build
47+
uses: actions/setup-java@v4
48+
with:
49+
java-version: '17'
50+
distribution: 'zulu'
51+
52+
- name: Cache Go Modules
53+
uses: actions/cache@v4
54+
with:
55+
path: ~/go/pkg/mod
56+
key: ${{ runner.os }}-go-mods-${{ hashFiles('**/go.sum') }}
57+
restore-keys: |
58+
${{ runner.os }}-go-mods-
59+
60+
- name: Cache Maven packages
61+
uses: actions/cache@v4
62+
with:
63+
path: ~/.m2
64+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
65+
restore-keys: ${{ runner.os }}-m2
66+
67+
- name: Set up Go
68+
uses: actions/setup-go@v5
69+
with:
70+
go-version: '${{ matrix.go-version }}'
71+
72+
- name: E2E Local Tests
73+
env:
74+
COH_VERSION: ${{ matrix.coherenceVersion }}
75+
shell: bash
76+
run: |
77+
git checkout v1.2.2
78+
go get google.golang.org/grpc/cmd/[email protected]
79+
COHERENCE_BASE_IMAGE=gcr.io/distroless/java17 INCLUDE_LONG_RUNNING=true PROFILES=,jakarta,-javax COHERENCE_VERSION=$COH_VERSION make clean generate-proto build-test-images test-e2e-standalone
80+
81+
- uses: actions/upload-artifact@v4
82+
if: failure()
83+
with:
84+
name: test-output-${{ matrix.go-version }}-${{ matrix.coherenceVersion }}
85+
path: build/_output/test-logs
86+
87+
- name: E2E Local Tests With Scope
88+
env:
89+
COH_VERSION: ${{ matrix.coherenceVersion }}
90+
shell: bash
91+
run: |
92+
go get google.golang.org/grpc/cmd/[email protected]
93+
COHERENCE_BASE_IMAGE=gcr.io/distroless/java17 COHERENCE_VERSION=$COH_VERSION PROFILES=,jakarta,-javax,scope make clean generate-proto build-test-images test-e2e-standalone-scope
94+
95+
- uses: actions/upload-artifact@v4
96+
if: failure()
97+
with:
98+
name: test-output-${{ matrix.go-version }}-${{ matrix.coherenceVersion }}
99+
path: build/_output/test-logs
100+
101+
- name: E2E Local Tests SSL
102+
env:
103+
COH_VERSION: ${{ matrix.coherenceVersion }}
104+
shell: bash
105+
run: |
106+
echo "Running verify against $COH_VERSION"
107+
go get google.golang.org/grpc/cmd/[email protected]
108+
COHERENCE_BASE_IMAGE=gcr.io/distroless/java17 SECURE=true COHERENCE_IGNORE_INVALID_CERTS=true INCLUDE_LONG_RUNNING=true \
109+
COHERENCE_TLS_CERTS_PATH=`pwd`/test/utils/certs/guardians-ca.crt \
110+
COHERENCE_TLS_CLIENT_CERT=`pwd`/test/utils/certs/star-lord.crt \
111+
COHERENCE_TLS_CLIENT_KEY=`pwd`/test/utils/certs/star-lord.key \
112+
COHERENCE_VERSION=$COH_VERSION PROFILES=,secure,jakarta,-javax make clean certs generate-proto build-test-images test-e2e-standalone
113+
114+
- uses: actions/upload-artifact@v4
115+
if: failure()
116+
with:
117+
name: test-output-${{ matrix.go-version }}-${{ matrix.coherenceVersion }}
118+
path: build/_output/test-logs

Makefile

+10-23
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ trivy-scan: gettrivy ## Scan the CLI using trivy
271271
test: test-clean gotestsum $(BUILD_PROPS) ## Run the unit tests
272272
CGO_ENABLED=0 $(GOTESTSUM) --format testname --junitfile $(TEST_LOGS_DIR)/coherence-test.xml \
273273
-- $(GO_TEST_FLAGS) -v -coverprofile=$(COVERAGE_DIR)/cover-unit.out ./coherence/...
274-
go tool cover -html=$(COVERAGE_DIR)/cover-unit.out -o $(COVERAGE_DIR)/cover-unit.html
274+
go tool cover -func=$(COVERAGE_DIR)/cover-unit.out | grep -v '0.0%'
275275

276276

277277
# ----------------------------------------------------------------------------------------------------------------------
@@ -280,48 +280,35 @@ test: test-clean gotestsum $(BUILD_PROPS) ## Run the unit tests
280280
.PHONY: test-e2e-standalone
281281
test-e2e-standalone: test-clean test gotestsum $(BUILD_PROPS) ## Run e2e tests with Coherence
282282
CGO_ENABLED=0 $(GOTESTSUM) --format testname --junitfile $(TEST_LOGS_DIR)/go-client-test.xml \
283-
-- $(GO_TEST_FLAGS) -v -coverprofile=$(COVERAGE_DIR)/cover-functional.out -v ./test/e2e/standalone/... -coverpkg=./coherence/...
284-
go tool cover -html=$(COVERAGE_DIR)/cover-functional.out -o $(COVERAGE_DIR)/cover-functional.html
285-
@echo
286-
@echo "**** CODE COVERAGE ****"
287-
@cat $(COVERAGE_DIR)/cover-functional.html | grep 'github.com/oracle/coherence-go-client/coherence' | grep option | sed 's/^.*github/github/' | sed 's,</option.*,,'
283+
-- $(GO_TEST_FLAGS) -v -coverprofile=$(COVERAGE_DIR)/cover-functional.out -v ./test/e2e/standalone/... -coverpkg=github.com/oracle/coherence-go-client/v2/coherence/...
284+
go tool cover -func=$(COVERAGE_DIR)/cover-functional.out | grep -v '0.0%'
288285

289286
# ----------------------------------------------------------------------------------------------------------------------
290287
# Executes the Go end to end tests for standalone Coherence with Scope set
291288
# ----------------------------------------------------------------------------------------------------------------------
292289
.PHONY: test-e2e-standalone-scope
293290
test-e2e-standalone-scope: test-clean test gotestsum $(BUILD_PROPS) ## Run e2e tests with Coherence with Scope set
294291
CGO_ENABLED=0 $(GOTESTSUM) --format testname --junitfile $(TEST_LOGS_DIR)/go-client-test-scope.xml \
295-
-- $(GO_TEST_FLAGS) -v -coverprofile=$(COVERAGE_DIR)/cover-functional-scope.out -v ./test/e2e/scope/... -coverpkg=./coherence/...
296-
go tool cover -html=$(COVERAGE_DIR)/cover-functional-scope.out -o $(COVERAGE_DIR)/cover-functional-scope.html
297-
@echo
298-
@echo "**** CODE COVERAGE ****"
299-
@cat $(COVERAGE_DIR)/cover-functional-scope.html | grep 'github.com/oracle/coherence-go-client/coherence' | grep option | sed 's/^.*github/github/' | sed 's,</option.*,,'
292+
-- $(GO_TEST_FLAGS) -v -coverprofile=$(COVERAGE_DIR)/cover-functional-scope.out -v ./test/e2e/scope/... -coverpkg=github.com/oracle/coherence-go-client/v2/coherence/...
293+
go tool cover -func=$(COVERAGE_DIR)/cover-functional-scope.out | grep -v '0.0%'
300294

301295
# ----------------------------------------------------------------------------------------------------------------------
302296
# Executes the Go end to end tests for standalone Coherence with Queues
303297
# ----------------------------------------------------------------------------------------------------------------------
304298
.PHONY: test-e2e-standalone-queues
305299
test-e2e-standalone-queues: test-clean test gotestsum $(BUILD_PROPS) ## Run e2e tests with Coherence queues
306300
CGO_ENABLED=0 $(GOTESTSUM) --format testname --junitfile $(TEST_LOGS_DIR)/go-client-test-queues.xml \
307-
-- $(GO_TEST_FLAGS) -v -coverprofile=$(COVERAGE_DIR)/cover-functional-queues.out -v ./test/e2e/queues/... -coverpkg=./coherence/...
308-
go tool cover -html=$(COVERAGE_DIR)/cover-functional-queues.out -o $(COVERAGE_DIR)/cover-functional-queues.html
309-
@echo
310-
@echo "**** CODE COVERAGE ****"
311-
@cat $(COVERAGE_DIR)/cover-functional-queues.html | grep 'github.com/oracle/coherence-go-client/coherence' | grep option | sed 's/^.*github/github/' | sed 's,</option.*,,'
301+
-- $(GO_TEST_FLAGS) -v -coverprofile=$(COVERAGE_DIR)/cover-functional-queues.out -v ./test/e2e/queues/... -coverpkg=github.com/oracle/coherence-go-client/v2/coherence/...
302+
go tool cover -func=$(COVERAGE_DIR)/cover-functional-queues.out | grep -v '0.0%'
312303

313304
# ----------------------------------------------------------------------------------------------------------------------
314305
# Executes the Go end to end tests for gRPC v1 tests
315306
# ----------------------------------------------------------------------------------------------------------------------
316307
.PHONY: test-v1-base
317308
test-v1-base: test-clean test gotestsum $(BUILD_PROPS) ## Run e2e tests with Coherence
318309
CGO_ENABLED=0 $(GOTESTSUM) --format testname --junitfile $(TEST_LOGS_DIR)/go-client-test-v1.xml \
319-
-- $(GO_TEST_FLAGS) -v -coverprofile=$(COVERAGE_DIR)/cover-functional-v1.out -v ./test/v1/base/... -coverpkg=./coherence/...
320-
go tool cover -html=$(COVERAGE_DIR)/cover-functional-v1.out -o $(COVERAGE_DIR)/cover-functional-v1.html
321-
@echo
322-
@echo "**** CODE COVERAGE ****"
323-
@cat $(COVERAGE_DIR)/cover-functional-v1.html | grep 'github.com/oracle/coherence-go-client/coherence' | grep option | sed 's/^.*github/github/' | sed 's,</option.*,,'
324-
310+
-- $(GO_TEST_FLAGS) -v -coverprofile=$(COVERAGE_DIR)/cover-functional-v1.out -v ./test/v1/base/... -coverpkg=github.com/oracle/coherence-go-client/v2/coherence/...
311+
go tool cover -func=$(COVERAGE_DIR)/cover-functional-v1.out | grep -v '0.0%'
325312

326313
# ----------------------------------------------------------------------------------------------------------------------
327314
# Executes the test of the examples
@@ -369,7 +356,7 @@ test-coherence-shutdown: ## shutdown standalone cluster
369356
.PHONY: gotestsum
370357
GOTESTSUM = $(TOOLS_BIN)/gotestsum
371358
gotestsum: ## Download gotestsum locally if necessary.
372-
GOBIN=`pwd`/build/tools/bin go install gotest.tools/gotestsum@v1.8.1
359+
GOBIN=`pwd`/build/tools/bin go install gotest.tools/gotestsum@v1.12.0
373360

374361
# ----------------------------------------------------------------------------------------------------------------------
375362
# Cleans the test cache

0 commit comments

Comments
 (0)