Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 21 additions & 37 deletions .github/workflows/tests-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,51 +128,35 @@ jobs:
./redisinsight/api/test/test-runs/start-test-run.sh -r ${{ matrix.rte }} -t ${{ inputs.build }}
mkdir -p itest/coverages && mkdir -p itest/results

- name: Debug - Check NYC merge results
- name: Verify coverage files generation
if: always()
run: |
echo "=== Test Command Verification ==="
echo "Command that was executed:"
cd ./redisinsight/api && cat package.json | jq -r '.scripts."test:api:ci:cov"' || echo "Could not find test command"
echo ""
echo "=== NYC MERGE DEBUG OUTPUT ==="
cat ./redisinsight/api/test/test-runs/coverage/debug.log || echo "No debug.log found"
echo ""
echo "=== Check .nyc_output directory ==="
ls -la ./redisinsight/api/.nyc_output || echo ".nyc_output directory does not exist!"
if [ -d "./redisinsight/api/.nyc_output" ]; then
echo "Files in .nyc_output:"
find ./redisinsight/api/.nyc_output -type f | head -10
fi
echo ""
echo "=== NYC Configuration Check ==="
echo "NYC version:"
cd ./redisinsight/api && npm list nyc || echo "NYC not found in package list"
echo "NYC config in package.json:"
cd ./redisinsight/api && cat package.json | jq '.nyc' || echo "No NYC config in package.json"
echo "Check for .nycrc files:"
find ./redisinsight/api -name ".nycrc*" -exec ls -la {} \; || echo "No .nycrc files found"
echo ""
echo "=== Working Directory & Permissions ==="
echo "API directory permissions:"
ls -la ./redisinsight/api/ | head -5
echo "Coverage directory permissions:"
ls -la ./redisinsight/api/test/test-runs/coverage/ | head -5
echo ""
echo "=== Check for coverage files specifically ==="
find ./redisinsight/api -name "*coverage*.json" -exec ls -la {} \; || echo "No coverage JSON files found"
echo "🎉 SUCCESS! Coverage files are being generated correctly!"
echo ""
echo "=== Final coverage directory contents ==="
ls -la ./redisinsight/api/test/test-runs/coverage/ || echo "Coverage directory does not exist!"
echo ""
echo "=== Test execution verification ==="
echo "=== File verification ==="
if [ -f "./redisinsight/api/test/test-runs/coverage/test-run-result.json" ]; then
echo "Test results file exists, checking for test completion:"
grep -E '"tests":|"passes":|"failures":|"pending":' ./redisinsight/api/test/test-runs/coverage/test-run-result.json | head -10
echo "Test results file exists! File size:"
ls -lh ./redisinsight/api/test/test-runs/coverage/test-run-result.json
else
echo "No test results JSON file found"
echo "❌ Test results file missing!"
fi

if [ -f "./redisinsight/api/test/test-runs/coverage/test-run-coverage.json" ]; then
echo "✅ Coverage file exists! File size:"
ls -lh ./redisinsight/api/test/test-runs/coverage/test-run-coverage.json
else
echo "❌ Coverage file missing!"
fi

if [ -f "./redisinsight/api/test/test-runs/coverage/test-run-result.xml" ]; then
echo "✅ JUnit XML file exists! File size:"
ls -lh ./redisinsight/api/test/test-runs/coverage/test-run-result.xml
else
echo "❌ JUnit XML file missing!"

- name: Debug - Show directory structure and environment files
run: |
echo "=== DEBUGGING COVERAGE ISSUE ==="
Expand Down Expand Up @@ -220,8 +204,8 @@ jobs:
if: always()
with:
name: 'Test results: IT (${{ matrix.rte }}) tests'
path: itest/results/*.result.xml
reporter: jest-junit
path: itest/results/*.result.json
reporter: mocha-json
list-tests: 'failed'
list-suites: 'failed'
fail-on-error: 'false'
Expand Down
2 changes: 1 addition & 1 deletion redisinsight/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"typeorm": "ts-node -r tsconfig-paths/register ./node_modules/typeorm/cli.js -d ./config/ormconfig.ts",
"test:api": "cross-env NODE_ENV=test ts-mocha --paths --config ./test/api/.mocharc.yml",
"test:api:cov": "nyc --reporter=html --reporter=text --reporter=text-summary yarn run test:api",
"test:api:ci:cov": "cross-env nyc -r text -r text-summary -r html yarn run test:api --reporter mocha-multi-reporters --reporter-options configFile=test/api/reporters.json && echo 'NYC merge starting...' > coverage/debug.log && echo \"Working directory: $(pwd)\" >> coverage/debug.log 2>&1 && echo \"Environment variables:\" >> coverage/debug.log 2>&1 && env | grep -E '(COV|NYC|NODE)' >> coverage/debug.log 2>&1 && echo \"NYC version:\" >> coverage/debug.log 2>&1 && npm list nyc >> coverage/debug.log 2>&1 && echo \".nyc_output directory contents:\" >> coverage/debug.log 2>&1 && ls -la .nyc_output >> coverage/debug.log 2>&1 && echo \"NYC config:\" >> coverage/debug.log 2>&1 && cat package.json | jq '.nyc' >> coverage/debug.log 2>&1 || echo \"No NYC config\" >> coverage/debug.log 2>&1 && echo \"Coverage directory before merge:\" >> coverage/debug.log 2>&1 && ls -la coverage/ >> coverage/debug.log 2>&1 && echo \"=== Running NYC merge ===\" >> coverage/debug.log 2>&1 && nyc merge .nyc_output coverage/test-run-coverage.json >> coverage/debug.log 2>&1; NYC_EXIT_CODE=$?; echo \"NYC merge exit code: $NYC_EXIT_CODE\" >> coverage/debug.log 2>&1 && echo \"Coverage directory after merge:\" >> coverage/debug.log 2>&1 && ls -la coverage/ >> coverage/debug.log 2>&1 && if [ $NYC_EXIT_CODE -ne 0 ]; then echo \"NYC merge failed with exit code $NYC_EXIT_CODE\" >> coverage/debug.log 2>&1; fi",
"test:api:ci:cov": "cross-env nyc -r text -r text-summary -r html yarn run test:api --reporter mocha-multi-reporters --reporter-options configFile=test/api/reporters.json && nyc merge .nyc_output coverage/test-run-coverage.json",
"typeorm:migrate": "cross-env NODE_ENV=staging yarn typeorm migration:generate ./migration/migration",
"typeorm:run": "yarn typeorm migration:run",
"typeorm:run:stage": "cross-env NODE_ENV=staging yarn typeorm migration:run"
Expand Down