Skip to content

Commit 3328f06

Browse files
[release-1.5] test: update redis tests (#2480)
* Update redis tests * remove useRedisSets option * Update verify-redis-cache.spec.ts * update redis test * Update verify-redis-cache.spec.ts * update redis test --------- Co-authored-by: Alessandro Barbarossa <[email protected]>
1 parent d2f132c commit 3328f06

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

.ibm/pipelines/resources/config_map/app-config-rhdh.yaml

+3-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ backend:
3636
cache:
3737
store: redis
3838
connection: redis://${REDIS_USERNAME}:${REDIS_PASSWORD}@redis:6379
39-
useRedisSets: true
39+
# redis sets are no longer supported from 1.5
40+
# useRedisSets: true
4041
integrations:
4142
# Plugin: GitHub
4243
github:
@@ -174,4 +175,4 @@ argocd:
174175
url: temp
175176
token: temp
176177
permission:
177-
enabled: false
178+
enabled: false

e2e-tests/playwright/e2e/verify-redis-cache.spec.ts

+17-1
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,20 @@ test.describe("Verify Redis Cache DB", () => {
2323
});
2424

2525
test("Open techdoc and verify the cache generated in redis db", async () => {
26+
test.setTimeout(120_000);
27+
2628
await uiHelper.openSidebarButton("Favorites");
2729
await uiHelper.openSidebar("Docs");
2830
await uiHelper.clickLink("Backstage Showcase");
2931

32+
// ensure that the docs are generated. if redis configuration has an error, this page will hang and docs won't be generated
33+
await expect(async () => {
34+
await uiHelper.verifyHeading("rhdh");
35+
}).toPass({
36+
intervals: [3_000],
37+
timeout: 60_000,
38+
});
39+
3040
// Wait for port-forward to be ready
3141
await new Promise<void>((resolve, reject) => {
3242
portForward.stdout.on("data", (data) => {
@@ -46,9 +56,15 @@ test.describe("Verify Redis Cache DB", () => {
4656
await expect(async () => {
4757
const keys = await redis.keys("*");
4858
expect(keys).toContainEqual(expect.stringContaining("techdocs"));
59+
60+
// Additionally, verify the format of the key
61+
const key = keys.filter((k) => k.startsWith("techdocs"))[0];
62+
expect(key).toMatch(
63+
/techdocs:(?:[A-Za-z0-9+]{4})*(?:[A-Za-z0-9+]{2}==|[A-Za-z0-9+]{3}=)$/gm,
64+
);
4965
}).toPass({
5066
intervals: [3_000],
51-
timeout: 30_000,
67+
timeout: 60_000,
5268
});
5369
});
5470

0 commit comments

Comments
 (0)