Skip to content

Commit

Permalink
Merge pull request #2467 from ActiveState/mitchell/dx-1695
Browse files Browse the repository at this point in the history
Update gotestfmt and use its new features for CI tests.
  • Loading branch information
mitchell-as authored Mar 31, 2023
2 parents 2f96def + 1da88a1 commit 767beb4
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 64 deletions.
Binary file removed .github/deps/Linux/bin/gotestfmt
Binary file not shown.
Binary file removed .github/deps/Windows/bin/gotestfmt.exe
Binary file not shown.
Binary file removed .github/deps/macOS/bin/gotestfmt
Binary file not shown.
24 changes: 9 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ jobs:
with:
go-version: ${{ matrix.go-version }}

# === Install gotestfmt ===
- name: Set up gotestfmt
uses: gotesttools/gotestfmt-action@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}

- # === Setup ===
name: Setup
shell: bash
Expand Down Expand Up @@ -109,7 +115,7 @@ jobs:
[
{
"ID": "Unit-Tests",
"Args": ["state", "run", "test"]
"Args": ["state", "run", "test", "-json", "2>&1"]
},
{
"ID": "Build-CLI",
Expand Down Expand Up @@ -145,19 +151,11 @@ jobs:
JIRA_USERNAME: ${{ secrets.JIRA_EMAIL }}
JIRA_TOKEN: ${{ secrets.JIRA_TOKEN }}

- # === Unit Tests (Raw) ===
name: Unit Tests (Raw Results)
shell: bash
run: |
set +e
parallelize results Unit-Tests
exit 0
- # === Unit Tests ===
name: Unit Tests
id: unit_tests
shell: bash
run: parallelize results Unit-Tests | gotestfmt
run: parallelize results Unit-Tests | gotestfmt -hide empty-packages
continue-on-error: ${{ github.event_name != 'schedule' }}

- # === "Build: CLI" ===
Expand Down Expand Up @@ -304,11 +302,7 @@ jobs:
if [[ "$TEST_SUITE_TAGS" == "all" ]]; then
TIMEOUT=60m
fi
set +e
SHELL='' go test -timeout $TIMEOUT -v `go list ./... | grep "integration"` &> build/integration-tests.out
CODE=$?
cat build/integration-tests.out | gotestfmt
exit $CODE
SHELL='' go test -timeout $TIMEOUT -v `go list ./... | grep "integration"` -json 2>&1 | gotestfmt -hide empty-packages
continue-on-error: ${{ github.event_name == 'schedule' }}
env:
ACTIVESTATE_VERBOSE: true
Expand Down
48 changes: 0 additions & 48 deletions .gotestfmt/package.gotpl

This file was deleted.

2 changes: 1 addition & 1 deletion activestate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ scripts:
language: bash
description: Runs unit tests (not integration tests)
value: |
ACTIVESTATE_PROJECT="" go test -v `go list ./... | grep -v api | grep -v integration | grep -v automation | grep -v expect | grep -v state-svc | grep -v state-offline`
ACTIVESTATE_PROJECT="" go test -v `go list ./... | grep -v api | grep -v integration | grep -v automation | grep -v expect | grep -v state-svc | grep -v state-offline` $@
standalone: true
- name: integration-tests
language: bash
Expand Down

0 comments on commit 767beb4

Please sign in to comment.