commit compras2 2811
tests / ci (push) Waiting to run

This commit is contained in:
2026-11-28 15:45:52 +02:00
parent eb32c74c56
commit 060c119ba1
92 changed files with 4936 additions and 43 deletions
+20 -5
View File
@@ -117,10 +117,11 @@ try {
}
const raceOnly = process.argv.includes('--race-only');
const recoveryOnly = process.argv.includes('--recovery-only');
const nativeAuditSchemaOnly = process.argv.includes('--audit-schema-only');
const nativeFixtureOnly = process.argv.includes('--native-review-fixture-only');
const nativeHttpOnly = process.argv.includes('--native-review-http-only');
const nativeOfficeOnly = process.argv.includes('--native-office-http-only');
const nativeReview = process.argv.includes('--native-review') || nativeFixtureOnly || nativeHttpOnly || nativeOfficeOnly;
const nativeReview = process.argv.includes('--native-review') || nativeFixtureOnly || nativeHttpOnly || nativeOfficeOnly || nativeAuditSchemaOnly;
const setupOnly = raceOnly || recoveryOnly || nativeReview;
const args = setupOnly ? ['artisan', 'migrate', '--force', '--no-interaction'] : process.argv.includes('--integrated-release-journeys') ? ['vendor/bin/pest', '--compact', 'tests/Feature/RequisitionLedgerAccountsTest.php', 'tests/Feature/RequisitionBudgetCyclesTest.php', 'tests/Feature/PurchaseAwardOrderTest.php', 'tests/Feature/ImportLandedCostsTest.php', '--filter=RequisitionBudgetCyclesTest|ImportLandedCostsTest|native office purchase|native partial-order|native consolidated order|native delivery analysis'] : process.argv.includes('--integrated-import-costs-only') ? ['vendor/bin/pest', '--compact', 'tests/Feature/ImportLandedCostsTest.php'] : process.argv.includes('--integrated-orders-only') ? ['vendor/bin/pest', '--compact', 'tests/Feature/PurchaseAwardOrderTest.php', '--filter=native partial-order|native consolidated order|native delivery analysis'] : process.argv.includes('--integrated-cycles-only') ? ['vendor/bin/pest', '--compact', 'tests/Feature/RequisitionBudgetCyclesTest.php'] : process.argv.includes('--office-process-only') ? ['vendor/bin/pest', '--compact', 'tests/Feature/RequisitionLedgerAccountsTest.php', '--filter=native office purchase'] : ['vendor/bin/pest', '--compact', 'tests/Feature/RequisitionLedgerAccountsTest.php', 'tests/Feature/PurchaseAwardOrderTest.php',
'--filter=minimal purchasing catalogue|chart references reject|native line account assignment|classified line requires|native submission requires account|zero monetary line retains|native order preserves common ledger|native office purchase'];
@@ -190,15 +191,29 @@ try {
if (seed.status !== 0) throw Error('Native review fixture failed: '+(seed.stderr || seed.stdout || '').replaceAll(password, '[private]'));
const fixture = JSON.parse(seed.stdout);
fs.writeFileSync(path.join(root, 'native-review.json'), JSON.stringify(fixture));
const assets = path.join(privateParent, 'sgc-company-preparation-final-qa-20261128');
const assets = path.join(privateParent, 'sgc-private-audit-help-qa-20261128');
const manifest = fs.readFileSync(path.join(assets, 'manifest.json'));
const manifestHash = crypto.createHash('sha256').update(manifest).digest('hex');
if (manifestHash !== 'df4e07d422af16897581371283d9730f41076ad2888d1e4911bdd7cadbb92c5f') throw Error('Unexpected private review manifest');
if (manifestHash !== 'fa87e37a3626ef75d22b5248dce9a0af2bad68c967e6f99bb64bc426a68f6aaf') throw Error('Unexpected private review manifest');
for (const entry of Object.values(JSON.parse(manifest))) {
if (!fs.existsSync(path.join(assets, entry.file))) throw Error('Private review asset missing');
}
fs.cpSync(assets, path.join(root, 'public/build'), { recursive: true });
if (nativeFixtureOnly) {
if (nativeAuditSchemaOnly) {
if (!frozenRuntime || !process.argv.includes('--integrated-schema')) throw Error('Audit schema inventory requires the pinned private composition');
const schema = spawnSync('php', ['tests/Concurrency/requisition-account-worker.php', database, 'describe-private-audit-schema'], {
cwd: workspace, windowsHide: true, encoding: 'utf8', maxBuffer: 4 * 1024 * 1024,
env: { ...environment, SGC_REQUISITION_QA_ROOT: root },
});
if (schema.status !== 0) throw Error('Private audit schema inventory failed');
const inventory = JSON.parse(schema.stdout);
if (inventory.schema_only !== true || inventory.no_business_values !== true) throw Error('Schema-only contract refused');
const target = path.join(privateParent, 'private-audit-source-schema-20261128.json');
const bytes = JSON.stringify(inventory, null, 2)+'\n';
if (fs.existsSync(target) && fs.readFileSync(target, 'utf8') !== bytes) throw Error('Preserve the previous private schema inventory before replacing it');
fs.writeFileSync(target, bytes);
console.log(JSON.stringify({ private_audit_schema_inventory: true, tables: Object.keys(inventory.tables).length, business_values_exported: false, target }));
} else if (nativeFixtureOnly) {
console.log(JSON.stringify({ private_native_fixture_verified: true, ...fixture, private_manifest_sha256: manifestHash }));
} else {
const port = await new Promise((resolve, reject) => {
@@ -243,7 +258,7 @@ try {
console.log(JSON.stringify({ private_native_office_http_verified: true, ...result, private_manifest_sha256: manifestHash }));
} else if (nativeHttpOnly) {
const { verifyNativeReviewHttp } = await import('./requisition-native-http-check.mjs');
const pageAssets = ['resources/js/pages/supply/index.tsx', 'resources/js/pages/purchase-controls/index.tsx', 'resources/js/pages/purchase-controls/orders.tsx', 'resources/js/pages/budgets/index.tsx', 'resources/js/pages/conflicts/index.tsx', 'resources/js/pages/conflicts/show.tsx', 'resources/js/pages/payments/index.tsx', 'resources/js/pages/stock/index.tsx', 'resources/js/pages/stock/operations.tsx', 'resources/js/pages/stock/lots.tsx', 'resources/js/pages/stock/reversals.tsx', 'resources/js/pages/stock/dispositions.tsx', 'resources/js/pages/equipment/index.tsx', 'resources/js/pages/investment/index.tsx', 'resources/js/pages/company/parameters.tsx', 'resources/js/pages/company/index.tsx', 'resources/js/pages/company/setup.tsx']
const pageAssets = ['resources/js/pages/audit/private.tsx', 'resources/js/pages/supply/index.tsx', 'resources/js/pages/purchase-controls/index.tsx', 'resources/js/pages/purchase-controls/orders.tsx', 'resources/js/pages/budgets/index.tsx', 'resources/js/pages/conflicts/index.tsx', 'resources/js/pages/conflicts/show.tsx', 'resources/js/pages/payments/index.tsx', 'resources/js/pages/stock/index.tsx', 'resources/js/pages/stock/operations.tsx', 'resources/js/pages/stock/lots.tsx', 'resources/js/pages/stock/reversals.tsx', 'resources/js/pages/stock/dispositions.tsx', 'resources/js/pages/equipment/index.tsx', 'resources/js/pages/investment/index.tsx', 'resources/js/pages/company/parameters.tsx', 'resources/js/pages/company/index.tsx', 'resources/js/pages/company/setup.tsx', 'resources/js/pages/requisitions/operational-orders.tsx', 'resources/js/pages/requisitions/urgent-stock.tsx']
.map(key => JSON.parse(manifest)[key]);
const result = await verifyNativeReviewHttp(url, fixture, {
assets: pageAssets.map(entry => ({ file: entry.file, sha256: crypto.createHash('sha256').update(fs.readFileSync(path.join(assets, entry.file))).digest('hex') })),