Skip to content

Commit

Permalink
ci: use Redis v7.4 (#451)
Browse files Browse the repository at this point in the history
  • Loading branch information
uki00a authored Oct 20, 2024
1 parent 41eac8c commit a1d51c0
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 26 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
redis: [6.2]
redis: [6.2, 7.4]
timeout-minutes: 15
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -53,6 +53,8 @@ jobs:
- name: Run tests
run: |
deno task test
env:
REDIS_VERSION: ${{ matrix.redis }}
- name: Run doc tests
run: |
deno task test:doc
Expand All @@ -65,7 +67,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
redis: [6.2]
redis: [7.4]
timeout-minutes: 15
steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"tasks": {
"lock": "rm deno.lock && DENO_FUTURE=1 deno cache --reload mod.ts experimental/**/mod.ts tests/**/*.ts",
"check:deno-json": "deno run --allow-read=deno.json tools/check_deno_json.js",
"test": "DENO_FUTURE=1 deno test --allow-net --allow-read=tests --allow-write=tests/tmp --allow-run=redis-server,redis-cli --coverage=coverage --trace-leaks --frozen-lockfile",
"test": "DENO_FUTURE=1 deno test --allow-net --allow-read=tests --allow-write=tests/tmp --allow-run=redis-server,redis-cli --allow-env=REDIS_VERSION --coverage=coverage --trace-leaks --frozen-lockfile",
"test:doc": "deno check --doc-only --import-map=import_map.test.json README.md experimental/cluster/README.md",
"coverage": "deno coverage ./coverage --lcov --output=coverage/lcov.info",
"make_mod": "deno run --allow-read --allow-write --allow-run=deno --check tools/make_mod.ts",
Expand Down
35 changes: 13 additions & 22 deletions tests/commands/acl.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { assertEquals } from "../../deps/std/assert.ts";
import {
assertArrayIncludes,
assertEquals,
assertStringIncludes,
} from "../../deps/std/assert.ts";
import { afterAll, beforeAll, describe, it } from "../../deps/std/testing.ts";
import type { Connector, TestServer } from "../test_util.ts";
import type { Redis } from "../../mod.ts";
Expand All @@ -23,32 +27,27 @@ export function aclTests(

describe("list", () => {
it("returns the ACL rules", async () => {
assertEquals(await client.aclList(), [
"user default on nopass ~* &* +@all",
]);
const rules = await client.aclList();
assertStringIncludes(rules[0], "user default on nopass");
assertEquals(rules.length, 1);
});
});

describe("getuser", () => {
it("returns the user's ACL flags", async () => {
assertEquals(await client.aclGetUser("default"), [
const flags = await client.aclGetUser("default");
assertArrayIncludes(flags, [
"flags",
["on", "allkeys", "allchannels", "allcommands", "nopass"],
"passwords",
[],
"commands",
"+@all",
"keys",
["*"],
"channels",
["*"],
]);
});
});

describe("cat", () => {
it("returns the available ACL categories if no arguments are given", async () => {
assertEquals(
assertArrayIncludes(
(await client.aclCat()).sort(),
[
"keyspace",
Expand Down Expand Up @@ -77,23 +76,19 @@ export function aclTests(
});

it("returns the commands in the specified category", async () => {
assertEquals(
assertArrayIncludes(
(await client.aclCat("dangerous")).sort(),
[
"lastsave",
"shutdown",
"module",
"monitor",
"role",
"client",
"replconf",
"config",
"pfselftest",
"save",
"replicaof",
"restore-asking",
"restore",
"latency",
"swapdb",
"slaveof",
"bgsave",
Expand All @@ -106,13 +101,9 @@ export function aclTests(
"pfdebug",
"flushall",
"failover",
"cluster",
"info",
"migrate",
"acl",
"sort",
"slowlog",
].sort(),
],
);
});
});
Expand Down
5 changes: 4 additions & 1 deletion tests/commands/string.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,10 @@ export function stringTests(
assertEquals(v, "Hello, Redis!");
});

it("stralgo", async () => {
it("stralgo", {
// NOTE(#454): STRALGO has been dropped
ignore: !Deno.env.get("REDIS_VERSION")?.startsWith("6."),
}, async () => {
await client.set("a", "Hello");
await client.set("b", "Deno!");
const matches = [
Expand Down

0 comments on commit a1d51c0

Please sign in to comment.