mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 21:00:44 +00:00
test(release): support convex npm telegram credentials
This commit is contained in:
42
test/scripts/npm-telegram-live.test.ts
Normal file
42
test/scripts/npm-telegram-live.test.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
import { readFileSync } from "node:fs";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { __testing } from "../../scripts/e2e/npm-telegram-live-runner.ts";
|
||||
|
||||
const DOCKER_SCRIPT_PATH = "scripts/e2e/npm-telegram-live-docker.sh";
|
||||
|
||||
describe("npm Telegram live Docker E2E", () => {
|
||||
it("supports npm-specific Convex credential aliases", () => {
|
||||
const script = readFileSync(DOCKER_SCRIPT_PATH, "utf8");
|
||||
|
||||
expect(script).toContain("OPENCLAW_NPM_TELEGRAM_CREDENTIAL_SOURCE");
|
||||
expect(script).toContain("OPENCLAW_NPM_TELEGRAM_CREDENTIAL_ROLE");
|
||||
expect(script).toContain('docker_env+=(-e OPENCLAW_QA_CREDENTIAL_SOURCE="$credential_source")');
|
||||
expect(script).toContain('docker_env+=(-e OPENCLAW_QA_CREDENTIAL_ROLE="$credential_role")');
|
||||
});
|
||||
|
||||
it("defaults CI runs to Convex when broker credentials are present", () => {
|
||||
const script = readFileSync(DOCKER_SCRIPT_PATH, "utf8");
|
||||
|
||||
expect(script).toContain(
|
||||
'if [ -n "${CI:-}" ] && [ -n "${OPENCLAW_QA_CONVEX_SITE_URL:-}" ]; then',
|
||||
);
|
||||
expect(script).toContain("OPENCLAW_QA_CONVEX_SECRET_CI");
|
||||
expect(script).toContain("OPENCLAW_QA_CONVEX_SECRET_MAINTAINER");
|
||||
expect(script).toContain('printf "convex"');
|
||||
});
|
||||
|
||||
it("lets npm-specific credential aliases override shared QA env", () => {
|
||||
expect(
|
||||
__testing.resolveCredentialSource({
|
||||
OPENCLAW_NPM_TELEGRAM_CREDENTIAL_SOURCE: "convex",
|
||||
OPENCLAW_QA_CREDENTIAL_SOURCE: "env",
|
||||
}),
|
||||
).toBe("convex");
|
||||
expect(
|
||||
__testing.resolveCredentialRole({
|
||||
OPENCLAW_NPM_TELEGRAM_CREDENTIAL_ROLE: "ci",
|
||||
OPENCLAW_QA_CREDENTIAL_ROLE: "maintainer",
|
||||
}),
|
||||
).toBe("ci");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user