Skip to content

Commit de23eff

Browse files
committed
fix: create coverage directory before running tests in test-junit
The test-junit recipe was failing because the coverage directory didn't exist when tests tried to write coverage files. Now we create both test-results and coverage directories upfront. Also added coverage merging step to test-junit recipe to generate the final coverage.out file that CI expects.
1 parent 8c87e73 commit de23eff

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

Justfile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ test-junit: sync-changelog
110110
go install gotest.tools/gotestsum@latest
111111
fi
112112

113-
# Create test-results directory
114-
mkdir -p test-results
113+
# Create directories for test results and coverage
114+
mkdir -p test-results coverage
115115

116116
# Run tests with JUnit output for each module
117117
for dir in cmd/morphir pkg/models pkg/tooling pkg/sdk pkg/pipeline; do
@@ -128,9 +128,16 @@ test-junit: sync-changelog
128128
fi
129129
done
130130

131+
# Merge coverage profiles
132+
echo ""
133+
echo "Merging coverage profiles..."
134+
echo "mode: atomic" > coverage.out
135+
grep -h -v "^mode:" coverage/*.out >> coverage.out || true
136+
131137
echo ""
132138
echo "Test results generated in test-results/"
133139
echo "Coverage profiles generated in coverage/"
140+
echo "Merged coverage: coverage.out"
134141

135142
# Format all Go code
136143
fmt:

0 commit comments

Comments
 (0)