From ef71901a8485df926a657a5061195bc293ced5ab Mon Sep 17 00:00:00 2001 From: haelyra <49814733+haelyra@users.noreply.github.com> Date: Mon, 16 Nov 2026 16:16:57 -0500 Subject: [PATCH] test(ci): make discovery and private Git fixtures portable --- tests/ci/glob-coverage-discovery.test.js | 8 +++++--- tests/docker/gateguard-intent.test.js | 11 ++++++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/tests/ci/glob-coverage-discovery.test.js b/tests/ci/glob-coverage-discovery.test.js index eab1b1171..3a3b71ffb 100644 --- a/tests/ci/glob-coverage-discovery.test.js +++ b/tests/ci/glob-coverage-discovery.test.js @@ -42,11 +42,13 @@ function coverageEnvironment() { function checkDiscovery(root) { for (const engine of [glob, rawGlob]) { - assert.deepEqual(engine.globSync('scripts/alpha.js', { cwd: root }), ['scripts/alpha.js']); - assert.deepEqual(engine.globSync('scripts/**/*.js', { cwd: root }).sort(), [ + const discover = pattern => engine.globSync(pattern, { cwd: root }) + .map(name => name.split(path.sep).join('/')).sort(); + assert.deepEqual(discover('scripts/alpha.js'), ['scripts/alpha.js']); + assert.deepEqual(discover('scripts/**/*.js'), [ 'scripts/alpha.js', 'scripts/never.js', 'scripts/skip.test.js', ]); - assert.deepEqual(engine.globSync('scripts/**/*.mjs', { cwd: root }), ['scripts/nested/beta.mjs']); + assert.deepEqual(discover('scripts/**/*.mjs'), ['scripts/nested/beta.mjs']); } } diff --git a/tests/docker/gateguard-intent.test.js b/tests/docker/gateguard-intent.test.js index 54b74e784..07e48f2ac 100644 --- a/tests/docker/gateguard-intent.test.js +++ b/tests/docker/gateguard-intent.test.js @@ -621,9 +621,14 @@ function syntheticIntentRunner(root, { fakeEnv = {}, arms = 'off,gate' } = {}) { const env = { ...process.env, HOME: path.join(root, 'home'), USERPROFILE: path.join(root, 'home'), CLAUDE_CONFIG_DIR: config, CLAUDE_CODE_PROJECT_DIR_NAME: '', NODE_PATH: path.join(ROOT, 'node_modules'), GIT_CONFIG_GLOBAL: path.join(root, 'unused-gitconfig'), GIT_AUTHOR_NAME: 'Synthetic Eval', GIT_COMMITTER_NAME: 'Synthetic Eval', GIT_AUTHOR_EMAIL: 'eval@example.invalid', GIT_COMMITTER_EMAIL: 'eval@example.invalid' }; - for (const args of [['init', '-q'], ['add', '.'], ['commit', '-q', '--no-gpg-sign', '-m', 'synthetic source snapshot']]) { - const result = spawnSync('git', args, { cwd: repo, env, encoding: 'utf8', timeout: 30000 }); - assert.strictEqual(result.status, 0, result.stderr); + // Freeze the copied source bytes, independent of the host Git line-ending + // policy. The full scripts snapshot can take longer to stage on busy Windows + // runners; keep setup bounded at the same 60s limit as the harness Git calls. + for (const args of [['init', '-q'], ['config', 'core.autocrlf', 'false'], ['add', '.'], ['commit', '-q', '--no-gpg-sign', '-m', 'synthetic source snapshot']]) { + const result = spawnSync('git', args, { cwd: repo, env, encoding: 'utf8', timeout: 60000 }); + const diagnostic = `git ${args.join(' ')}: status=${result.status}, signal=${result.signal || 'none'}, error=${result.error?.code || 'none'}\n${result.error?.message || ''}\n${result.stderr || ''}`; + assert.strictEqual(result.error, undefined, diagnostic); + assert.strictEqual(result.status, 0, diagnostic); } const scenario = intentEval.loadIntentScenarios()[0]; const copiedReference = path.join(copied, 'scenarios-intent', scenario.id, 'reference');