Skip to content

Commit

Permalink
Fix continuation tests by setting depth=2
Browse files Browse the repository at this point in the history
Ideally we could test continuations without sync'ing history, but an
extra level doesn't seem to affect perf all that much.

Signed-off-by: Jim Crossley <[email protected]>
  • Loading branch information
jcrossley3 committed Aug 28, 2024
1 parent 31cc15f commit bdeddac
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions modules/importer/src/runner/clearly_defined/walker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,6 @@ mod test {
use crate::{model::DEFAULT_SOURCE_CLEARLY_DEFINED, runner::common::walker::git_reset};
use std::path::PathBuf;

/// test CVE walker, runs for a long time
#[ignore]
#[test_log::test(tokio::test)]
async fn test_walker() {
let path = PathBuf::from("target/test.data/test_clearly_defined_walker.git");
Expand All @@ -204,7 +202,7 @@ mod test {

let _cont = walker.run().await.expect("should not fail");

let cont = git_reset(&path, "HEAD~2").expect("must not fail");
let cont = git_reset(&path, "HEAD~1").expect("must not fail");

let walker = ClearlyDefinedWalker::new(DEFAULT_SOURCE_CLEARLY_DEFINED)
.continuation(cont)
Expand Down
2 changes: 1 addition & 1 deletion modules/importer/src/runner/common/walker/git.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ where
}

let mut fo = Self::create_fetch_options();
fo.depth(1);
fo.depth(2);
builder.fetch_options(fo).clone(&self.source, path)
});

Expand Down
2 changes: 1 addition & 1 deletion modules/importer/src/runner/cve/walker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ mod test {

let _cont = walker.run().await.expect("should not fail");

let cont = git_reset(&path, "HEAD~2").expect("must not fail");
let cont = git_reset(&path, "HEAD~1").expect("must not fail");

let walker = CveWalker::new(DEFAULT_SOURCE_CVEPROJECT)
.continuation(cont)
Expand Down
2 changes: 1 addition & 1 deletion modules/importer/src/runner/osv/walker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ mod test {

let _cont = walker.run().await.expect("should not fail");

let cont = git_reset(&path, "HEAD~2").expect("must not fail");
let cont = git_reset(&path, "HEAD~1").expect("must not fail");

let walker = OsvWalker::new(SOURCE)
.path(Some("vulns"))
Expand Down

0 comments on commit bdeddac

Please sign in to comment.