Skip to content

Commit bc7db77

Browse files
committed
Applied CI-recommended fixes.
Signed-off-by: Vilem Obratil <[email protected]>
1 parent 4832654 commit bc7db77

File tree

3 files changed

+8
-15
lines changed

3 files changed

+8
-15
lines changed

e2e/tests/api/features/performance.ts

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,33 +44,27 @@ test.beforeEach(async ({ axios }) => {
4444
logger.info(`Uploaded ${sbomIds.length} SBOMs.`);
4545
});
4646

47-
test.skip("@performance Delete / Increasing amount", async ({ axios }) => {});
48-
4947
test.skip("@performance Delete / All / Sequential", async ({ axios }) => {
5048
const currentTimeStamp = Date.now();
5149
const reportFile = `${REPORT_FILE_PREFIX}sequential-${currentTimeStamp}.csv`;
5250
var index = 1;
5351

52+
var duration = "";
53+
5454
writeRequestDurationToFile(reportFile, "No.", "SBOM ID", "Duration [ms]");
5555

5656
for (const sbomId of sbomIds) {
57-
var duration = undefined;
58-
5957
try {
6058
await axios.delete(`/api/v2/sbom/${sbomId}`).then((response) => {
61-
duration = response.duration;
59+
duration = String(response.duration);
6260
});
6361
} catch (error) {
6462
logger.error(`SBOM with ID ${sbomId} could not be deleted.`, error);
6563
duration = "n/a";
6664
}
6765

68-
writeRequestDurationToFile(
69-
reportFile,
70-
String(index),
71-
sbomId,
72-
String(duration),
73-
);
66+
writeRequestDurationToFile(reportFile, String(index), sbomId, duration);
67+
duration = "";
7468
index++;
7569
}
7670
});

e2e/tests/api/helpers/delete.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export async function deleteSboms(axios: AxiosInstance, sbomIds: string[]) {
99
try {
1010
await axios.get(`/api/v2/sbom/${sbomId}`);
1111
existingSbomIds.push(sbomId);
12-
} catch (error) {
12+
} catch (_error) {
1313
logger.info(`SBOM with ID ${sbomId} does not exist anymore. Skipping.`);
1414
}
1515
}

e2e/tests/api/helpers/report.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,9 @@ export function writeRequestDurationToFile(
1010
const line = `${sbomNumber},${sbomId},${duration}`;
1111

1212
try {
13-
fs.appendFileSync(`${REPORT_DIR}${fileName}`, line + "\n");
14-
// fs.appendFileSync(`${REPORT_DIR}${fileName}`, line + '\n');
13+
fs.appendFileSync(`${REPORT_DIR}${fileName}`, `${line}\n`);
1514
logger.debug(line);
16-
} catch (error: any) {
15+
} catch (error) {
1716
logger.error(`Error writing the request duration to file: ${error}`);
1817
throw error;
1918
}

0 commit comments

Comments
 (0)