Skip to content

Modern Docker Management, Designed for Everyone

chore: upload go tests to depot

Kyle Mendellece980513ca3
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index d36201ea7..05b7fe231 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -71,8 +71,15 @@ jobs:
- name: Run unit tests
env:
CGO_ENABLED: ${{ matrix.module.cgo_enabled }}
+ GO_JUNIT_REPORT_FILE: test-results/junit.xml
run: just test ${{ matrix.module.name }}
+ - name: Report Go test results to Depot
+ if: ${{ !cancelled() }}
+ uses: depot/test-report-action@v1
+ with:
+ path: ${{ matrix.module.path }}/test-results/
+
- name: Upload coverage artifact
if: always()
uses: actions/upload-artifact@v7
diff --git a/.gitignore b/.gitignore
index 81cb41c91..9e27a97d4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -41,6 +41,9 @@ tests/test-results/*
tests/.report/*
tests/.auth/
tests/.bin/
+backend/test-results/
+cli/test-results/
+types/test-results/
backend/.bin
backend/build-errors.log
frontend/bun.lock
diff --git a/Justfile b/Justfile
index 993447d78..23eeb6a56 100644
--- a/Justfile
+++ b/Justfile
@@ -221,17 +221,44 @@ _test-e2e:
# Run backend Go tests
[group('test')]
_test-backend:
- cd backend && go test -tags=exclude_frontend,buildables -ldflags "-X github.com/getarcaneapp/arcane/backend/buildables.EnabledFeatures=autologin" ./... -race -coverprofile=coverage.txt -covermode=atomic -v
+ #!/usr/bin/env bash
+ set -euo pipefail
+
+ cd backend
+ if [ -n "${GO_JUNIT_REPORT_FILE:-}" ]; then
+ mkdir -p "$(dirname "$GO_JUNIT_REPORT_FILE")"
+ go test -json -tags=exclude_frontend,buildables -ldflags "-X github.com/getarcaneapp/arcane/backend/buildables.EnabledFeatures=autologin" ./... -race -coverprofile=coverage.txt -covermode=atomic -v 2>&1 | go run github.com/jstemmer/go-junit-report/[email protected] -parser gojson -set-exit-code -out "$GO_JUNIT_REPORT_FILE"
+ else
+ go test -tags=exclude_frontend,buildables -ldflags "-X github.com/getarcaneapp/arcane/backend/buildables.EnabledFeatures=autologin" ./... -race -coverprofile=coverage.txt -covermode=atomic -v
+ fi
# Run CLI tests
[group('test')]
_test-cli:
- cd cli && go test ./... -race -coverprofile=coverage.txt -covermode=atomic -v
+ #!/usr/bin/env bash
+ set -euo pipefail
+
+ cd cli
+ if [ -n "${GO_JUNIT_REPORT_FILE:-}" ]; then
+ mkdir -p "$(dirname "$GO_JUNIT_REPORT_FILE")"
+ go test -json ./... -race -coverprofile=coverage.txt -covermode=atomic -v 2>&1 | go run github.com/jstemmer/go-junit-report/[email protected] -parser gojson -set-exit-code -out "$GO_JUNIT_REPORT_FILE"
+ else
+ go test ./... -race -coverprofile=coverage.txt -covermode=atomic -v
+ fi
# Run shared types Go tests
[group('test')]
_test-types:
- cd types && go test ./... -race -coverprofile=coverage.txt -covermode=atomic -v
+ #!/usr/bin/env bash
+ set -euo pipefail
+
+ cd types
+ if [ -n "${GO_JUNIT_REPORT_FILE:-}" ]; then
+ mkdir -p "$(dirname "$GO_JUNIT_REPORT_FILE")"
+ go test -json ./... -race -coverprofile=coverage.txt -covermode=atomic -v 2>&1 | go run github.com/jstemmer/go-junit-report/[email protected] -parser gojson -set-exit-code -out "$GO_JUNIT_REPORT_FILE"
+ else
+ go test ./... -race -coverprofile=coverage.txt -covermode=atomic -v
+ fi
[group('test')]
_test-all: