From 277e07e88f71e49be5833e1b59e7acab503062c9 Mon Sep 17 00:00:00 2001 From: Suneha Bose Date: Wed, 4 Mar 2026 11:48:42 -0800 Subject: [PATCH] remove bundle intg test --- tests/bundle.integration.test.ts | 74 -------------------------------- 1 file changed, 74 deletions(-) delete mode 100644 tests/bundle.integration.test.ts diff --git a/tests/bundle.integration.test.ts b/tests/bundle.integration.test.ts deleted file mode 100644 index f2dcf4d..0000000 --- a/tests/bundle.integration.test.ts +++ /dev/null @@ -1,74 +0,0 @@ -import {afterEach, beforeAll, describe, expect, test} from 'vitest' -import {execFile} from 'child_process' -import {promisify} from 'util' -import {mkdtempSync, readFileSync, rmSync} from 'fs' -import path from 'path' -import os from 'os' - -const execFileAsync = promisify(execFile) - -const sampleKubeconfig = `apiVersion: v1 -clusters: - - cluster: - server: https://example.com - name: primary -contexts: - - context: - cluster: primary - namespace: default - user: developer - name: exp-scratch -current-context: exp-scratch -kind: Config -preferences: {} -users: - - name: developer - user: - username: exp - password: pass -` - -describe('Action bundle integration', () => { - beforeAll(async () => { - await execFileAsync('node', ['./scripts/build.mjs']) - }, 20000) - - const createdDirs: string[] = [] - - afterEach(() => { - while (createdDirs.length) { - const dir = createdDirs.pop() - if (dir) { - rmSync(dir, {recursive: true, force: true}) - } - } - }) - - test('bundle sets kubeconfig as workflow would', async () => { - const runnerTemp = mkdtempSync(path.join(os.tmpdir(), 'bundle-test-')) - createdDirs.push(runnerTemp) - - const env = { - ...process.env, - RUNNER_TEMP: runnerTemp, - GITHUB_ACTIONS: 'true', - 'INPUT_CLUSTER-TYPE': 'generic', - INPUT_METHOD: 'kubeconfig', - INPUT_KUBECONFIG: sampleKubeconfig, - INPUT_CONTEXT: 'exp-scratch' - } - - const {stdout} = await execFileAsync('node', ['lib/index.cjs'], { - env - }) - - const output = stdout?.toString() ?? '' - const match = output.match(/::set-env name=KUBECONFIG::(.+)/) - expect(match?.[1]).toBeTruthy() - const kubeconfigPath = match![1].trim() - const contents = JSON.parse(readFileSync(kubeconfigPath, 'utf-8')) - - expect(contents['current-context']).toBe('exp-scratch') - expect(contents.clusters[0].cluster.server).toBe('https://example.com') - }, 20000) -})