diff --git a/.github/workflows/tests-integration.yml b/.github/workflows/tests-integration.yml index a4b1609c44..06ea414f42 100644 --- a/.github/workflows/tests-integration.yml +++ b/.github/workflows/tests-integration.yml @@ -128,6 +128,51 @@ 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 + 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 "" + echo "=== Final coverage directory contents ===" + ls -la ./redisinsight/api/test/test-runs/coverage/ || echo "Coverage directory does not exist!" + echo "" + echo "=== Test execution 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 + else + echo "No test results JSON file found" + fi + - name: Debug - Show directory structure and environment files run: | echo "=== DEBUGGING COVERAGE ISSUE ===" diff --git a/redisinsight/api/package.json b/redisinsight/api/package.json index ad4ae94c66..722c795fb1 100644 --- a/redisinsight/api/package.json +++ b/redisinsight/api/package.json @@ -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...' && ls -la .nyc_output && nyc merge .nyc_output coverage/test-run-coverage.json && echo 'NYC merge completed!' && ls -la coverage/", + "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", "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"