From 926e6dfee5cc6265bc082ec3d086c0c14515f756 Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Wed, 11 Mar 2026 20:16:47 +0000 Subject: [PATCH] Stub RUNNER_NAME in unit tests --- src/config-utils.test.ts | 8 ++++++++ src/testing-utils.ts | 1 + 2 files changed, 9 insertions(+) diff --git a/src/config-utils.test.ts b/src/config-utils.test.ts index 245667fee..fa4cb0cc2 100644 --- a/src/config-utils.test.ts +++ b/src/config-utils.test.ts @@ -144,6 +144,8 @@ test.serial("load empty config", async (t) => { const logger = getRunnerLogger(true); const languages = "javascript,python"; + setupActionsVars(tempDir, tempDir); + const codeql = createStubCodeQL({ async betterResolveLanguages() { return { @@ -185,6 +187,8 @@ test.serial("load code quality config", async (t) => { const logger = getRunnerLogger(true); const languages = "actions"; + setupActionsVars(tempDir, tempDir); + const codeql = createStubCodeQL({ async betterResolveLanguages() { return { @@ -237,6 +241,8 @@ test.serial( const logger = getRunnerLogger(true); const languages = "javascript"; + setupActionsVars(tempDir, tempDir); + const codeql = createStubCodeQL({ async betterResolveLanguages() { return { @@ -475,6 +481,8 @@ test.serial("load non-existent input", async (t) => { test.serial("load non-empty input", async (t) => { return await withTmpDir(async (tempDir) => { + setupActionsVars(tempDir, tempDir); + const codeql = createStubCodeQL({ async betterResolveLanguages() { return { diff --git a/src/testing-utils.ts b/src/testing-utils.ts index 8a7cf8e2d..4c61f94b1 100644 --- a/src/testing-utils.ts +++ b/src/testing-utils.ts @@ -156,6 +156,7 @@ export const DEFAULT_ACTIONS_VARS = { GITHUB_SERVER_URL: "https://github.com", GITHUB_SHA: "0".repeat(40), GITHUB_WORKFLOW: "test-workflow", + RUNNER_NAME: "my-runner", RUNNER_OS: "Linux", } as const satisfies Record;