Skip to content

Commit

Permalink
test: adds failing apache-airflow test (#10)
Browse files Browse the repository at this point in the history
Relates to prefix-dev/rip#75

---------

Co-authored-by: Bas Zalmstra <[email protected]>
  • Loading branch information
sumanth-manchala and baszalmstra authored Jan 10, 2024
1 parent c57a945 commit 49e7411
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ serde = { version = "1.0", features = ["derive"], optional = true }
insta = "1.31.0"
indexmap = "2.0.0"
proptest = "1.2.0"
tracing-test = "0.2.4"
tracing-test = { version = "0.2.4", features = ["no-env-filter"] }
37 changes: 37 additions & 0 deletions tests/solver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,43 @@ fn test_resolve_with_nonexisting() {
assert_eq!(solvable.inner().0, 3);
}

#[test]
#[traced_test]
#[should_panic] // TODO: Should be fixed, https://github.com/prefix-dev/rip/issues/75
fn test_resolve_with_nested_deps() {
let provider = BundleBoxProvider::from_packages(&[
(
"apache-airflow",
3,
vec!["opentelemetry-api 2..4", "opentelemetry-exporter-otlp"],
),
(
"apache-airflow",
2,
vec!["opentelemetry-api 2..4", "opentelemetry-exporter-otlp"],
),
("apache-airflow", 1, vec![]),
("opentelemetry-api", 3, vec!["opentelemetry-sdk"]),
("opentelemetry-api", 2, vec![]),
("opentelemetry-api", 1, vec![]),
("opentelemetry-exporter-otlp", 1, vec!["opentelemetry-grpc"]),
("opentelemetry-grpc", 1, vec!["opentelemetry-api 1"]),
]);
let requirements = provider.requirements(&["apache-airflow"]);
let mut solver = Solver::new(provider);
let solved = solver.solve(requirements).unwrap();

assert_eq!(solved.len(), 1);

let solvable = solver.pool().resolve_solvable(solved[0]);

assert_eq!(
solver.pool().resolve_package_name(solvable.name_id()),
"apache-airflow"
);
assert_eq!(solvable.inner().0, 1);
}

/// Locking a specific package version in this case a lower version namely `3` should result
/// in the higher package not being considered
#[test]
Expand Down

0 comments on commit 49e7411

Please sign in to comment.