mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-11-29 23:37:41 +00:00
* fix(python): track attribute accesses Index constructor fields in both structure and class scope. Report known cross-language omissions consistently in context and upstream impact. Fixes #3794 * refactor(python): share field classification rules * fix(python): ignore replaced constructors * fix(python): extract fields from binding targets * fix: preserve Python field evidence (#3795) * ci: fix Windows launch and Python baselines Launch Vitest directly through Node so the native test subset avoids cmd.exe's command-length limit and preserves argument boundaries. Cover long lists, shell metacharacters, and child failures. Refresh the Python capture fingerprint for attribute reads and constructor fields. Receiver read drops increase from 31 to 34: two Path.parent reads and admin.site.urls in existing Django fixtures. Call drops remain 141; receiver-shape states and scaling budgets stay unchanged. Validation: 425 tests, typecheck, lint, and all three benchmark checks pass. Refs #3795 * test: disambiguate Python field cases Vitest truncates interpolated case names, making distinct import and pattern cases collide in the execution audit. Include the case index so each receipt has a unique identity. Validation: 420 tests passed. Reconciled all 31,481 CI test receipts after replacing the affected suite with its fresh result. --------- Co-authored-by: Gergo Magyar <gergomagyar0@gmail.com>
71 lines
2.7 KiB
TypeScript
71 lines
2.7 KiB
TypeScript
import { spawnSync } from 'node:child_process';
|
|
import { copyFileSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
|
|
import { tmpdir } from 'node:os';
|
|
import path from 'node:path';
|
|
import { expect, it } from 'vitest';
|
|
import { tsxLoaderUrl } from '../helpers/cli-entry.js';
|
|
|
|
it.each([0, 7])('delivers long argument lists intact and reports child status %i', (status) => {
|
|
const root = mkdtempSync(path.join(tmpdir(), 'gitnexus runner & '));
|
|
const files = Array.from(
|
|
{ length: 180 },
|
|
(_, index) => `test/unit/path with spaces & (meta)/${'x'.repeat(35)}-${index}.test.ts`,
|
|
);
|
|
expect(files.join(' ').length).toBeGreaterThan(8191);
|
|
try {
|
|
mkdirSync(path.join(root, 'scripts'), { recursive: true });
|
|
mkdirSync(path.join(root, 'node_modules/vitest'), { recursive: true });
|
|
writeFileSync(path.join(root, 'package.json'), '{"type":"module"}');
|
|
for (const script of ['run-cross-platform.ts', 'shard-arg.ts']) {
|
|
copyFileSync(
|
|
new URL(`../../scripts/${script}`, import.meta.url),
|
|
path.join(root, 'scripts', script),
|
|
);
|
|
}
|
|
writeFileSync(
|
|
path.join(root, 'scripts/cross-platform-tests.ts'),
|
|
`export const ALL_CROSS_PLATFORM = ${JSON.stringify(files)};`,
|
|
);
|
|
for (const file of files) {
|
|
const target = path.join(root, file);
|
|
mkdirSync(path.dirname(target), { recursive: true });
|
|
writeFileSync(target, '');
|
|
}
|
|
writeFileSync(
|
|
path.join(root, 'node_modules/vitest/vitest.mjs'),
|
|
`import { writeFileSync } from 'node:fs';
|
|
writeFileSync('received.json', JSON.stringify(process.argv.slice(2)));
|
|
process.exit(${status});`,
|
|
);
|
|
const result = spawnSync(
|
|
process.execPath,
|
|
[
|
|
'--import',
|
|
tsxLoaderUrl(),
|
|
path.join(root, 'scripts/run-cross-platform.ts'),
|
|
'--shard=3/11',
|
|
],
|
|
{
|
|
cwd: root,
|
|
encoding: 'utf8',
|
|
timeout: 30_000,
|
|
env: { ...process.env, GITNEXUS_TEST_REPORT: 'receipt.json', npm_config_offline: 'true' },
|
|
},
|
|
);
|
|
expect(result.error, result.stderr).toBeUndefined();
|
|
expect(result.status, result.stdout + result.stderr).toBe(status === 0 ? 0 : 1);
|
|
expect(JSON.parse(readFileSync(path.join(root, 'received.json'), 'utf8'))).toEqual([
|
|
'run',
|
|
...files,
|
|
'--shard=3/11',
|
|
'--reporter=default',
|
|
'--reporter=./scripts/execution-reporter.ts',
|
|
'--reporter=blob',
|
|
'--outputFile.json=receipt.json',
|
|
'--outputFile.blob=.vitest/blob/receipt.json',
|
|
]);
|
|
if (status !== 0) expect(result.stderr).toContain(`vitest exited abnormally: status=${status}`);
|
|
} finally {
|
|
rmSync(root, { recursive: true, force: true });
|
|
}
|
|
});
|