Skip to content

Commit caf353e

Browse files
author
adanje
committed
Test pipeline
1 parent e660625 commit caf353e

File tree

3 files changed

+26
-20
lines changed

3 files changed

+26
-20
lines changed

.github/workflows/build.yml

+11-8
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,17 @@ jobs:
5353
run: |
5454
mkdir -p coverage
5555
npm run test:coverage
56-
ls -la coverage/
56+
echo "Test coverage complete, checking files:"
57+
ls -la
58+
echo "Coverage directory contents:"
59+
ls -la coverage/ || echo "Coverage directory empty or not found"
5760
5861
- name: Debug coverage directory
5962
run: |
60-
echo "Listing coverage directory:"
61-
ls -la coverage/ || echo "Coverage directory not found"
62-
echo "Current directory:"
63-
pwd
64-
echo "Directory structure:"
65-
find . -name "lcov.info"
63+
echo "Full directory structure:"
64+
find . -type f -name "*.info" 2>/dev/null || echo "No .info files found"
65+
echo "Coverage directory location:"
66+
find . -type d -name "coverage" 2>/dev/null || echo "No coverage directories found"
6667
6768
- name: Setup Code Climate
6869
run: |
@@ -74,12 +75,14 @@ jobs:
7475
env:
7576
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
7677
run: |
77-
COVERAGE_FILE=$(find . -name "lcov.info" -not -path "./node_modules/*" | head -n 1)
78+
COVERAGE_FILE=$(find . -type f -name "lcov.info" -not -path "./node_modules/*" 2>/dev/null || echo "")
7879
if [ -n "$COVERAGE_FILE" ]; then
7980
echo "Found coverage file at: $COVERAGE_FILE"
8081
./cc-test-reporter format-coverage "$COVERAGE_FILE" --input-type lcov
8182
./cc-test-reporter upload-coverage
8283
else
8384
echo "Error: lcov.info not found in project directory (excluding node_modules)"
85+
echo "Current directory structure:"
86+
ls -R
8487
exit 1
8588
fi

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@
139139
"start": "PORT=4202 react-scripts start",
140140
"build": "react-scripts build",
141141
"test": "vitest",
142-
"test:coverage": "vitest run --coverage",
143-
"test:ci": "vitest run --coverage",
142+
"test:coverage": "vitest run --coverage=true",
143+
"test:ci": "vitest run --coverage=true",
144144
"eject": "react-scripts eject"
145145
},
146146
"bugs": {

vitest.config.js

+13-10
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,20 @@ export default defineConfig({
88
setupFiles: './fasp-core-ui/setupTests.js',
99
testTimeout: 10000,
1010
include: ['**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
11+
coverage: {
12+
provider: 'v8',
13+
reporter: ['text', 'lcov', 'json'],
14+
reportsDirectory: './coverage',
15+
enabled: true,
16+
clean: true,
17+
thresholds: {
18+
statements: 80,
19+
branches: 80,
20+
functions: 80,
21+
lines: 80,
22+
}
23+
}
1124
},
12-
coverage: {
13-
provider: 'v8',
14-
reporter: ['text', 'lcov', 'json'],
15-
reportsDirectory: './coverage',
16-
thresholds: {
17-
statements: 80,
18-
branches: 80,
19-
functions: 80,
20-
lines: 80,
21-
}},
2225
resolve: {
2326
alias: {
2427
'@': '/src',

0 commit comments

Comments
 (0)