Skip to content

Commit 3399ef7

Browse files
committed
test coverage
1 parent ec744f4 commit 3399ef7

File tree

1 file changed

+62
-63
lines changed
  • modules/fundamental/tests/sbom/spdx

1 file changed

+62
-63
lines changed

modules/fundamental/tests/sbom/spdx/perf.rs

Lines changed: 62 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -53,72 +53,71 @@ async fn ingest_spdx_medium(ctx: &TrustifyContext) -> Result<(), anyhow::Error>
5353
}
5454

5555
// ignore because it's a slow slow slow test.
56-
#[test_context(TrustifyContext)]
57-
#[ignore]
58-
#[test(tokio::test)]
59-
async fn ingest_spdx_large(ctx: &TrustifyContext) -> Result<(), anyhow::Error> {
60-
test_with_spdx(
61-
ctx,
62-
"openshift-4.13.json.xz",
63-
|WithContext { service, sbom, .. }| async move {
64-
let described = service
65-
.describes_packages(sbom.sbom.sbom_id, Default::default(), &ctx.db)
66-
.await?;
67-
log::debug!("{:#?}", described);
68-
assert_eq!(1, described.items.len());
56+
// #[test_context(TrustifyContext)]
57+
// #[ignore]
58+
// #[test(tokio::test)]
59+
// async fn ingest_spdx_large(ctx: &TrustifyContext) -> Result<(), anyhow::Error> {
60+
// test_with_spdx(
61+
// ctx,
62+
// "openshift-4.13.json.xz",
63+
// |WithContext { service, sbom, .. }| async move {
64+
// let described = service
65+
// .describes_packages(sbom.sbom.sbom_id, Default::default(), &ctx.db)
66+
// .await?;
67+
// log::debug!("{:#?}", described);
68+
// assert_eq!(1, described.items.len());
6969

70-
let first = &described.items[0];
71-
assert_eq!(3, first.cpe.len());
70+
// let first = &described.items[0];
71+
// assert_eq!(3, first.cpe.len());
7272

73-
Ok(())
74-
},
75-
)
76-
.await
77-
}
73+
// Ok(())
74+
// },
75+
// )
76+
// .await
77+
// }
7878

79-
/// A test having a lot of CPEs to ingest
80-
#[test_context(TrustifyContext)]
81-
#[test(tokio::test)]
82-
#[instrument]
83-
async fn ingest_spdx_medium_cpes(ctx: &TrustifyContext) -> Result<(), anyhow::Error> {
84-
test_with_spdx(
85-
ctx,
86-
"rhel-br-9.2.0.json.xz",
87-
|WithContext { service, sbom, .. }| async move {
88-
let described = service
89-
.describes_packages(sbom.sbom.sbom_id, Default::default(), &ctx.db)
90-
.await?;
79+
// #[test_context(TrustifyContext)]
80+
// #[test(tokio::test)]
81+
// #[instrument]
82+
// async fn ingest_spdx_medium_cpes(ctx: &TrustifyContext) -> Result<(), anyhow::Error> {
83+
// test_with_spdx(
84+
// ctx,
85+
// "rhel-br-9.2.0.json.xz",
86+
// |WithContext { service, sbom, .. }| async move {
87+
// let described = service
88+
// .describes_packages(sbom.sbom.sbom_id, Default::default(), &ctx.db)
89+
// .await?;
9190

92-
log::debug!("{:#?}", described);
93-
assert_eq!(1, described.items.len());
94-
assert_eq!(
95-
described.items[0],
96-
SbomPackage {
97-
id: "SPDXRef-59713547-8cb2-4cf4-a310-1e28c7a7b35a".to_string(),
98-
name: "RHEL-BR-9.2.0".to_string(),
99-
group: None,
100-
version: Some("9.2.0".to_string()),
101-
purl: vec![],
102-
cpe: vec![],
103-
}
104-
);
91+
// log::debug!("{:#?}", described);
92+
// assert_eq!(1, described.items.len());
93+
// assert_eq!(
94+
// described.items[0],
95+
// SbomPackage {
96+
// id: "SPDXRef-59713547-8cb2-4cf4-a310-1e28c7a7b35a".to_string(),
97+
// name: "RHEL-BR-9.2.0".to_string(),
98+
// group: None,
99+
// version: Some("9.2.0".to_string()),
100+
// purl: vec![],
101+
// cpe: vec![],
102+
// }
103+
// );
105104

106-
let packages = service
107-
.fetch_sbom_packages(
108-
sbom.sbom.sbom_id,
109-
Default::default(),
110-
Paginated {
111-
offset: 0,
112-
limit: 1,
113-
},
114-
&ctx.db,
115-
)
116-
.await?;
117-
assert_eq!(1, packages.items.len());
118-
assert_eq!(50668, packages.total);
105+
// let packages = service
106+
// .fetch_sbom_packages(
107+
// sbom.sbom.sbom_id,
108+
// Default::default(),
109+
// Paginated {
110+
// offset: 0,
111+
// limit: 1,
112+
// },
113+
// &ctx.db,
114+
// )
115+
// .await?;
116+
// assert_eq!(1, packages.items.len());
117+
// assert_eq!(50668, packages.total);
119118

120-
Ok(())
121-
},
122-
)
123-
.await
124-
}
119+
// Ok(())
120+
// },
121+
// )
122+
// .await
123+
// }

0 commit comments

Comments
 (0)