Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfv committed Feb 27, 2024
1 parent 14f3e85 commit a1d8480
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 5 deletions.
6 changes: 3 additions & 3 deletions crates/rattler_repodata_gateway/src/sparse/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ mod test {
.map(std::vec::Vec::len)
.sum::<usize>();

assert_eq!(total_records, 21731);
assert_eq!(total_records, 21732);
}

#[tokio::test]
Expand Down Expand Up @@ -494,7 +494,7 @@ mod test {
.map(std::vec::Vec::len)
.sum::<usize>();

assert_eq!(total_records, 16064);
assert_eq!(total_records, 16065);
}

#[test]
Expand All @@ -514,7 +514,7 @@ mod test {
.map(|repo| repo.conda_packages.len() + repo.packages.len())
.sum::<usize>();

assert_eq!(total_records, 367595);
assert_eq!(total_records, 367596);
}

#[rstest]
Expand Down
9 changes: 9 additions & 0 deletions crates/rattler_solve/tests/backends.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,15 @@ macro_rules! solver_backend_tests {
insta::assert_yaml_snapshot!(solve_real_world::<$T>(vec!["python=3.9"]));
}

#[test]
fn test_solve_python_numpy() {
insta::assert_yaml_snapshot!(solve_real_world::<$T>(vec![
"numpy==1.23.2",
"scipy==1.8.1",
"python=3.9.*"
]));
}

#[test]
fn test_solve_favored() {
let result = solve::<$T>(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
source: crates/rattler_solve/tests/backends.rs
expression: "solve_real_world::<rattler_solve::libsolv_c::Solver>(vec![\"numpy==1.23.2\",\n \"scipy==1.8.1\", \"python=3.9.*\"])"
---
- _libgcc_mutex 0.1 conda_forge
- _openmp_mutex 4.5 2_gnu
- bzip2 1.0.8 h7f98852_4
- ca-certificates 2022.6.15 ha878542_0
- ld_impl_linux-64 2.36.1 hea4e1c9_2
- libblas 3.9.0 16_linux64_openblas
- libcblas 3.9.0 16_linux64_openblas
- libffi 3.4.2 h7f98852_5
- libgcc-ng 12.1.0 h8d9b700_16
- libgfortran-ng 12.1.0 h69a702a_16
- libgfortran5 12.1.0 hdcd56e2_16
- libgomp 12.1.0 h8d9b700_16
- liblapack 3.9.0 16_linux64_openblas
- libnsl 2.0.0 h7f98852_0
- libopenblas 0.3.21 pthreads_h78a6416_1
- libsqlite 3.39.2 h753d276_1
- libstdcxx-ng 12.1.0 ha89aaad_16
- libuuid 2.32.1 h7f98852_1000
- libzlib 1.2.12 h166bdaf_2
- ncurses 6.3 h27087fc_1
- numpy 1.23.2 py39hba7629e_0
- openssl 3.0.5 h166bdaf_1
- python 3.9.13 h2660328_0_cpython
- python_abi 3.9 2_cp39
- readline 8.1.2 h0f457ee_0
- scipy 1.8.1 py39h8ba3f38_2
- sqlite 3.39.2 h4ff8645_1
- tk 8.6.12 h27826a3_0
- tzdata 2021e he74cb21_0
- xz 5.2.6 h166bdaf_0

Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
source: crates/rattler_solve/tests/backends.rs
expression: "solve_real_world::<rattler_solve::resolvo::Solver>(vec![\"numpy==1.23.2\",\n \"scipy==1.8.1\", \"python=3.9.*\"])"
---
- _libgcc_mutex 0.1 conda_forge
- _openmp_mutex 4.5 2_gnu
- bzip2 1.0.8 h7f98852_4
- ca-certificates 2022.6.15 ha878542_0
- ld_impl_linux-64 2.36.1 hea4e1c9_2
- libblas 3.9.0 16_linux64_openblas
- libcblas 3.9.0 16_linux64_openblas
- libffi 3.4.2 h7f98852_5
- libgcc-ng 12.1.0 h8d9b700_16
- libgfortran-ng 12.1.0 h69a702a_16
- libgfortran5 12.1.0 hdcd56e2_16
- libgomp 12.1.0 h8d9b700_16
- liblapack 3.9.0 16_linux64_openblas
- libnsl 2.0.0 h7f98852_0
- libopenblas 0.3.21 pthreads_h78a6416_1
- libsqlite 3.39.2 h753d276_1
- libstdcxx-ng 12.1.0 ha89aaad_16
- libuuid 2.32.1 h7f98852_1000
- libzlib 1.2.12 h166bdaf_2
- ncurses 6.3 h27087fc_1
- numpy 1.23.2 py39hba7629e_0
- openssl 3.0.5 h166bdaf_1
- python 3.9.13 h2660328_0_cpython
- python_abi 3.9 2_cp39
- readline 8.1.2 h0f457ee_0
- scipy 1.8.1 py39h8ba3f38_2
- sqlite 3.39.2 h4ff8645_1
- tk 8.6.12 h27826a3_0
- tzdata 2021e he74cb21_0
- xz 5.2.6 h166bdaf_0

4 changes: 2 additions & 2 deletions test-data/channels/conda-forge/linux-64/repodata.json
Git LFS file not shown

0 comments on commit a1d8480

Please sign in to comment.