Skip to content

Commit

Permalink
Add expected results to scenarios
Browse files Browse the repository at this point in the history
  • Loading branch information
zanieb committed Jan 4, 2024
1 parent 1699090 commit 3ecf492
Show file tree
Hide file tree
Showing 12 changed files with 1,622 additions and 1,281 deletions.
16 changes: 12 additions & 4 deletions scenarios/example.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
{
"name": "example",
"description": "This is an example scenario, in which the user depends on a single package `a` which requires `b`",
"description": "This is an example scenario, in which the user depends on a single package `a` which requires `b`.",
"expected": {
"satisfiable": true,
"packages": {
"a": "1.0.0",
"b": "3.0.0"
},
"explanation": "The latest valid version of `b` should be installed. `b==3.0.0` is not valid because it requires `c` which does not exist."
},
"root": {
"requires": [
"a"
Expand All @@ -19,12 +27,12 @@
"b": {
"versions": {
"1.0.0": {},
"2.0.0": {
"2.0.0": {},
"3.0.0": {
"requires": [
"c"
]
},
"3.0.0": {}
}
}
}
}
Expand Down
77 changes: 75 additions & 2 deletions scenarios/prereleases.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@
"1.0.0a1": {}
}
}
},
"expected": {
"satisfiable": true,
"packages": {
"a": "1.0.0a1"
},
"explanation": "Since there are only pre-release versions of `a` available, it should be installed even though the user did not include a pre-release specifier."
}
},
{
Expand All @@ -30,6 +37,10 @@
"1.0.0a1": {}
}
}
},
"expected": {
"satisfiable": false,
"explanation": "Since there are final versions of `a` available, pre-release versions should not be selected without explicit opt-in."
}
},
{
Expand All @@ -47,6 +58,13 @@
"1.0.0a1": {}
}
}
},
"expected": {
"satisfiable": true,
"packages": {
"a": "0.1.0"
},
"explanation": "Since the user did not provide a pre-release specifier, the older final version should be selected."
}
},
{
Expand All @@ -65,6 +83,13 @@
"0.3.0": {}
}
}
},
"expected": {
"satisfiable": true,
"packages": {
"a": "0.3.0"
},
"explanation": "The latest final version should be selected."
}
},
{
Expand All @@ -83,6 +108,13 @@
"0.3.0a1": {}
}
}
},
"expected": {
"satisfiable": true,
"packages": {
"a": "0.3.0a1"
},
"explanation": "The latest pre-release version should be selected."
}
},
{
Expand All @@ -102,6 +134,13 @@
"1.0.0a1": {}
}
}
},
"expected": {
"satisfiable": true,
"packages": {
"a": "1.0.0a1"
},
"explanation": "Since the user provided a pre-release specifier, the latest pre-release version should be selected."
}
},
{
Expand All @@ -120,6 +159,13 @@
"1.0.0rc1": {}
}
}
},
"expected": {
"satisfiable": true,
"packages": {
"a": "1.0.0rc1"
},
"explanation": "Release candidates should be the highest precedence pre-release kind."
}
},
{
Expand All @@ -138,11 +184,18 @@
"1.0.0a3": {}
}
}
},
"expected": {
"satisfiable": true,
"packages": {
"a": "1.0.0a3"
},
"explanation": "The latest alpha version should be selected."
}
},
{
"name": "requires-transitive-package-only-prereleases",
"description": "The user requires any version of package `a` which only has pre-release versions available.",
"description": "The user requires any version of package `a` which requires `b` which only has pre-release versions available.",
"root": {
"requires": [
"a"
Expand All @@ -163,11 +216,19 @@
"1.0.0a1": {}
}
}
},
"expected": {
"satisfiable": true,
"packages": {
"a": "0.1.0",
"b": "1.0.0a1"
},
"explanation": "Since there are only pre-release versions of `b` available, it should be selected even though the user did not opt-in to pre-releases."
}
},
{
"name": "requires-transitive-package-only-prereleases-in-range",
"description": "The user requires package `a` which has a dependency on a package which only matches pre-release versions but they did not include a prerelease specifier.",
"description": "The user requires package `a` which has a dependency on a package which only matches pre-release versions but they did not include a pre-release specifier.",
"root": {
"requires": [
"a"
Expand All @@ -189,6 +250,10 @@
"1.0.0a1": {}
}
}
},
"expected": {
"satisfiable": false,
"explanation": "Since there are final versions of `b` available, the pre-release version should not be selected without explicit opt-in. The available version is excluded by the range requested by the user."
}
},
{
Expand Down Expand Up @@ -216,6 +281,14 @@
"1.0.0a1": {}
}
}
},
"expected": {
"satisfiable": true,
"packages": {
"a": "0.1.0",
"b": "1.0.0a1"
},
"explanation": "Since the user included a dependency on `b` with a pre-release specifier, a pre-release version can be selected."
}
}
]
17 changes: 16 additions & 1 deletion scenarios/requires-does-not-exist.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
"a"
]
},
"packages": {}
"packages": {},
"expected": {
"satisfiable": false
}
},
{
"name": "requires-exact-version-does-not-exist",
Expand All @@ -23,6 +26,9 @@
"1.0.0": {}
}
}
},
"expected": {
"satisfiable": false
}
},
{
Expand All @@ -40,6 +46,9 @@
"1.0.0": {}
}
}
},
"expected": {
"satisfiable": false
}
},
{
Expand All @@ -58,6 +67,9 @@
"4.0.0": {}
}
}
},
"expected": {
"satisfiable": false
}
},
{
Expand All @@ -78,6 +90,9 @@
}
}
}
},
"expected": {
"satisfiable": false
}
}
]
9 changes: 9 additions & 0 deletions scenarios/requires-incompatible-versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
"2.0.0": {}
}
}
},
"expected": {
"satisfiable": false
}
},
{
Expand Down Expand Up @@ -42,6 +45,9 @@
"2.0.0": {}
}
}
},
"expected": {
"satisfiable": false
}
},
{
Expand Down Expand Up @@ -78,6 +84,9 @@
"2.0.0": {}
}
}
},
"expected": {
"satisfiable": false
}
}
]
21 changes: 21 additions & 0 deletions scenarios/requires-python.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
}
}
}
},
"expected": {
"satisfiable": false
}
},
{
Expand All @@ -36,6 +39,9 @@
}
}
}
},
"expected": {
"satisfiable": false
}
},
{
Expand All @@ -57,6 +63,9 @@
}
}
}
},
"expected": {
"satisfiable": false
}
},
{
Expand Down Expand Up @@ -111,6 +120,9 @@
}
}
}
},
"expected": {
"satisfiable": false
}
},
{
Expand Down Expand Up @@ -141,6 +153,12 @@
}
}
}
},
"expected": {
"satisfiable": true,
"packages": {
"a": "1.0.0"
}
}
},
{
Expand Down Expand Up @@ -171,6 +189,9 @@
}
}
}
},
"expected": {
"satisfiable": false
}
}
]
Loading

0 comments on commit 3ecf492

Please sign in to comment.