-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: scanStream TYPE test requires redis 6 (#1469)
See https://redis.io/commands/scan When this test fails in local development it stops the rest of the tests from running. Some OSes have redis 5 or older installed.
- Loading branch information
1 parent
b817747
commit d1ead14
Showing
2 changed files
with
24 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
const VERSION_REGEX = /\bredis_version:(\d+)\.(\d+)\.(\d+)/; | ||
|
||
export async function getRedisVersion(redis: Redis) { | ||
const raw = await redis.info("server"); | ||
const match = VERSION_REGEX.exec(raw); | ||
if (match) { | ||
return [match[1], match[2], match[3]]; | ||
} | ||
throw new Error( | ||
"Could not determine redis version from: " + JSON.stringify(raw) | ||
); | ||
} |