Skip to content

Commit b3c42e5

Browse files
author
Kristiyan Ivanov
authored
Ri 0000 fixing coverage paths (#4690)
* RI-0000-fixing test coverage path mismatch * RI-0000-fixing test coverage path mismatch * RI-0000-fixing test coverage path mismatch * RI-0000-fixing test coverage path mismatch * RI-0000-fixing test coverage path mismatch * RI-0000-fixing test coverage path mismatch * RI-0000-fixing test coverage path mismatch * RI-0000-fixing test coverage path mismatch * RI-0000-fixing test coverage path mismatch * RI-0000-fixing test coverage path mismatch * RI-0000-fixing test coverage path mismatch * RI-0000-fixing test coverage path mismatch * RI-0000-fixing test coverage path mismatch
1 parent a95fbb9 commit b3c42e5

File tree

1 file changed

+60
-18
lines changed

1 file changed

+60
-18
lines changed

.github/workflows/tests-integration.yml

Lines changed: 60 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -156,34 +156,76 @@ jobs:
156156
ls -lh ./redisinsight/api/test/test-runs/coverage/test-run-result.xml
157157
else
158158
echo "❌ JUnit XML file missing!"
159+
fi
159160
160-
- name: Debug - Show directory structure and environment files
161+
- name: Debug NYC coverage generation
162+
if: always()
161163
run: |
162-
echo "=== DEBUGGING COVERAGE ISSUE ==="
163-
echo "Current working directory: $(pwd)"
164+
echo "=== Debugging missing test-run-coverage.json file ==="
165+
echo "Working directory: $(pwd)"
164166
echo ""
165-
echo "=== Environment files content ==="
166-
echo "local.build.env:"
167-
cat ./redisinsight/api/test/test-runs/local.build.env
167+
echo "=== Check .nyc_output directory in API folder ==="
168+
cd ./redisinsight/api
169+
if [ -d ".nyc_output" ]; then
170+
echo "✅ .nyc_output directory exists"
171+
echo "Contents:"
172+
ls -la .nyc_output
173+
echo "File count: $(find .nyc_output -name "*.json" | wc -l)"
174+
echo "Sample file content (first 5 lines):"
175+
find .nyc_output -name "*.json" | head -1 | xargs head -5 2>/dev/null || echo "No JSON files to sample"
176+
else
177+
echo "❌ .nyc_output directory does not exist!"
178+
fi
168179
echo ""
169-
echo "docker.build.env:"
170-
cat ./redisinsight/api/test/test-runs/docker.build.env
180+
echo "=== Try manual NYC merge ==="
181+
if [ -d ".nyc_output" ] && [ "$(find .nyc_output -name "*.json" | wc -l)" -gt 0 ]; then
182+
echo "Attempting manual NYC merge..."
183+
echo "Command: nyc merge .nyc_output coverage/test-run-coverage.json"
184+
nyc merge .nyc_output coverage/test-run-coverage.json || echo "NYC merge failed with exit code $?"
185+
echo "Checking result:"
186+
ls -la coverage/test-run-coverage.json 2>/dev/null || echo "File not created"
187+
else
188+
echo "Skipping merge - no coverage data files found"
189+
fi
171190
echo ""
172-
echo "=== Directory structure under redisinsight/api ==="
173-
find ./redisinsight/api -type d -name "*coverage*" -o -name "*test-runs*" | head -10
191+
echo "=== Final coverage directory check ==="
192+
ls -la coverage/ | head -10
193+
194+
- name: Copy test results to artifacts
195+
run: |
196+
echo "=== COPYING TEST RESULTS ==="
197+
echo "Current working directory: $(pwd)"
174198
echo ""
175199
echo "=== Files in expected coverage directory ==="
176200
ls -la ./redisinsight/api/test/test-runs/coverage/ || echo "Coverage directory does not exist!"
177201
echo ""
178-
echo "=== All files under test-runs ==="
179-
find ./redisinsight/api/test/test-runs -name "*.json" -o -name "*.xml" | head -20
180-
echo ""
181-
echo "=== Looking for test result files anywhere ==="
182-
find ./redisinsight/api -name "test-run-result.*" -o -name "*coverage*.json" | head -10
183202
184-
cp ./redisinsight/api/test/test-runs/coverage/test-run-result.json ./itest/results/${{ matrix.rte }}.result.json
185-
cp ./redisinsight/api/test/test-runs/coverage/test-run-result.xml ./itest/results/${{ matrix.rte }}.result.xml
186-
cp ./redisinsight/api/test/test-runs/coverage/test-run-coverage.json ./itest/coverages/${{ matrix.rte }}.coverage.json
203+
echo "=== Copying files with error handling ==="
204+
205+
# Copy JSON result file (should exist)
206+
if [ -f "./redisinsight/api/test/test-runs/coverage/test-run-result.json" ]; then
207+
cp ./redisinsight/api/test/test-runs/coverage/test-run-result.json ./itest/results/${{ matrix.rte }}.result.json
208+
echo "✅ Copied test-run-result.json"
209+
else
210+
echo "❌ test-run-result.json not found"
211+
fi
212+
213+
# Copy XML result file (should exist)
214+
if [ -f "./redisinsight/api/test/test-runs/coverage/test-run-result.xml" ]; then
215+
cp ./redisinsight/api/test/test-runs/coverage/test-run-result.xml ./itest/results/${{ matrix.rte }}.result.xml
216+
echo "✅ Copied test-run-result.xml"
217+
else
218+
echo "❌ test-run-result.xml not found"
219+
fi
220+
221+
# Copy coverage file (may be missing)
222+
if [ -f "./redisinsight/api/test/test-runs/coverage/test-run-coverage.json" ]; then
223+
cp ./redisinsight/api/test/test-runs/coverage/test-run-coverage.json ./itest/coverages/${{ matrix.rte }}.coverage.json
224+
echo "✅ Copied test-run-coverage.json"
225+
else
226+
echo "❌ test-run-coverage.json not found - creating empty file"
227+
echo "{}" > ./itest/coverages/${{ matrix.rte }}.coverage.json
228+
fi
187229
188230
- name: Upload coverage files as artifact
189231
if: always()

0 commit comments

Comments
 (0)