Skip to content

Commit 4a02b63

Browse files
committed
Add unit test for the benchmark_purls pipeline #1804
Signed-off-by: tdruez <[email protected]>
1 parent 29383f0 commit 4a02b63

File tree

6 files changed

+628
-3
lines changed

6 files changed

+628
-3
lines changed

docs/built-in-pipelines.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Analyse Docker Windows Image
4646
:members:
4747
:member-order: bysource
4848

49-
.. _analyze_benchmark_purls:
49+
.. _pipeline_benchmark_purls:
5050

5151
Benchmark Purls (addon)
5252
-----------------------

scanpipe/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,12 +1147,12 @@ def get_output_file_path(self, name, extension):
11471147
filename = f"{name}-{filename_now()}.{extension}"
11481148
return self.output_path / filename
11491149

1150-
def get_latest_output(self, filename):
1150+
def get_latest_output(self, filename, extension="json"):
11511151
"""
11521152
Return the latest output file with the "filename" prefix, for example
11531153
"scancode-<timestamp>.json".
11541154
"""
1155-
output_files = sorted(self.output_path.glob(f"*{filename}*.json"))
1155+
output_files = sorted(self.output_path.glob(f"*{filename}*.{extension}"))
11561156
if output_files:
11571157
return output_files[-1]
11581158

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
- pkg:alpine/[email protected]?arch=x86_64
2+
+ pkg:alpine/[email protected]?arch=x86_64
3+
+ pkg:deb/debian/[email protected]?arch=x86_64
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
pkg:alpine/[email protected]?arch=x86_64
2+
pkg:alpine/[email protected]?arch=x86_64
3+
pkg:deb/debian/[email protected]?arch=x86_64
4+
pkg:alpine/[email protected]?arch=x86_64
5+
pkg:alpine/[email protected]?arch=x86_64
6+
pkg:alpine/[email protected]?arch=x86_64
7+
pkg:alpine/[email protected]?arch=x86_64
8+
pkg:alpine/ca-certificates-bundle@20250619-r0?arch=x86_64
9+
pkg:alpine/[email protected]?arch=x86_64
10+
pkg:alpine/[email protected]?arch=x86_64
11+
pkg:alpine/[email protected]?arch=x86_64
12+
pkg:alpine/[email protected]?arch=x86_64
13+
pkg:alpine/[email protected]?arch=x86_64
14+
pkg:alpine/[email protected]?arch=x86_64
15+
pkg:alpine/[email protected]?arch=x86_64
16+
pkg:alpine/[email protected]?arch=x86_64
17+
pkg:alpine/[email protected]?arch=x86_64

0 commit comments

Comments
 (0)