Skip to content

Commit 2100e0c

Browse files
committed
test: Fix the tests running in CI.
1 parent 4546390 commit 2100e0c

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

.github/workflows/test.yml

+27
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,33 @@ permissions:
1616
contents: read
1717

1818
jobs:
19+
mutation:
20+
runs-on: ubuntu-latest
21+
name: Mutation
22+
steps:
23+
- name: Harden Runner
24+
uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0
25+
with:
26+
disable-sudo: true
27+
egress-policy: block #audit
28+
allowed-endpoints: >
29+
github.com:443
30+
31+
- name: Checkout Source
32+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
33+
with:
34+
fetch-depth: 0
35+
36+
- name: Install Go
37+
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
38+
with:
39+
go-version: '>= 1.21'
40+
cache: true
41+
42+
- name: Run mutation tests
43+
run: |
44+
cd ./corefunc && go test -tags=mutation -count=1 -parallel=$(nproc) -timeout 30s -ooze.v=true | grep -v "^[[:lower:]]" | grep -v "^)"
45+
1946
unit:
2047
runs-on: ubuntu-latest
2148
name: Unit

corefunc/env_ensure_test.go

+3
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ func ExampleEnvEnsure() {
4949
fmt.Println(err)
5050
// Output:
5151
// <nil>
52+
// <nil>
53+
// <nil>
5254
// environment variable MY_ENV_VAR_EMPTY is not defined
5355
// environment variable MY_ENV_VAR_NOT_SET is not defined
5456
}
@@ -75,6 +77,7 @@ func ExampleEnvEnsure_pattern() {
7577

7678
// Output:
7779
// <nil>
80+
// <nil>
7881
// environment variable AWS_VAULT does not match pattern (non)?prod$
7982
}
8083

0 commit comments

Comments
 (0)