From 485c53a271d2c666990341ff0d09359a70ce0b72 Mon Sep 17 00:00:00 2001 From: KIvanow Date: Wed, 9 Jul 2025 11:14:17 +0300 Subject: [PATCH 01/17] RI-0000-fixing test coverage path mismatch --- redisinsight/api/test/test-runs/docker.build.env | 2 +- redisinsight/api/test/test-runs/local.build.env | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/redisinsight/api/test/test-runs/docker.build.env b/redisinsight/api/test/test-runs/docker.build.env index 64ca7d26e6..50fd64cef0 100644 --- a/redisinsight/api/test/test-runs/docker.build.env +++ b/redisinsight/api/test/test-runs/docker.build.env @@ -1,4 +1,4 @@ -COV_FOLDER=./coverage +COV_FOLDER=./test/test-runs/coverage ID=defaultid RTE=defaultrte APP_IMAGE=redisinsight:amd64 diff --git a/redisinsight/api/test/test-runs/local.build.env b/redisinsight/api/test/test-runs/local.build.env index d0fd5b848e..61a61f5040 100644 --- a/redisinsight/api/test/test-runs/local.build.env +++ b/redisinsight/api/test/test-runs/local.build.env @@ -1,4 +1,4 @@ -COV_FOLDER=./coverage +COV_FOLDER=./test/test-runs/coverage ID=defaultid RTE=defaultrte RI_NOTIFICATION_UPDATE_URL=https://s3.amazonaws.com/redisinsight.test/public/tests/notifications.json From c70786c117a75941306c7e027f5b4eb2e20c21ff Mon Sep 17 00:00:00 2001 From: KIvanow Date: Wed, 9 Jul 2025 11:28:22 +0300 Subject: [PATCH 02/17] RI-0000-fixing test coverage path mismatch --- .github/workflows/tests-integration.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.github/workflows/tests-integration.yml b/.github/workflows/tests-integration.yml index 8099e0eade..a4b1609c44 100644 --- a/.github/workflows/tests-integration.yml +++ b/.github/workflows/tests-integration.yml @@ -128,6 +128,30 @@ 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 - Show directory structure and environment files + run: | + echo "=== DEBUGGING COVERAGE ISSUE ===" + echo "Current working directory: $(pwd)" + echo "" + echo "=== Environment files content ===" + echo "local.build.env:" + cat ./redisinsight/api/test/test-runs/local.build.env + echo "" + echo "docker.build.env:" + cat ./redisinsight/api/test/test-runs/docker.build.env + echo "" + echo "=== Directory structure under redisinsight/api ===" + find ./redisinsight/api -type d -name "*coverage*" -o -name "*test-runs*" | head -10 + echo "" + echo "=== Files in expected coverage directory ===" + ls -la ./redisinsight/api/test/test-runs/coverage/ || echo "Coverage directory does not exist!" + echo "" + echo "=== All files under test-runs ===" + find ./redisinsight/api/test/test-runs -name "*.json" -o -name "*.xml" | head -20 + echo "" + echo "=== Looking for test result files anywhere ===" + find ./redisinsight/api -name "test-run-result.*" -o -name "*coverage*.json" | head -10 + cp ./redisinsight/api/test/test-runs/coverage/test-run-result.json ./itest/results/${{ matrix.rte }}.result.json cp ./redisinsight/api/test/test-runs/coverage/test-run-result.xml ./itest/results/${{ matrix.rte }}.result.xml cp ./redisinsight/api/test/test-runs/coverage/test-run-coverage.json ./itest/coverages/${{ matrix.rte }}.coverage.json From 493f69e25690959210661be1eca6c9b04e0d0b0c Mon Sep 17 00:00:00 2001 From: KIvanow Date: Wed, 9 Jul 2025 12:27:24 +0300 Subject: [PATCH 03/17] RI-0000-fixing test coverage path mismatch --- redisinsight/api/test/test-runs/docker.build.env | 2 +- redisinsight/api/test/test-runs/docker.build.yml | 2 +- redisinsight/api/test/test-runs/local.build.env | 2 +- redisinsight/api/test/test-runs/local.build.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/redisinsight/api/test/test-runs/docker.build.env b/redisinsight/api/test/test-runs/docker.build.env index 50fd64cef0..64ca7d26e6 100644 --- a/redisinsight/api/test/test-runs/docker.build.env +++ b/redisinsight/api/test/test-runs/docker.build.env @@ -1,4 +1,4 @@ -COV_FOLDER=./test/test-runs/coverage +COV_FOLDER=./coverage ID=defaultid RTE=defaultrte APP_IMAGE=redisinsight:amd64 diff --git a/redisinsight/api/test/test-runs/docker.build.yml b/redisinsight/api/test/test-runs/docker.build.yml index 6b3949adea..494c10819b 100644 --- a/redisinsight/api/test/test-runs/docker.build.yml +++ b/redisinsight/api/test/test-runs/docker.build.yml @@ -13,7 +13,7 @@ services: dockerfile: ./test/test-runs/test.Dockerfile tty: true volumes: - - shared-data:/usr/src/app/coverage + - shared-data:/usr/src/app/test/test-runs/coverage - shared-data:/root/.redisinsight-v2.0 - shared-data:/data depends_on: diff --git a/redisinsight/api/test/test-runs/local.build.env b/redisinsight/api/test/test-runs/local.build.env index 61a61f5040..d0fd5b848e 100644 --- a/redisinsight/api/test/test-runs/local.build.env +++ b/redisinsight/api/test/test-runs/local.build.env @@ -1,4 +1,4 @@ -COV_FOLDER=./test/test-runs/coverage +COV_FOLDER=./coverage ID=defaultid RTE=defaultrte RI_NOTIFICATION_UPDATE_URL=https://s3.amazonaws.com/redisinsight.test/public/tests/notifications.json diff --git a/redisinsight/api/test/test-runs/local.build.yml b/redisinsight/api/test/test-runs/local.build.yml index 1f5e33787c..e5fe693e0f 100644 --- a/redisinsight/api/test/test-runs/local.build.yml +++ b/redisinsight/api/test/test-runs/local.build.yml @@ -13,7 +13,7 @@ services: dockerfile: ./test/test-runs/test.Dockerfile tty: true volumes: - - ${COV_FOLDER}:/usr/src/app/coverage + - ${COV_FOLDER}:/usr/src/app/test/test-runs/coverage - ${COV_FOLDER}:/root/.redisinsight-v2.0 depends_on: - redis From 1bc887e144733ca64c5417e8a77637afd0c7f1dc Mon Sep 17 00:00:00 2001 From: KIvanow Date: Wed, 9 Jul 2025 12:41:05 +0300 Subject: [PATCH 04/17] RI-0000-fixing test coverage path mismatch --- redisinsight/api/test/test-runs/test-docker-entry.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/redisinsight/api/test/test-runs/test-docker-entry.sh b/redisinsight/api/test/test-runs/test-docker-entry.sh index 6a1afe66b1..c30c7de723 100644 --- a/redisinsight/api/test/test-runs/test-docker-entry.sh +++ b/redisinsight/api/test/test-runs/test-docker-entry.sh @@ -11,7 +11,4 @@ eval "$(echo "$GNOME_KEYRING_PASS" | gnome-keyring-daemon --unlock)" sleep 1 eval "$(echo "$GNOME_KEYRING_PASS" | gnome-keyring-daemon --start)" -# Create coverage directory before running tests -mkdir -p test/test-runs/coverage - exec "$@" From 3ccbef27418c5b29feed7dabd21d76873d1190ab Mon Sep 17 00:00:00 2001 From: KIvanow Date: Wed, 9 Jul 2025 12:45:07 +0300 Subject: [PATCH 05/17] RI-0000-fixing test coverage path mismatch --- redisinsight/api/test/api/reporters.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/redisinsight/api/test/api/reporters.json b/redisinsight/api/test/api/reporters.json index 9c5dbed76c..e7ee7aea0f 100644 --- a/redisinsight/api/test/api/reporters.json +++ b/redisinsight/api/test/api/reporters.json @@ -1,9 +1,9 @@ { "reporterEnabled": "spec,@mochajs/json-file-reporter,mocha-junit-reporter", "mochajsJsonFileReporterReporterOptions": { - "output": "test/test-runs/coverage/test-run-result.json" + "output": "coverage/test-run-result.json" }, "mochaJunitReporterReporterOptions": { - "mochaFile": "test/test-runs/coverage/test-run-result.xml" + "mochaFile": "coverage/test-run-result.xml" } } From a8054e425fade2954ee49d7782fcff90e49218cc Mon Sep 17 00:00:00 2001 From: KIvanow Date: Wed, 9 Jul 2025 12:51:43 +0300 Subject: [PATCH 06/17] RI-0000-fixing test coverage path mismatch --- redisinsight/api/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redisinsight/api/package.json b/redisinsight/api/package.json index 73e52b9cdb..44a7259e23 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 && nyc merge .nyc_output ./test/test-runs/coverage/test-run-coverage.json", + "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" From 56efd853bfe82f6e4e0c23fdb995c9aeed5d0dd4 Mon Sep 17 00:00:00 2001 From: KIvanow Date: Wed, 9 Jul 2025 12:57:53 +0300 Subject: [PATCH 07/17] RI-0000-fixing test coverage path mismatch --- redisinsight/api/test/test-runs/docker.build.yml | 2 +- redisinsight/api/test/test-runs/local.build.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/redisinsight/api/test/test-runs/docker.build.yml b/redisinsight/api/test/test-runs/docker.build.yml index 494c10819b..6b3949adea 100644 --- a/redisinsight/api/test/test-runs/docker.build.yml +++ b/redisinsight/api/test/test-runs/docker.build.yml @@ -13,7 +13,7 @@ services: dockerfile: ./test/test-runs/test.Dockerfile tty: true volumes: - - shared-data:/usr/src/app/test/test-runs/coverage + - shared-data:/usr/src/app/coverage - shared-data:/root/.redisinsight-v2.0 - shared-data:/data depends_on: diff --git a/redisinsight/api/test/test-runs/local.build.yml b/redisinsight/api/test/test-runs/local.build.yml index e5fe693e0f..1f5e33787c 100644 --- a/redisinsight/api/test/test-runs/local.build.yml +++ b/redisinsight/api/test/test-runs/local.build.yml @@ -13,7 +13,7 @@ services: dockerfile: ./test/test-runs/test.Dockerfile tty: true volumes: - - ${COV_FOLDER}:/usr/src/app/test/test-runs/coverage + - ${COV_FOLDER}:/usr/src/app/coverage - ${COV_FOLDER}:/root/.redisinsight-v2.0 depends_on: - redis From e6c227f85a9bedb79ccd13db942a218ab20466e1 Mon Sep 17 00:00:00 2001 From: KIvanow Date: Wed, 9 Jul 2025 13:11:07 +0300 Subject: [PATCH 08/17] RI-0000-fixing test coverage path mismatch --- redisinsight/api/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redisinsight/api/package.json b/redisinsight/api/package.json index 44a7259e23..5d4c7e5279 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 && nyc merge .nyc_output ./coverage/test-run-coverage.json", + "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" From 17d195b1e852af825b134d62005db9a9521e3d48 Mon Sep 17 00:00:00 2001 From: KIvanow Date: Wed, 9 Jul 2025 13:30:52 +0300 Subject: [PATCH 09/17] RI-0000-fixing test coverage path mismatch --- redisinsight/api/test/test-runs/docker.build.yml | 2 +- redisinsight/api/test/test-runs/local.build.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/redisinsight/api/test/test-runs/docker.build.yml b/redisinsight/api/test/test-runs/docker.build.yml index 6b3949adea..72f656ded8 100644 --- a/redisinsight/api/test/test-runs/docker.build.yml +++ b/redisinsight/api/test/test-runs/docker.build.yml @@ -57,5 +57,5 @@ volumes: driver: local driver_opts: type: none - device: ${COV_FOLDER} + device: ../../${COV_FOLDER} o: bind diff --git a/redisinsight/api/test/test-runs/local.build.yml b/redisinsight/api/test/test-runs/local.build.yml index 1f5e33787c..97c37dbc56 100644 --- a/redisinsight/api/test/test-runs/local.build.yml +++ b/redisinsight/api/test/test-runs/local.build.yml @@ -13,7 +13,7 @@ services: dockerfile: ./test/test-runs/test.Dockerfile tty: true volumes: - - ${COV_FOLDER}:/usr/src/app/coverage + - ../../${COV_FOLDER}:/usr/src/app/coverage - ${COV_FOLDER}:/root/.redisinsight-v2.0 depends_on: - redis From 259e1f6cca4c4c7c6eafa516f8c64f225db847d4 Mon Sep 17 00:00:00 2001 From: KIvanow Date: Wed, 9 Jul 2025 13:42:20 +0300 Subject: [PATCH 10/17] RI-0000-fixing test coverage path mismatch --- redisinsight/api/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redisinsight/api/package.json b/redisinsight/api/package.json index 5d4c7e5279..ad4ae94c66 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 && nyc merge .nyc_output coverage/test-run-coverage.json", + "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/", "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" From 3d9168fd3f32a372ab7070138532bbc78a8671a3 Mon Sep 17 00:00:00 2001 From: KIvanow Date: Wed, 9 Jul 2025 14:03:52 +0300 Subject: [PATCH 11/17] RI-0000-fixing test coverage path mismatch --- .github/workflows/tests-integration.yml | 45 +++++++++++++++++++++++++ redisinsight/api/package.json | 2 +- 2 files changed, 46 insertions(+), 1 deletion(-) 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" From 6d7020ef8ea2265fa5276f64e942de218e180701 Mon Sep 17 00:00:00 2001 From: KIvanow Date: Wed, 9 Jul 2025 14:18:18 +0300 Subject: [PATCH 12/17] RI-0000-fixing test coverage path mismatch --- .github/workflows/tests-integration.yml | 59 +++++++++---------------- redisinsight/api/package.json | 2 +- 2 files changed, 23 insertions(+), 38 deletions(-) diff --git a/.github/workflows/tests-integration.yml b/.github/workflows/tests-integration.yml index 06ea414f42..25a236c4cf 100644 --- a/.github/workflows/tests-integration.yml +++ b/.github/workflows/tests-integration.yml @@ -128,49 +128,34 @@ 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 "❌ 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 "No test results JSON file found" + echo "❌ JUnit XML file missing!" fi - name: Debug - Show directory structure and environment files @@ -220,8 +205,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' diff --git a/redisinsight/api/package.json b/redisinsight/api/package.json index 722c795fb1..5d4c7e5279 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...' > 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" From df9c1063d5a43927e24d0cda1299e094085462fc Mon Sep 17 00:00:00 2001 From: KIvanow Date: Wed, 9 Jul 2025 14:33:32 +0300 Subject: [PATCH 13/17] RI-0000-fixing test coverage path mismatch --- .github/workflows/tests-integration.yml | 76 +++++++++++++++++++------ 1 file changed, 58 insertions(+), 18 deletions(-) diff --git a/.github/workflows/tests-integration.yml b/.github/workflows/tests-integration.yml index 25a236c4cf..6093672348 100644 --- a/.github/workflows/tests-integration.yml +++ b/.github/workflows/tests-integration.yml @@ -158,33 +158,73 @@ jobs: echo "❌ JUnit XML file missing!" fi - - name: Debug - Show directory structure and environment files + - name: Debug NYC coverage generation + if: always() run: | - echo "=== DEBUGGING COVERAGE ISSUE ===" - echo "Current working directory: $(pwd)" + echo "=== Debugging missing test-run-coverage.json file ===" + echo "Working directory: $(pwd)" echo "" - echo "=== Environment files content ===" - echo "local.build.env:" - cat ./redisinsight/api/test/test-runs/local.build.env + echo "=== Check .nyc_output directory in API folder ===" + cd ./redisinsight/api + if [ -d ".nyc_output" ]; then + echo "✅ .nyc_output directory exists" + echo "Contents:" + ls -la .nyc_output + echo "File count: $(find .nyc_output -name "*.json" | wc -l)" + echo "Sample file content (first 5 lines):" + find .nyc_output -name "*.json" | head -1 | xargs head -5 2>/dev/null || echo "No JSON files to sample" + else + echo "❌ .nyc_output directory does not exist!" + fi echo "" - echo "docker.build.env:" - cat ./redisinsight/api/test/test-runs/docker.build.env + echo "=== Try manual NYC merge ===" + if [ -d ".nyc_output" ] && [ "$(find .nyc_output -name "*.json" | wc -l)" -gt 0 ]; then + echo "Attempting manual NYC merge..." + echo "Command: nyc merge .nyc_output coverage/test-run-coverage.json" + nyc merge .nyc_output coverage/test-run-coverage.json || echo "NYC merge failed with exit code $?" + echo "Checking result:" + ls -la coverage/test-run-coverage.json 2>/dev/null || echo "File not created" + else + echo "Skipping merge - no coverage data files found" + fi echo "" - echo "=== Directory structure under redisinsight/api ===" - find ./redisinsight/api -type d -name "*coverage*" -o -name "*test-runs*" | head -10 + echo "=== Final coverage directory check ===" + ls -la coverage/ | head -10 + + - name: Copy test results to artifacts + run: | + echo "=== COPYING TEST RESULTS ===" + echo "Current working directory: $(pwd)" echo "" echo "=== Files in expected coverage directory ===" ls -la ./redisinsight/api/test/test-runs/coverage/ || echo "Coverage directory does not exist!" echo "" - echo "=== All files under test-runs ===" - find ./redisinsight/api/test/test-runs -name "*.json" -o -name "*.xml" | head -20 - echo "" - echo "=== Looking for test result files anywhere ===" - find ./redisinsight/api -name "test-run-result.*" -o -name "*coverage*.json" | head -10 + echo "=== Copying files with error handling ===" - cp ./redisinsight/api/test/test-runs/coverage/test-run-result.json ./itest/results/${{ matrix.rte }}.result.json - cp ./redisinsight/api/test/test-runs/coverage/test-run-result.xml ./itest/results/${{ matrix.rte }}.result.xml - cp ./redisinsight/api/test/test-runs/coverage/test-run-coverage.json ./itest/coverages/${{ matrix.rte }}.coverage.json + # Copy JSON result file (should exist) + if [ -f "./redisinsight/api/test/test-runs/coverage/test-run-result.json" ]; then + cp ./redisinsight/api/test/test-runs/coverage/test-run-result.json ./itest/results/${{ matrix.rte }}.result.json + echo "✅ Copied test-run-result.json" + else + echo "❌ test-run-result.json not found" + fi + + # Copy XML result file (should exist) + if [ -f "./redisinsight/api/test/test-runs/coverage/test-run-result.xml" ]; then + cp ./redisinsight/api/test/test-runs/coverage/test-run-result.xml ./itest/results/${{ matrix.rte }}.result.xml + echo "✅ Copied test-run-result.xml" + else + echo "❌ test-run-result.xml not found" + fi + + # Copy coverage file (may be missing) + if [ -f "./redisinsight/api/test/test-runs/coverage/test-run-coverage.json" ]; then + cp ./redisinsight/api/test/test-runs/coverage/test-run-coverage.json ./itest/coverages/${{ matrix.rte }}.coverage.json + echo "✅ Copied test-run-coverage.json" + else + echo "❌ test-run-coverage.json not found - creating empty file" + echo "{}" > ./itest/coverages/${{ matrix.rte }}.coverage.json + fi - name: Upload coverage files as artifact if: always() From 87a390b32f8253da2f240701761fed71f95c05bc Mon Sep 17 00:00:00 2001 From: KIvanow Date: Wed, 9 Jul 2025 14:46:24 +0300 Subject: [PATCH 14/17] RI-0000-fixing test coverage path mismatch --- .github/workflows/tests-integration.yml | 46 +++++++++++++++++-------- redisinsight/api/package.json | 3 +- 2 files changed, 33 insertions(+), 16 deletions(-) diff --git a/.github/workflows/tests-integration.yml b/.github/workflows/tests-integration.yml index 6093672348..f7cd651e2c 100644 --- a/.github/workflows/tests-integration.yml +++ b/.github/workflows/tests-integration.yml @@ -164,20 +164,36 @@ jobs: echo "=== Debugging missing test-run-coverage.json file ===" echo "Working directory: $(pwd)" echo "" - echo "=== Check .nyc_output directory in API folder ===" + echo "=== Check .nyc_output directory in API folder (HOST) ===" cd ./redisinsight/api if [ -d ".nyc_output" ]; then - echo "✅ .nyc_output directory exists" + echo "✅ .nyc_output directory exists on host" echo "Contents:" ls -la .nyc_output echo "File count: $(find .nyc_output -name "*.json" | wc -l)" echo "Sample file content (first 5 lines):" find .nyc_output -name "*.json" | head -1 | xargs head -5 2>/dev/null || echo "No JSON files to sample" else - echo "❌ .nyc_output directory does not exist!" + echo "❌ .nyc_output directory does not exist on host!" fi echo "" - echo "=== Try manual NYC merge ===" + echo "=== Check .nyc_output directory in DOCKER CONTAINER ===" + cd /home/runner/work/RedisInsight/RedisInsight + export COV_FOLDER="./redisinsight/api/test/test-runs/coverage" + export ID="debug-test" + export RTE="debug" + cd ./redisinsight/api/test/test-runs + echo "Running debug command inside container to check .nyc_output..." + if [ -f "./docker.build.yml" ]; then + echo "Using Docker build..." + echo "Command: docker-compose -f ./docker.build.yml -f ./docker.build.env exec test ls -la /usr/src/app/.nyc_output" + docker-compose -f ./docker.build.yml --env-file ./docker.build.env exec test ls -la /usr/src/app/.nyc_output 2>/dev/null || echo "Container not running or .nyc_output not found in container" + else + echo "Docker compose file not found" + fi + echo "" + echo "=== Try manual NYC merge in HOST ===" + cd /home/runner/work/RedisInsight/RedisInsight/redisinsight/api if [ -d ".nyc_output" ] && [ "$(find .nyc_output -name "*.json" | wc -l)" -gt 0 ]; then echo "Attempting manual NYC merge..." echo "Command: nyc merge .nyc_output coverage/test-run-coverage.json" @@ -239,17 +255,17 @@ jobs: ITEST_NAME=${{ matrix.rte }} node ./.github/itest-results.js curl -H "Content-type: application/json" --data @itests.report.json -H "Authorization: Bearer $SLACK_TEST_REPORT_KEY" -X POST https://slack.com/api/chat.postMessage - - name: Generate test results - uses: dorny/test-reporter@v1 - id: test-reporter - if: always() - with: - name: 'Test results: IT (${{ matrix.rte }}) tests' - path: itest/results/*.result.json - reporter: mocha-json - list-tests: 'failed' - list-suites: 'failed' - fail-on-error: 'false' + # - name: Generate test results + # uses: dorny/test-reporter@v1 + # id: test-reporter + # if: always() + # with: + # name: 'Test results: IT (${{ matrix.rte }}) tests' + # path: itest/results/*.result.json + # reporter: mocha-json + # list-tests: 'failed' + # list-suites: 'failed' + # fail-on-error: 'false' - name: Add link to report in the workflow summary if: always() diff --git a/redisinsight/api/package.json b/redisinsight/api/package.json index 5d4c7e5279..6b4e022a11 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 && nyc merge .nyc_output coverage/test-run-coverage.json", + "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" @@ -149,6 +149,7 @@ "tsconfig-paths-webpack-plugin": "^3.3.0", "typescript": "^4.8.2" }, + "jest": { "moduleFileExtensions": [ "js", From 3fcbaa134363b3a6e2da707b70472b0202f4bc14 Mon Sep 17 00:00:00 2001 From: KIvanow Date: Wed, 9 Jul 2025 16:58:45 +0300 Subject: [PATCH 15/17] RI-0000-fixing test coverage path mismatch - testing nyc params --- redisinsight/api/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redisinsight/api/package.json b/redisinsight/api/package.json index 6b4e022a11..b05bf1240a 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 && nyc merge .nyc_output ./coverage/test-run-coverage.json", + "test:api:ci:cov": "cross-env nyc --temp-dir .nyc_output --report-dir coverage -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" From 17e95ffd6b0e22020d815b13fa25818b8f1b56b7 Mon Sep 17 00:00:00 2001 From: KIvanow Date: Wed, 9 Jul 2025 17:10:34 +0300 Subject: [PATCH 16/17] RI-0000-fixing test coverage path mismatch - testing nyc params --- redisinsight/api/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redisinsight/api/package.json b/redisinsight/api/package.json index b05bf1240a..f06dabb78a 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 --temp-dir .nyc_output --report-dir coverage -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", + "test:api:ci:cov": "cross-env NODE_ENV=test nyc --temp-dir .nyc_output --report-dir coverage --instrument -r text -r text-summary -r html yarn run test:api --reporter mocha-multi-reporters --reporter-options configFile=test/api/reporters.json && ls -la .nyc_output && 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" From 96a18b2844a601c6b17eba3efbb129ce54679c8c Mon Sep 17 00:00:00 2001 From: KIvanow Date: Wed, 9 Jul 2025 17:31:24 +0300 Subject: [PATCH 17/17] RI-0000-fixing test coverage path mismatch - testing nyc params --- redisinsight/api/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redisinsight/api/package.json b/redisinsight/api/package.json index f06dabb78a..31e16b2729 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 NODE_ENV=test nyc --temp-dir .nyc_output --report-dir coverage --instrument -r text -r text-summary -r html yarn run test:api --reporter mocha-multi-reporters --reporter-options configFile=test/api/reporters.json && ls -la .nyc_output && nyc merge .nyc_output ./coverage/test-run-coverage.json", + "test:api:ci:cov": "cross-env NODE_ENV=test nyc --temp-dir coverage/.nyc_output --report-dir coverage --instrument -r text -r text-summary -r html yarn run test:api --reporter mocha-multi-reporters --reporter-options configFile=test/api/reporters.json && ls -la coverage/.nyc_output && nyc merge coverage/.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"