Stops the production upload when a pass fails
Each pass is now its own lftp session with a marker in the log, so a failed asset pass stops the script before any HTML goes up. The test checks those markers instead of lftp's output format. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -496,19 +496,17 @@ describe.skipIf(toolsMissing || lftpMissing)('upload-production.sh', () => {
|
||||
]);
|
||||
});
|
||||
|
||||
it('zet alle assets vóór de eerste HTML (FR-PR-18) en de web.config vóór de HTML', async () => {
|
||||
it('doet de rondes in volgorde en eindigt met de volledige boom (FR-PR-18)', async () => {
|
||||
const { dist, target } = await setup();
|
||||
const run = await upload(dist, target);
|
||||
expect(run.code).toBe(0);
|
||||
|
||||
const lines = run.stdout.split('\n');
|
||||
const at = (needle: string) =>
|
||||
lines.findIndex((line) => line.includes(needle));
|
||||
const firstHtml = lines.findIndex((line) => /\.html/.test(line));
|
||||
expect(at('assets/a.js')).toBeGreaterThanOrEqual(0);
|
||||
expect(at('assets/a.js')).toBeLessThan(firstHtml);
|
||||
expect(at('web.config')).toBeGreaterThanOrEqual(0);
|
||||
expect(at('web.config')).toBeLessThan(firstHtml);
|
||||
// De volgorde zelf volgt uit de rondes hierboven (na ronde 1 staat er
|
||||
// nog geen HTML); hier alleen dat het script ze in die volgorde doet
|
||||
const rounds = [...run.stdout.matchAll(/^== Ronde (d)/gm)].map(
|
||||
(match) => match[1],
|
||||
);
|
||||
expect(rounds).toEqual(['1', '2', '3']);
|
||||
|
||||
const expected = [...validFiles, 'web.config'].sort();
|
||||
expect(await tree(target)).toEqual(expected);
|
||||
|
||||
Reference in New Issue
Block a user