Skip to content

Commit

Permalink
test: Fix the tests running in CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
skyzyx committed Oct 27, 2023
1 parent 4546390 commit 2100e0c
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,33 @@ permissions:
contents: read

jobs:
mutation:
runs-on: ubuntu-latest
name: Mutation
steps:
- name: Harden Runner
uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0
with:
disable-sudo: true
egress-policy: block #audit
allowed-endpoints: >
github.com:443
- name: Checkout Source
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0

- name: Install Go
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: '>= 1.21'
cache: true

- name: Run mutation tests
run: |
cd ./corefunc && go test -tags=mutation -count=1 -parallel=$(nproc) -timeout 30s -ooze.v=true | grep -v "^[[:lower:]]" | grep -v "^)"
unit:
runs-on: ubuntu-latest
name: Unit
Expand Down
3 changes: 3 additions & 0 deletions corefunc/env_ensure_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ func ExampleEnvEnsure() {
fmt.Println(err)
// Output:
// <nil>
// <nil>
// <nil>
// environment variable MY_ENV_VAR_EMPTY is not defined
// environment variable MY_ENV_VAR_NOT_SET is not defined
}
Expand All @@ -75,6 +77,7 @@ func ExampleEnvEnsure_pattern() {

// Output:
// <nil>
// <nil>
// environment variable AWS_VAULT does not match pattern (non)?prod$
}

Expand Down

0 comments on commit 2100e0c

Please sign in to comment.