forked from valkey-io/valkey-glide
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Node: Add CI support for server modules (valkey-io#2472)
* Node: add server modules CI support --------- Signed-off-by: TJ Zhang <[email protected]> Signed-off-by: Yury-Fridlyand <[email protected]> Signed-off-by: Chloe <[email protected]> Co-authored-by: TJ Zhang <[email protected]> Co-authored-by: Yury-Fridlyand <[email protected]> Co-authored-by: Chloe <[email protected]>
- Loading branch information
1 parent
ac51bb5
commit e98ad97
Showing
7 changed files
with
131 additions
and
24 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
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
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,60 @@ | ||
/** | ||
* Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0 | ||
*/ | ||
import { | ||
afterAll, | ||
afterEach, | ||
beforeAll, | ||
describe, | ||
expect, | ||
it, | ||
} from "@jest/globals"; | ||
import { GlideClusterClient, InfoOptions, ProtocolVersion } from ".."; | ||
import { ValkeyCluster } from "../../utils/TestUtils"; | ||
import { | ||
flushAndCloseClient, | ||
getClientConfigurationOption, | ||
getServerVersion, | ||
parseCommandLineArgs, | ||
parseEndpoints, | ||
} from "./TestUtilities"; | ||
|
||
const TIMEOUT = 50000; | ||
describe("GlideJson", () => { | ||
const testsFailed = 0; | ||
let cluster: ValkeyCluster; | ||
let client: GlideClusterClient; | ||
beforeAll(async () => { | ||
const clusterAddresses = parseCommandLineArgs()["cluster-endpoints"]; | ||
cluster = await ValkeyCluster.initFromExistingCluster( | ||
true, | ||
parseEndpoints(clusterAddresses), | ||
getServerVersion, | ||
); | ||
}, 20000); | ||
|
||
afterEach(async () => { | ||
await flushAndCloseClient(true, cluster.getAddresses(), client); | ||
}); | ||
|
||
afterAll(async () => { | ||
if (testsFailed === 0) { | ||
await cluster.close(); | ||
} | ||
}, TIMEOUT); | ||
|
||
it.each([ProtocolVersion.RESP2, ProtocolVersion.RESP3])( | ||
"ServerModules check modules loaded", | ||
async (protocol) => { | ||
client = await GlideClusterClient.createClient( | ||
getClientConfigurationOption(cluster.getAddresses(), protocol), | ||
); | ||
const info = await client.info({ | ||
sections: [InfoOptions.Modules], | ||
route: "randomNode", | ||
}); | ||
expect(info).toContain("# json_core_metrics"); | ||
expect(info).toContain("# search_index_stats"); | ||
}, | ||
); | ||
}); |
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