Skip to content

Commit

Permalink
updated gotestsum to output testnames
Browse files Browse the repository at this point in the history
  • Loading branch information
wilkermichael committed Feb 15, 2023
1 parent 7d9fd85 commit d362d3f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
16 changes: 8 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ commands:
echo $pkgs
for pkg in $pkgs
do
if ! gotestsum --no-summary=all --jsonfile=jsonfile-${pkg////-} -- $pkg -p 1 -timeout 2h -failfast \
if ! gotestsum --format=testname --no-summary=all --jsonfile=jsonfile-${pkg////-} -- $pkg -p 1 -timeout 2h -failfast \
<< parameters.additional-flags >> \
-enable-multi-cluster \
${ENABLE_ENTERPRISE:+-enable-enterprise} \
Expand All @@ -181,7 +181,7 @@ commands:
break
fi
done
gotestsum --raw-command --junitfile "$TEST_RESULTS/gotestsum-report.xml" -- cat jsonfile*
gotestsum --format=testname --raw-command --junitfile "$TEST_RESULTS/gotestsum-report.xml" -- cat jsonfile*
exit $exit_code
- unless:
Expand All @@ -200,7 +200,7 @@ commands:
pkgs=$(go list ./... | circleci tests split --split-by=timings --timings-type=classname)
echo "Running $pkgs"
gotestsum --junitfile "$TEST_RESULTS/gotestsum-report.xml" -- $pkgs -p 1 -timeout 2h -failfast \
gotestsum --format testname --junitfile "$TEST_RESULTS/gotestsum-report.xml" -- $pkgs -p 1 -timeout 2h -failfast \
<< parameters.additional-flags >> \
${ENABLE_ENTERPRISE:+-enable-enterprise} \
-enable-multi-cluster \
Expand Down Expand Up @@ -281,7 +281,7 @@ jobs:
unzip consul_"${CONSUL_VERSION}"_linux_amd64.zip -d /home/circleci/bin &&
rm consul_"${CONSUL_VERSION}"_linux_amd64.zip
PACKAGE_NAMES=$(go list ./...)
gotestsum --junitfile $TEST_RESULTS/gotestsum-report.xml -- -p 4 $PACKAGE_NAMES
gotestsum --format testname --junitfile $TEST_RESULTS/gotestsum-report.xml -- -p 4 $PACKAGE_NAMES
- store_test_results:
path: /tmp/test-results
Expand Down Expand Up @@ -312,7 +312,7 @@ jobs:
unzip consul_"${CONSUL_ENT_VERSION}"_linux_amd64.zip -d /home/circleci/bin &&
rm consul_"${CONSUL_ENT_VERSION}"_linux_amd64.zip
PACKAGE_NAMES=$(go list ./...)
gotestsum --junitfile $TEST_RESULTS/gotestsum-report.xml -- -tags=enterprise -p 4 $PACKAGE_NAMES
gotestsum --format testname --junitfile $TEST_RESULTS/gotestsum-report.xml -- -tags=enterprise -p 4 $PACKAGE_NAMES
- store_test_results:
path: /tmp/test-results
Expand Down Expand Up @@ -401,7 +401,7 @@ jobs:
name: Run tests
working_directory: *cli-path
command: |
gotestsum --junitfile $TEST_RESULTS/gotestsum-report.xml ./... -- -p 4
gotestsum --format testname --junitfile $TEST_RESULTS/gotestsum-report.xml ./... -- -p 4
- store_test_results:
path: /tmp/test-results
Expand Down Expand Up @@ -500,7 +500,7 @@ jobs:
name: Run tests
working_directory: *acceptance-framework-path
command: |
gotestsum --junitfile $TEST_RESULTS/gotestsum-report.xml ./... -- -p 4
gotestsum --format testname --junitfile $TEST_RESULTS/gotestsum-report.xml ./... -- -p 4
- store_test_results:
path: /tmp/test-results
Expand All @@ -523,7 +523,7 @@ jobs:
name: Run tests
working_directory: *helm-gen-path
command: |
gotestsum --junitfile $TEST_RESULTS/gotestsum-report.xml ./... -- -p 4
gotestsum --format testname --junitfile $TEST_RESULTS/gotestsum-report.xml ./... -- -p 4
- store_test_results:
path: /tmp/test-results
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/reusable-acceptance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ jobs:
do
fullpkg="github.com/hashicorp/consul-k8s/${{ inputs.directory }}/${pkg}"
echo "Testing package: ${fullpkg}"
if ! gotestsum --jsonfile=jsonfile-${pkg////-} -- ${fullpkg} -p 1 -timeout 2h -failfast \
if ! gotestsum --format=testname --jsonfile=jsonfile-${pkg////-} -- ${fullpkg} -p 1 -timeout 2h -failfast \
${{ inputs.additional-flags }} \
-enable-enterprise \
-enable-multi-cluster \
Expand All @@ -139,7 +139,7 @@ jobs:
break
fi
done
gotestsum --raw-command --junitfile "${{ env.TEST_RESULTS }}/gotestsum-report.xml" -- cat jsonfile*
gotestsum --format=testname --raw-command --junitfile "${{ env.TEST_RESULTS }}/gotestsum-report.xml" -- cat jsonfile*
exit $exit_code
- name: Upload tests
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable-unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@ jobs:
- name: Run tests
working-directory: ${{inputs.directory}}
run: |
gotestsum --junitfile ${{env.TEST_RESULTS}}/gotestsum-report.xml ./... -- -p 4
gotestsum --format=testname --junitfile ${{env.TEST_RESULTS}}/gotestsum-report.xml ./... -- -p 4
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ jobs:
working-directory: control-plane
run: |
PACKAGE_NAMES=$(go list ./...)
gotestsum --junitfile ${{env.TEST_RESULTS}}/gotestsum-report.xml -- -p 4 $PACKAGE_NAMES
gotestsum --format=testname --junitfile ${{env.TEST_RESULTS}}/gotestsum-report.xml -- -p 4 $PACKAGE_NAMES
test-enterprise-control-plane:
if: github.repository_owner == 'hashicorp' # Do not run on forks as this requires secrets
Expand Down Expand Up @@ -228,7 +228,7 @@ jobs:
working-directory: control-plane
run: |
PACKAGE_NAMES=$(go list ./...)
gotestsum --junitfile ${{env.TEST_RESULTS}}/gotestsum-report.xml -- -tags=enterprise -p 4 $PACKAGE_NAMES
gotestsum --format=testname --junitfile ${{env.TEST_RESULTS}}/gotestsum-report.xml -- -tags=enterprise -p 4 $PACKAGE_NAMES
build-distros:
needs: [get-go-version, get-product-version]
Expand Down

0 comments on commit d362d3f

Please sign in to comment.