Skip to content

Commit 0432a78

Browse files
committed
rte commit: run just for arrays
1 parent c3f9cc1 commit 0432a78

9 files changed

Lines changed: 48 additions & 0 deletions

redisinsight/api/test/api/array/POST-databases-id-array-get_count.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
deps,
66
Joi,
77
requirements,
8+
tag,
89
generateInvalidDataTestCases,
910
validateInvalidDataTestCase,
1011
validateApiCall,
@@ -38,6 +39,7 @@ const responseSchema = Joi.object()
3839
const mainCheckFn = getMainCheckFn(endpoint);
3940

4041
describe('POST /databases/:instanceId/array/get-count', () => {
42+
tag('array');
4143
requirements('rte.version>=8.8');
4244
beforeEach(async () => rte.data.truncate());
4345

redisinsight/api/test/api/array/POST-databases-id-array-get_element.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
deps,
77
Joi,
88
requirements,
9+
tag,
910
generateInvalidDataTestCases,
1011
validateInvalidDataTestCase,
1112
validateApiCall,
@@ -58,6 +59,7 @@ const seedSparse = (key: string) =>
5859
rte.client.call('ARMSET', key, '0', '20.1', '1', '20.4', '5', '21.4');
5960

6061
describe('POST /databases/:instanceId/array/get-element', () => {
62+
tag('array');
6163
requirements('rte.version>=8.8');
6264
beforeEach(async () => rte.data.truncate());
6365

redisinsight/api/test/api/array/POST-databases-id-array-get_elements.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
deps,
77
Joi,
88
requirements,
9+
tag,
910
generateInvalidDataTestCases,
1011
validateInvalidDataTestCase,
1112
validateApiCall,
@@ -57,6 +58,7 @@ const seedSparse = (key: string) =>
5758
rte.client.call('ARMSET', key, '0', '20.1', '1', '20.4', '5', '21.4');
5859

5960
describe('POST /databases/:instanceId/array/get-elements', () => {
61+
tag('array');
6062
requirements('rte.version>=8.8');
6163
beforeEach(async () => rte.data.truncate());
6264

redisinsight/api/test/api/array/POST-databases-id-array-get_length.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
deps,
77
Joi,
88
requirements,
9+
tag,
910
generateInvalidDataTestCases,
1011
validateInvalidDataTestCase,
1112
validateApiCall,
@@ -42,6 +43,7 @@ const responseSchema = Joi.object()
4243
const mainCheckFn = getMainCheckFn(endpoint);
4344

4445
describe('POST /databases/:instanceId/array/get-length', () => {
46+
tag('array');
4547
// Array is a Redis 8.8 preview type; skip where the server lacks ARLEN.
4648
requirements('rte.version>=8.8');
4749
beforeEach(async () => rte.data.truncate());

redisinsight/api/test/api/array/POST-databases-id-array-get_next_index.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
deps,
77
Joi,
88
requirements,
9+
tag,
910
generateInvalidDataTestCases,
1011
validateInvalidDataTestCase,
1112
validateApiCall,
@@ -42,6 +43,7 @@ const responseSchema = Joi.object()
4243
const mainCheckFn = getMainCheckFn(endpoint);
4344

4445
describe('POST /databases/:instanceId/array/get-next-index', () => {
46+
tag('array');
4547
requirements('rte.version>=8.8');
4648
beforeEach(async () => rte.data.truncate());
4749

redisinsight/api/test/api/array/POST-databases-id-array-get_range.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
deps,
77
Joi,
88
requirements,
9+
tag,
910
generateInvalidDataTestCases,
1011
validateInvalidDataTestCase,
1112
validateApiCall,
@@ -59,6 +60,7 @@ const seedSparse = (key: string) =>
5960
rte.client.call('ARMSET', key, '0', '20.1', '1', '20.4', '5', '21.4');
6061

6162
describe('POST /databases/:instanceId/array/get-range', () => {
63+
tag('array');
6264
requirements('rte.version>=8.8');
6365
beforeEach(async () => rte.data.truncate());
6466

redisinsight/api/test/api/array/POST-databases-id-array-scan.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
deps,
77
Joi,
88
requirements,
9+
tag,
910
generateInvalidDataTestCases,
1011
validateInvalidDataTestCase,
1112
validateApiCall,
@@ -66,6 +67,7 @@ const seedSparse = (key: string) =>
6667
rte.client.call('ARMSET', key, '0', '20.1', '1', '20.4', '5', '21.4');
6768

6869
describe('POST /databases/:instanceId/array/scan', () => {
70+
tag('array');
6971
requirements('rte.version>=8.8');
7072
beforeEach(async () => rte.data.truncate());
7173

redisinsight/api/test/helpers/test/conditionalIgnore.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,31 @@ export const requirements = function (...conditions) {
3030
});
3131
};
3232

33+
/**
34+
* Tag a suite. When the TEST_TAGS env var is set (e.g. TEST_TAGS=array on
35+
* the oss-st-8 RTE), only suites whose declared tags intersect that list
36+
* run; all others skip. When TEST_TAGS is unset, tags are a no-op — every
37+
* suite runs as before.
38+
*
39+
* Mirrors requirements(); call inside a describe() block.
40+
* note: add support for "it" if needed
41+
*
42+
* @param tags
43+
*/
44+
export const tag = function (...tags: string[]) {
45+
const filter = process.env.TEST_TAGS?.split(',')
46+
.map((s) => s.trim())
47+
.filter(Boolean);
48+
49+
if (!filter?.length) return;
50+
51+
if (!tags.some((t) => filter.includes(t))) {
52+
before(function () {
53+
this.skip();
54+
});
55+
}
56+
};
57+
3358
const cmdReg = /^([?!\w\.]+)(\s?[=<>]+)?(\s?[\w\.]+)?$/;
3459
const processConditionString = (condition: string): boolean => {
3560
if (!cmdReg.test(condition)) {

redisinsight/api/test/test-runs/oss-st-8/docker-compose.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,12 @@ version: '3.4'
33
services:
44
redis:
55
image: redis:8.8-alpine
6+
7+
# Scope the run to suites that declared `tag('array')` (the new Array data
8+
# type read endpoints). redis:8.8-alpine has no modules and ships Redis 8.8
9+
# semantics (per-field hash TTL, RediSearch flag changes, etc.) that other
10+
# untagged suites don't tolerate, so leaving them in would produce noise
11+
# unrelated to the suite this RTE was added for.
12+
test:
13+
environment:
14+
TEST_TAGS: array

0 commit comments

Comments
 (0)