-
Notifications
You must be signed in to change notification settings - Fork 55
Expand file tree
/
Copy pathgenerate_ssdlc_report_test.py
More file actions
executable file
·59 lines (51 loc) · 2.49 KB
/
Copy pathgenerate_ssdlc_report_test.py
File metadata and controls
executable file
·59 lines (51 loc) · 2.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
"""
This file tests the SSDLC generation report. This file assumes it's been called from the project root
"""
import json
import os
from typing import Dict
import generate_ssdlc_report
def get_release() -> Dict:
with open("release.json") as release:
return json.load(release)
def test_report_generation():
# Given
release = get_release()
current_version = release["mongodbOperator"]
current_directory = os.getcwd()
# When
# We ignore Augmented SBOM download errors for this test as we quite often have a few days in transition state.
# For example, when we release a new Ops Manager or Agent image, we upload the corresponding SBOM Lite
# on d+1. Then on d+2 we have the Augmented SBOM available for download. This situation is perfectly normal
# but causes this test to fail. Therefore, we ignore these errors here.
generate_ssdlc_report.generate_ssdlc_report(ignore_sbom_download_errors=True)
# Then
assert os.path.exists(f"{current_directory}/ssdlc-report/MCK-{current_version}")
assert os.path.exists(f"{current_directory}/ssdlc-report/MCK-{current_version}/Containerized MongoDB Agent")
assert os.listdir(f"{current_directory}/ssdlc-report/MCK-{current_version}/Containerized MongoDB Agent") != []
assert os.path.exists(
f"{current_directory}/ssdlc-report/MCK-{current_version}/Containerized MongoDB Enterprise OpsManager"
)
assert (
os.listdir(
f"{current_directory}/ssdlc-report/MCK-{current_version}/Containerized MongoDB Enterprise OpsManager"
)
!= []
)
if os.path.exists(f"{current_directory}/ssdlc-report/MCK-{current_version}/MongoDB Controllers for Kubernetes"):
assert (
os.listdir(f"{current_directory}/ssdlc-report/MCK-{current_version}/MongoDB Controllers for Kubernetes")
!= []
)
assert os.path.exists(
f"{current_directory}/ssdlc-report/MCK-{current_version}/SSDLC Containerized MongoDB Agent {current_version}.md"
)
assert os.path.exists(
f"{current_directory}/ssdlc-report/MCK-{current_version}/SSDLC Containerized MongoDB Controllers for Kubernetes {current_version}.md"
)
assert os.path.exists(
f"{current_directory}/ssdlc-report/MCK-{current_version}/SSDLC Containerized MongoDB Enterprise OpsManager {current_version}.md"
)
assert os.path.exists(
f"{current_directory}/ssdlc-report/MCK-{current_version}/SSDLC MongoDB Controllers for Kubernetes Testing Report {current_version}.md"
)