Skip to content

Commit

Permalink
ci: redis test
Browse files Browse the repository at this point in the history
  • Loading branch information
CahidArda committed Nov 27, 2024
1 parent 1198f18 commit c244d13
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 16 deletions.
4 changes: 2 additions & 2 deletions examples/ci/app/ci/upstash/redis.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import { nanoid } from "../utils";
describe("redis", () => {
test("should throw on missing results", () => {
expect(() =>
redis.checkRedisForResults("some-route", "some-id", -1, "some-result")
redis.checkRedisForResults("some-route", "some-id", -1, "some-result", 1)
).toThrow(
"result not found for route some-route with randomTestId some-id"
)
}, { timeout: 10000 })
}, { timeout: 15000 })

test("should throw when saving results without any increment", () => {
expect(() =>
Expand Down
3 changes: 2 additions & 1 deletion examples/ci/app/ci/upstash/redis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,12 @@ export const checkRedisForResults = async (
randomTestId: string,
expectedCallCount: number,
expectedResult: string,
retryOverride?: number
) => {
const key = getRedisKey("result", route, randomTestId)
let testResult: RedisResult | null = null

for (let i=1; i<=RETRY_COUNT; i++) {
for (let i=1; i<= (retryOverride ?? RETRY_COUNT); i++) {
testResult = await redis.get<RedisResult>(key)
if (testResult) {
break
Expand Down
13 changes: 0 additions & 13 deletions examples/ci/test.ts

This file was deleted.

0 comments on commit c244d13

Please sign in to comment.