Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test/test collapsing error #325

Merged
merged 10 commits into from
Sep 11, 2023
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
---
source: crates/rattler_conda_types/src/repo_data/mod.rs
assertion_line: 493
expression: file_urls
---
- channels/dummy/linux-64/foo-3.0.2-py36h1af98f8_1.tar.bz2
- "channels/dummy/linux-64/baz-2.0-unix_py36h1af98f8_2\u0000.tar.bz2"
- "channels/dummy/linux-64/baz-1.0-unix_py36h1af98f8_2\u0000.tar.bz2"
- channels/dummy/linux-64/foo-4.0.2-py36h1af98f8_2.tar.bz2
- channels/dummy/linux-64/bors-2.1-bla_1.tar.bz2
- channels/dummy/linux-64/bar-1.0-unix_py36h1af98f8_2.tar.bz2
- channels/dummy/linux-64/bors-1.0-bla_1.tar.bz2
- channels/dummy/linux-64/foo-3.0.2-py36h1af98f8_1.conda
- channels/dummy/linux-64/foo-3.0.2-py36h1af98f8_1.tar.bz2
- channels/dummy/linux-64/bors-1.1-bla_1.tar.bz2
- channels/dummy/linux-64/foo-4.0.2-py36h1af98f8_2.tar.bz2
- channels/dummy/linux-64/bors-2.0-bla_1.tar.bz2
- channels/dummy/linux-64/foobar-2.0-bla_1.tar.bz2
- channels/dummy/linux-64/foobar-2.1-bla_1.tar.bz2
- channels/dummy/linux-64/bors-1.2.1-bla_1.tar.bz2

Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,97 @@ expression: json
"license": "MIT",
"license_family": "MIT",
"md5": "bc13aa58e2092bcb0b97c561373d3905",
"name": "bar",
"name": "baz",
"sha256": "97ec377d2ad83dfef1194b7aa31b0c9076194e10d995a6e696c9d07dd782b14a",
"size": 414494,
"subdir": "linux-64",
"timestamp": 1605110689658,
"version": "1.2.3"
},
"baz-2.0-unix_py36h1af98f8_2\u0000.tar.bz2": {
"build": "unix_py36h1af98f8_2\u0000",
"build_number": 1,
"depends": [],
"license": "MIT",
"license_family": "MIT",
"md5": "bc13aa58e2092bcb0b97c561373d3905",
"name": "baz",
"sha256": "97ec377d2ad83dfef1194b7aa31b0c9076194e10d995a6e696c9d07dd782b14a",
"size": 414494,
"subdir": "linux-64",
"timestamp": 1605110689658,
"version": "2.0"
},
"bors-1.0-bla_1.tar.bz2": {
"build": "bla_1",
"build_number": 1,
"depends": [],
"license": "MIT",
"license_family": "MIT",
"md5": "bc13aa58e2092bcb0b97c561373d3905",
"name": "bors",
"sha256": "97ec377d2ad83dfef1194b7aa31b0c9076194e10d995a6e696c9d07dd782b14a",
"size": 414494,
"subdir": "linux-64",
"timestamp": 1605110689658,
"version": "1.0"
},
"bors-1.1-bla_1.tar.bz2": {
"build": "bla_1",
"build_number": 1,
"depends": [],
"license": "MIT",
"license_family": "MIT",
"md5": "bc13aa58e2092bcb0b97c561373d3905",
"name": "bors",
"sha256": "97ec377d2ad83dfef1194b7aa31b0c9076194e10d995a6e696c9d07dd782b14a",
"size": 414494,
"subdir": "linux-64",
"timestamp": 1605110689658,
"version": "1.1"
},
"bors-1.2.1-bla_1.tar.bz2": {
"build": "bla_1",
"build_number": 1,
"depends": [],
"license": "MIT",
"license_family": "MIT",
"md5": "bc13aa58e2092bcb0b97c561373d3905",
"name": "bors",
"sha256": "97ec377d2ad83dfef1194b7aa31b0c9076194e10d995a6e696c9d07dd782b14a",
"size": 414494,
"subdir": "linux-64",
"timestamp": 1605110689658,
"version": "1.2.1"
},
"bors-2.0-bla_1.tar.bz2": {
"build": "bla_1",
"build_number": 1,
"depends": [],
"license": "MIT",
"license_family": "MIT",
"md5": "bc13aa58e2092bcb0b97c561373d3905",
"name": "bors",
"sha256": "97ec377d2ad83dfef1194b7aa31b0c9076194e10d995a6e696c9d07dd782b14a",
"size": 414494,
"subdir": "linux-64",
"timestamp": 1605110689658,
"version": "2.0"
},
"bors-2.1-bla_1.tar.bz2": {
"build": "bla_1",
"build_number": 1,
"depends": [],
"license": "MIT",
"license_family": "MIT",
"md5": "bc13aa58e2092bcb0b97c561373d3905",
"name": "bors",
"sha256": "97ec377d2ad83dfef1194b7aa31b0c9076194e10d995a6e696c9d07dd782b14a",
"size": 414494,
"subdir": "linux-64",
"timestamp": 1605110689658,
"version": "2.1"
},
"foo-3.0.2-py36h1af98f8_1.conda": {
"build": "py36h1af98f8_1",
"build_number": 1,
Expand Down Expand Up @@ -82,6 +166,38 @@ expression: json
"subdir": "linux-64",
"timestamp": 1605110689658,
"version": "4.0.2"
},
"foobar-2.0-bla_1.tar.bz2": {
"build": "bla_1",
"build_number": 1,
"depends": [
"bors <2.0"
],
"license": "MIT",
"license_family": "MIT",
"md5": "bc13aa58e2092bcb0b97c561373d3905",
"name": "foobar",
"sha256": "97ec377d2ad83dfef1194b7aa31b0c9076194e10d995a6e696c9d07dd782b14a",
"size": 414494,
"subdir": "linux-64",
"timestamp": 1605110689658,
"version": "2.0"
},
"foobar-2.1-bla_1.tar.bz2": {
"build": "bla_1",
"build_number": 1,
"depends": [
"bors <2.0"
],
"license": "MIT",
"license_family": "MIT",
"md5": "bc13aa58e2092bcb0b97c561373d3905",
"name": "foobar",
"sha256": "97ec377d2ad83dfef1194b7aa31b0c9076194e10d995a6e696c9d07dd782b14a",
"size": 414494,
"subdir": "linux-64",
"timestamp": 1605110689658,
"version": "2.1"
}
},
"packages.conda": {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,90 @@ packages:
license: MIT
license_family: MIT
md5: bc13aa58e2092bcb0b97c561373d3905
name: bar
name: baz
sha256: 97ec377d2ad83dfef1194b7aa31b0c9076194e10d995a6e696c9d07dd782b14a
size: 414494
subdir: linux-64
timestamp: 1605110689658
version: 1.2.3
"baz-2.0-unix_py36h1af98f8_2\u0000.tar.bz2":
build: "unix_py36h1af98f8_2\u0000"
build_number: 1
depends: []
license: MIT
license_family: MIT
md5: bc13aa58e2092bcb0b97c561373d3905
name: baz
sha256: 97ec377d2ad83dfef1194b7aa31b0c9076194e10d995a6e696c9d07dd782b14a
size: 414494
subdir: linux-64
timestamp: 1605110689658
version: "2.0"
bors-1.0-bla_1.tar.bz2:
build: bla_1
build_number: 1
depends: []
license: MIT
license_family: MIT
md5: bc13aa58e2092bcb0b97c561373d3905
name: bors
sha256: 97ec377d2ad83dfef1194b7aa31b0c9076194e10d995a6e696c9d07dd782b14a
size: 414494
subdir: linux-64
timestamp: 1605110689658
version: "1.0"
bors-1.1-bla_1.tar.bz2:
build: bla_1
build_number: 1
depends: []
license: MIT
license_family: MIT
md5: bc13aa58e2092bcb0b97c561373d3905
name: bors
sha256: 97ec377d2ad83dfef1194b7aa31b0c9076194e10d995a6e696c9d07dd782b14a
size: 414494
subdir: linux-64
timestamp: 1605110689658
version: "1.1"
bors-1.2.1-bla_1.tar.bz2:
build: bla_1
build_number: 1
depends: []
license: MIT
license_family: MIT
md5: bc13aa58e2092bcb0b97c561373d3905
name: bors
sha256: 97ec377d2ad83dfef1194b7aa31b0c9076194e10d995a6e696c9d07dd782b14a
size: 414494
subdir: linux-64
timestamp: 1605110689658
version: 1.2.1
bors-2.0-bla_1.tar.bz2:
build: bla_1
build_number: 1
depends: []
license: MIT
license_family: MIT
md5: bc13aa58e2092bcb0b97c561373d3905
name: bors
sha256: 97ec377d2ad83dfef1194b7aa31b0c9076194e10d995a6e696c9d07dd782b14a
size: 414494
subdir: linux-64
timestamp: 1605110689658
version: "2.0"
bors-2.1-bla_1.tar.bz2:
build: bla_1
build_number: 1
depends: []
license: MIT
license_family: MIT
md5: bc13aa58e2092bcb0b97c561373d3905
name: bors
sha256: 97ec377d2ad83dfef1194b7aa31b0c9076194e10d995a6e696c9d07dd782b14a
size: 414494
subdir: linux-64
timestamp: 1605110689658
version: "2.1"
foo-3.0.2-py36h1af98f8_1.conda:
build: py36h1af98f8_1
build_number: 1
Expand Down Expand Up @@ -74,6 +152,34 @@ packages:
subdir: linux-64
timestamp: 1605110689658
version: 4.0.2
foobar-2.0-bla_1.tar.bz2:
build: bla_1
build_number: 1
depends:
- bors <2.0
license: MIT
license_family: MIT
md5: bc13aa58e2092bcb0b97c561373d3905
name: foobar
sha256: 97ec377d2ad83dfef1194b7aa31b0c9076194e10d995a6e696c9d07dd782b14a
size: 414494
subdir: linux-64
timestamp: 1605110689658
version: "2.0"
foobar-2.1-bla_1.tar.bz2:
build: bla_1
build_number: 1
depends:
- bors <2.0
license: MIT
license_family: MIT
md5: bc13aa58e2092bcb0b97c561373d3905
name: foobar
sha256: 97ec377d2ad83dfef1194b7aa31b0c9076194e10d995a6e696c9d07dd782b14a
size: 414494
subdir: linux-64
timestamp: 1605110689658
version: "2.1"
packages.conda: {}
repodata_version: 2

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

#[test]
fn test_solve_with_error() {
let result = solve::<$T>(
dummy_channel_json_path(),
Vec::new(),
Vec::new(),
&["foobar >=2", "bors >= 2"],
);

assert!(result.is_err());

let err = result.err().unwrap();
insta::assert_debug_snapshot!(err);
}

#[test]
fn test_solve_dummy_repo_install_non_existent() {
let result = solve::<$T>(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
source: crates/rattler_solve/tests/backends.rs
expression: err
---
Unsolvable(
[
"package foobar-2.0-bla_1 requires bors <2.0, but none of the providers can be installed",
],
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
source: crates/rattler_solve/tests/backends.rs
expression: err
---
Unsolvable(
[
"The following packages are incompatible\n|-- foobar >=2 can be installed with any of the following options:\n |-- foobar 2.0 | 2.1 would require\n |-- bors <2.0, which can be installed with any of the following options:\n |-- bors 1.2.1\n|-- bors >=2 cannot be installed because there are no viable options:\n |-- bors 2.1, which conflicts with the versions reported above.\n |-- bors 2.0, which conflicts with the versions reported above.\n",
],
)
4 changes: 2 additions & 2 deletions test-data/channels/dummy/linux-64/repodata.json
Git LFS file not shown