Skip to content

Commit 81d9e25

Browse files
authored
Merge pull request #3579 from RedisInsight/be/feature/RI-5848-update-recommendation
Show update redis recommendation when version is less than 7.3
2 parents fb3ef2a + 542bd7f commit 81d9e25

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
lines changed

redisinsight/api/src/common/constants/recommendations.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const BIG_SETS_RECOMMENDATION_LENGTH = 1_000;
1818
export const BIG_AMOUNT_OF_CONNECTED_CLIENTS_RECOMMENDATION_CLIENTS = 100;
1919
export const BIG_STRINGS_RECOMMENDATION_MEMORY = 100_000;
2020
export const SEARCH_INDEXES_RECOMMENDATION_KEYS_FOR_CHECK = 100;
21-
export const REDIS_VERSION_RECOMMENDATION_VERSION = '6';
21+
export const REDIS_VERSION_RECOMMENDATION_VERSION = '7.3';
2222
export const COMBINE_SMALL_STRINGS_TO_HASHES_RECOMMENDATION_KEYS_COUNT = 10;
2323
export const SEARCH_HASH_RECOMMENDATION_KEYS_FOR_CHECK = 50;
2424
export const SEARCH_HASH_RECOMMENDATION_KEYS_LENGTH = 2;

redisinsight/api/src/modules/database-recommendation/scanner/strategies/redis-version.strategy.spec.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,22 @@ describe('RedisVersionStrategy', () => {
99

1010
describe('isRecommendationReached', () => {
1111
describe('with search module', () => {
12-
it('should return false when version not less then 6', async () => {
13-
expect(await strategy.isRecommendationReached({ version: '6.0.0' })).toEqual({ isReached: false });
12+
it('should return false when version is more then 7.3', async () => {
13+
expect(
14+
await strategy.isRecommendationReached({ version: '7.4.0' }),
15+
).toEqual({ isReached: false });
1416
});
1517

16-
it('should return true when version less then 6', async () => {
17-
expect(await strategy.isRecommendationReached({ version: '5.1.1' })).toEqual({ isReached: true });
18+
it('should return false when version is equal to 7.3', async () => {
19+
expect(
20+
await strategy.isRecommendationReached({ version: '7.3' }),
21+
).toEqual({ isReached: false });
22+
});
23+
24+
it('should return true when version less then 7.3', async () => {
25+
expect(
26+
await strategy.isRecommendationReached({ version: '6.0.0' }),
27+
).toEqual({ isReached: true });
1828
});
1929
});
2030
});

redisinsight/api/src/modules/recommendation/providers/recommendation.provider.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ const mockRedisConfigResponse = ['name', '512'];
1818
const mockRedisClientsResponse1: string = '# Clients\r\nconnected_clients:100\r\n';
1919
const mockRedisClientsResponse2: string = '# Clients\r\nconnected_clients:101\r\n';
2020

21-
const mockRedisServerResponse1: string = '# Server\r\nredis_version:6.0.0\r\n';
22-
const mockRedisServerResponse2: string = '# Server\r\nredis_version:5.1.1\r\n';
21+
const mockRedisServerResponse1: string = '# Server\r\nredis_version:7.4.0\r\n';
22+
const mockRedisServerResponse2: string = '# Server\r\nredis_version:6.0.0\r\n';
2323

2424
const mockRedisAclListResponse1: string[] = [
2525
'user <pass off resetchannels -@all',

0 commit comments

Comments
 (0)