Skip to content

Commit

Permalink
delete zip file (AST-40077)
Browse files Browse the repository at this point in the history
  • Loading branch information
miryamfoiferCX committed Nov 18, 2024
1 parent b86e671 commit 90c92d4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
4 changes: 2 additions & 2 deletions cxAstScan/services/CleanUpRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ export class CleanUpRunner {
}

extractZipFilePath(data: string): string | null {
const zipFilePattern = /Temporary zip file path:\s*(.+)$/;
const zipFilePattern = /Temporary zip file path:\s*(.*)$/m;
const match = data.match(zipFilePattern);
return match ? match[1] : null;
return match ? match[1].trim() : null;
}
}
6 changes: 6 additions & 0 deletions cxAstScan/test/_suite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ describe('Task runner test', function () {
assert.strictEqual(tr.stdout.indexOf('Pipeline not cancelled, nothing to do.') >= 0,
true,
"should display cleanup message: Pipeline not cancelled, nothing to do.");
assert.strictEqual(tr.stdout.indexOf('Deleted zip file') >= 0 || tr.stdout.indexOf('Zip file already deleted.') >= 0,
true,
"should display cleanup message: Deleted zip file or Zip file already deleted.");
});

it('should be success cancel scan', async function () {
Expand All @@ -92,6 +95,9 @@ describe('Task runner test', function () {
assert.strictEqual(tr.stdout.indexOf('Canceling scan with ID') >= 0,
true,
"should display cleanup message: Canceling scan with ID");
assert.strictEqual(tr.stdout.indexOf('Deleted zip file') >= 0 || tr.stdout.indexOf('Zip file already deleted.') >= 0,
true,
"should display cleanup message: Deleted zip file or Zip file already deleted.");
});

it('should be success cancel before scan start', async function () {
Expand Down
7 changes: 4 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 90c92d4

Please sign in to comment.