@@ -105,6 +105,27 @@ try {
|
||||
if (in_array('--requisition-cycles-focused', $argv, true)) {
|
||||
$commands = [[PHP_BINARY, 'vendor/bin/pest', '--compact', 'tests/Feature/RequisitionBudgetCyclesTest.php']];
|
||||
}
|
||||
if (in_array('--requisition-cycles-artifact', $argv, true)) {
|
||||
$artifact = json_decode(file_get_contents(base_path('docs/proofs/requisition-expiry-artifact.json')), true, 32, JSON_THROW_ON_ERROR);
|
||||
if (! preg_match('~^storage/framework/testing/requisition-cycles-qa-[a-f0-9]{16}$~D', $artifact['path'] ?? '')
|
||||
|| hash_file('sha256', base_path($artifact['path'].'/manifest.json')) !== $artifact['manifest_sha256']) {
|
||||
throw new LogicException('Invalid private cycle artifact manifest.');
|
||||
}
|
||||
$manifest = json_decode(file_get_contents(base_path($artifact['path'].'/manifest.json')), true, 32, JSON_THROW_ON_ERROR);
|
||||
if ($manifest['files'] !== $artifact['files'] || count($manifest['files']) !== 24) {
|
||||
throw new LogicException('Private cycle artifact inventory mismatch.');
|
||||
}
|
||||
foreach ($manifest['files'] as $name => $hash) {
|
||||
$resolved = realpath(base_path($artifact['path'].'/'.$name));
|
||||
$boundary = realpath(base_path($artifact['path']));
|
||||
if ($resolved === false || $boundary === false || ! str_starts_with($resolved, $boundary.DIRECTORY_SEPARATOR)
|
||||
|| is_link(base_path($artifact['path'].'/'.$name)) || hash_file('sha256', $resolved) !== $hash) {
|
||||
throw new LogicException('Private cycle artifact byte mismatch.');
|
||||
}
|
||||
}
|
||||
$environment['COMMON_BUDGET_PATH'] = base_path($artifact['path'].'/budget-control');
|
||||
$commands = [[PHP_BINARY, 'vendor/bin/pest', '--compact', 'tests/Feature/RequisitionBudgetCyclesTest.php']];
|
||||
}
|
||||
if (in_array('--requisition-cycles-regression', $argv, true)) {
|
||||
$commands = [[PHP_BINARY, 'vendor/bin/pest', '--compact', 'tests/Feature/RequisitionBudgetCyclesTest.php',
|
||||
'tests/Feature/InternalRequisitionCandidateTest.php', 'tests/Feature/BudgetTest.php']];
|
||||
@@ -116,6 +137,36 @@ try {
|
||||
$commands = [[PHP_BINARY, 'vendor/bin/pest', '--compact', 'tests/Feature/PurchaseAwardOrderTest.php',
|
||||
'--filter=award starts a new approval cycle|distributed approved synthetic|native partial-order issuance|native partial-order receipts|native consolidated order retains|native partial-order cancellation']];
|
||||
}
|
||||
if (in_array('--consolidated-report-focused', $argv, true)) {
|
||||
$commands = [[PHP_BINARY, 'vendor/bin/pest', '--compact', 'tests/Feature/PurchaseAwardOrderTest.php', 'tests/Feature/ProcurementPayableInsightsTest.php',
|
||||
'--filter=native consolidated order retains|financial insights|divergent native position|native imported history|payment period follows|read composition rejects']];
|
||||
}
|
||||
if (in_array('--contract-report-focused', $argv, true)) {
|
||||
$commands = [[PHP_BINARY, 'vendor/bin/pest', '--compact', 'tests/Feature/PurchaseAwardOrderTest.php', 'tests/Feature/ProcurementReportsTest.php',
|
||||
'--filter=per order global contract sums|award starts a new approval cycle|contract report preserves']];
|
||||
}
|
||||
if (in_array('--multi-order-review-focused', $argv, true)) {
|
||||
$commands = [[PHP_BINARY, 'vendor/bin/pest', '--compact', 'tests/Feature/PurchaseAwardOrderTest.php',
|
||||
'--filter=native partial-order receipts and independent invoice|native consolidated order retains']];
|
||||
}
|
||||
if (in_array('--delivery-analysis-focused', $argv, true)) {
|
||||
$commands = [[PHP_BINARY, 'vendor/bin/pest', '--compact', 'tests/Feature/PurchaseAwardOrderTest.php',
|
||||
'--filter=native delivery analysis|native consolidated order retains']];
|
||||
}
|
||||
if (in_array('--expense-allocation-focused', $argv, true)) {
|
||||
$commands = [[PHP_BINARY, 'vendor/bin/pest', '--compact', 'tests/Feature/ExpenseAllocationsTest.php', 'tests/Feature/ProcurementPayableInsightsTest.php']];
|
||||
}
|
||||
if (in_array('--expense-native-regression', $argv, true)) {
|
||||
$commands = [[PHP_BINARY, 'vendor/bin/pest', '--compact', 'tests/Feature/ReceiptFixtureConsistencyTest.php', 'tests/Feature/ReceiptStockTest.php', 'tests/Feature/InvoiceTest.php', 'tests/Feature/ExternalPaymentTest.php', 'tests/Feature/InventoryReversalsTest.php']];
|
||||
}
|
||||
if (in_array('--expense-allocation-concurrency', $argv, true)) {
|
||||
$commands = [[PHP_BINARY, 'tests/Concurrency/quotation-exchange-worker.php', $database, 'migrate'],
|
||||
[PHP_BINARY, 'tests/Concurrency/expense-allocation-worker.php', $database, 'race-expense']];
|
||||
}
|
||||
if (in_array('--expense-allocation-recovery', $argv, true)) {
|
||||
$commands = [[PHP_BINARY, 'tests/Concurrency/quotation-exchange-worker.php', $database, 'migrate'],
|
||||
[PHP_BINARY, 'tests/Concurrency/requisition-cycle-recovery-worker.php', $database, 'recover-expenses']];
|
||||
}
|
||||
if (in_array('--requisition-cycles-orders', $argv, true)) {
|
||||
$commands = [[PHP_BINARY, 'vendor/bin/pest', '--compact', 'tests/Feature/PurchaseAwardOrderTest.php',
|
||||
'--filter=native partial-order issuance commits only forty']];
|
||||
@@ -160,7 +211,7 @@ try {
|
||||
$commands = [[PHP_BINARY, 'tests/Concurrency/quotation-exchange-worker.php', $database, 'migrate'],
|
||||
[PHP_BINARY, 'tests/Concurrency/import-legal-corpus-worker.php', $database, 'corpus', substr($corpusArguments[0], strlen('--legal-corpus-root='))]];
|
||||
}
|
||||
if (in_array('--legal-http', $argv, true) || in_array('--legal-native-review', $argv, true)) {
|
||||
if (in_array('--legal-http', $argv, true) || in_array('--legal-native-review', $argv, true) || in_array('--expiry-native-review', $argv, true)) {
|
||||
$values = [];
|
||||
foreach (['--legal-corpus-root=', '--legal-http-candidate=', '--legal-http-manifest='] as $prefix) {
|
||||
$matches = array_values(array_filter($argv, fn ($value) => str_starts_with($value, $prefix)));
|
||||
@@ -170,7 +221,7 @@ try {
|
||||
$values[] = substr($matches[0], strlen($prefix));
|
||||
}
|
||||
$commands = [[PHP_BINARY, 'tests/Concurrency/quotation-exchange-worker.php', $database, 'migrate'],
|
||||
[PHP_BINARY, 'tests/Concurrency/import-legal-http-worker.php', $database, in_array('--legal-native-review', $argv, true) ? 'legal-review' : 'legal-http', ...$values]];
|
||||
[PHP_BINARY, 'tests/Concurrency/import-legal-http-worker.php', $database, in_array('--expiry-native-review', $argv, true) ? 'expiry-review' : (in_array('--legal-native-review', $argv, true) ? 'legal-review' : 'legal-http'), ...$values]];
|
||||
}
|
||||
if (in_array('--bank-support-native-only', $argv, true)) {
|
||||
$commands = [[PHP_BINARY, 'vendor/bin/pest', '--compact', 'tests/Feature/ImportBankSupportTest.php']];
|
||||
@@ -318,7 +369,7 @@ try {
|
||||
throw new LogicException('Each Pest kernel must use its own disposable PostgreSQL database.');
|
||||
}
|
||||
foreach ($commands as $command) {
|
||||
$nativeReview = ($command[3] ?? '') === 'legal-review';
|
||||
$nativeReview = in_array($command[3] ?? '', ['legal-review', 'expiry-review'], true);
|
||||
$process = new Process($command, dirname(__DIR__), $environment, timeout: $nativeReview ? 3660 : 180);
|
||||
$process->run($nativeReview ? function ($type, $buffer) {
|
||||
echo $buffer;
|
||||
|
||||
Reference in New Issue
Block a user