Skip to content

Commit 72d645a

Browse files
committed
try this
1 parent 126f560 commit 72d645a

3 files changed

Lines changed: 30 additions & 8 deletions

File tree

redisinsight/api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand -w 1",
3535
"test:e2e": "jest --config ./test/jest-e2e.json -w 1",
3636
"typeorm": "ts-node -r tsconfig-paths/register ./node_modules/typeorm/cli.js -d ./config/ormconfig.ts",
37-
"test:api": "cross-env NODE_ENV=test ts-mocha --paths --config ./test/api/.mocharc.yml",
37+
"test:api": "cross-env NODE_ENV=test ts-mocha --paths --config ./test/api/.mocharc.cjs",
3838
"test:api:cov": "nyc --reporter=html --reporter=text --reporter=text-summary yarn run test:api",
3939
"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",
4040
"typeorm:migrate": "cross-env NODE_ENV=staging yarn typeorm migration:generate ./migration/migration",
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Mocha config. Dynamic so the spec list can react to TEST_TAGS.
2+
//
3+
// When TEST_TAGS is set on an RTE (e.g. oss-st-8 sets TEST_TAGS=array
4+
// because redis:8.8-alpine lacks modules and other suites fail against
5+
// Redis 8.8 semantics — per-field hash TTL, RediSearch flag changes,
6+
// etc.), mocha only loads the file globs that map to the requested tag(s).
7+
// When TEST_TAGS is unset (every other RTE) the wildcard runs everything,
8+
// preserving prior behaviour exactly.
9+
const TAG_SPECS = {
10+
array: ['test/api/array/**/*.test.ts'],
11+
};
12+
13+
const tags = (process.env.TEST_TAGS || '')
14+
.split(',')
15+
.map((s) => s.trim())
16+
.filter(Boolean);
17+
18+
const spec = tags.length
19+
? [...new Set(tags.flatMap((t) => TAG_SPECS[t] || []))]
20+
: ['test/**/*.test.ts'];
21+
22+
module.exports = {
23+
spec,
24+
require: 'test/api/api.deps.init.ts',
25+
project: './test/api/api.tsconfig.json',
26+
retries: 2,
27+
timeout: 60000,
28+
exit: true,
29+
};

redisinsight/api/test/api/.mocharc.yml

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)