Skip to content

Commit 36d341b

Browse files
committed
Enable "impossible checks" tests for new solver
Although these tests are for exercising the "impossible checks" behavior in the og solver, it is still good to prove the new solver results in the same outcome. Signed-off-by: J Robert Ray <[email protected]>
1 parent 5a1750a commit 36d341b

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

crates/spk-solve/src/solver_test.rs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use spk_schema::ident::{
1919
RequestedBy,
2020
VarRequest,
2121
};
22-
use spk_schema::ident_build::{Build, BuildId, EmbeddedSource};
22+
use spk_schema::ident_build::{Build, BuildId};
2323
use spk_schema::prelude::*;
2424
use spk_schema::{recipe, v0};
2525
use spk_solve_macros::{make_build, make_build_and_components, make_package, make_repo, request};
@@ -202,8 +202,8 @@ async fn test_solver_package_with_no_recipe(
202202
}
203203

204204
#[rstest]
205-
// This test is only applicable to the og solver
206205
#[case::og(og_solver())]
206+
#[case::cdcl(cdcl_solver())]
207207
#[tokio::test]
208208
async fn test_solver_package_with_no_recipe_and_impossible_initial_checks(
209209
#[case] mut solver: SolverImpl,
@@ -292,8 +292,8 @@ async fn test_solver_package_with_no_recipe_from_cmd_line(#[case] mut solver: So
292292
}
293293

294294
#[rstest]
295-
// This test is only applicable to the og solver
296295
#[case::og(og_solver())]
296+
#[case::cdcl(cdcl_solver())]
297297
#[tokio::test]
298298
async fn test_solver_package_with_no_recipe_from_cmd_line_and_impossible_initial_checks(
299299
#[case] mut solver: SolverImpl,
@@ -1225,8 +1225,8 @@ async fn test_solver_build_from_source_deprecated(#[case] mut solver: SolverImpl
12251225
}
12261226

12271227
#[rstest]
1228-
// This test is only applicable to the og solver
12291228
#[case::og(og_solver())]
1229+
#[case::cdcl(cdcl_solver())]
12301230
#[tokio::test]
12311231
async fn test_solver_build_from_source_deprecated_and_impossible_initial_checks(
12321232
#[case] mut solver: SolverImpl,
@@ -1265,7 +1265,8 @@ async fn test_solver_build_from_source_deprecated_and_impossible_initial_checks(
12651265

12661266
let res = run_and_print_resolve_for_tests(&mut solver).await;
12671267
match res {
1268-
Err(Error::GraphError(spk_solve_graph::Error::FailedToResolve(_))) => {
1268+
Err(Error::GraphError(spk_solve_graph::Error::FailedToResolve(_)))
1269+
| Err(Error::FailedToResolve(_)) => {
12691270
// Success, when the 'migration-to-components' feature is
12701271
// enabled because: the initial checks for impossible
12711272
// requests pass because the :all component matches the
@@ -1464,8 +1465,8 @@ async fn test_solver_embedded_package_replaces_real_package(#[case] mut solver:
14641465
}
14651466

14661467
#[rstest]
1467-
// This test is only applicable to the og solver
14681468
#[case::og(og_solver())]
1469+
#[case::cdcl(cdcl_solver())]
14691470
#[tokio::test]
14701471
async fn test_solver_initial_request_impossible_masks_embedded_package_solution(
14711472
#[case] mut solver: SolverImpl,
@@ -1508,7 +1509,7 @@ async fn test_solver_initial_request_impossible_masks_embedded_package_solution(
15081509
assert_resolved!(
15091510
solution,
15101511
"qt",
1511-
build = Build::Embedded(EmbeddedSource::Unknown)
1512+
build =~ Build::Embedded(_)
15121513
);
15131514
}
15141515
Err(err) => {
@@ -1518,8 +1519,8 @@ async fn test_solver_initial_request_impossible_masks_embedded_package_solution(
15181519
}
15191520

15201521
#[rstest]
1521-
// This test is only applicable to the og solver
15221522
#[case::og(og_solver())]
1523+
#[case::cdcl(cdcl_solver())]
15231524
#[tokio::test]
15241525
async fn test_solver_impossible_request_but_embedded_package_makes_solvable(
15251526
#[case] mut solver: SolverImpl,
@@ -1590,7 +1591,7 @@ async fn test_solver_impossible_request_but_embedded_package_makes_solvable(
15901591
assert_resolved!(
15911592
solution,
15921593
"qt",
1593-
build = Build::Embedded(EmbeddedSource::Unknown)
1594+
build =~ Build::Embedded(_)
15941595
);
15951596
}
15961597
Err(err) => {
@@ -1664,8 +1665,8 @@ async fn test_multiple_packages_embed_same_package(
16641665
}
16651666

16661667
#[rstest]
1667-
// This test is only applicable to the og solver
16681668
#[case::og(og_solver())]
1669+
#[case::cdcl(cdcl_solver())]
16691670
#[tokio::test]
16701671
async fn test_solver_with_impossible_checks_in_build_keys(#[case] mut solver: SolverImpl) {
16711672
let options1 = option_map! {"dep" => "1.0.0"};

0 commit comments

Comments
 (0)