From cbf1132ce13e936db3245c41d5972584766a03f5 Mon Sep 17 00:00:00 2001 From: Noah Costello Date: Wed, 11 Oct 2023 14:30:18 -0400 Subject: [PATCH 1/2] Add try catch to delete project If the projects aren't successfully created, the scripts will still attempt to delete the project, causing the whole load test to fail. --- scripts/test/push-artifacts-to-different-projects.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/test/push-artifacts-to-different-projects.js b/scripts/test/push-artifacts-to-different-projects.js index fc4dd17..f2eb73c 100644 --- a/scripts/test/push-artifacts-to-different-projects.js +++ b/scripts/test/push-artifacts-to-different-projects.js @@ -63,7 +63,12 @@ export function teardown({ refs }) { for (const ref of refs) { const r = /([^/]+)\/([^:]+):(.*)/.exec(ref) - harbor.deleteArtifact(r[1], r[2], r[3]) + + try { + harbor.deleteArtifact(r[1], r[2], r[3]) + } catch (e) { + console.error(e.message) + } } } From 1c365c97317f8f6001010978f72fbef5354094c1 Mon Sep 17 00:00:00 2001 From: Noah Costello Date: Wed, 11 Oct 2023 14:30:56 -0400 Subject: [PATCH 2/2] fix error handling on push projects script --- scripts/test/push-artifacts-to-same-project.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/test/push-artifacts-to-same-project.js b/scripts/test/push-artifacts-to-same-project.js index 1771fef..b870e94 100644 --- a/scripts/test/push-artifacts-to-same-project.js +++ b/scripts/test/push-artifacts-to-same-project.js @@ -64,7 +64,12 @@ export function teardown({ refs }) { for (const ref of refs) { const r = /([^/]+)\/([^:]+):(.*)/.exec(ref) - harbor.deleteArtifact(r[1], r[2], r[3]) + + try { + harbor.deleteArtifact(r[1], r[2], r[3]) + } catch (e) { + console.error(e.message) + } } }