aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2022-04-29 12:10:57 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2022-06-07 21:14:14 +0300
commitce4004e65cfd2f22e9c2ca4a27118eadbea020c0 (patch)
tree7726b3c31bd6c12af5604eac1de5631af53e0c8c /tests
parent714662df7ada7426ba2cfd982f15b4333f7716f9 (diff)
Fix collect_order_dependents() not to verify constraints of being dropped dependent
Diffstat (limited to 'tests')
-rw-r--r--tests/common/satisfy/t12b/baz-0.1.0.tar.gzbin0 -> 359 bytes
-rw-r--r--tests/common/satisfy/t12b/baz-1.0.0.tar.gzbin0 -> 366 bytes
-rw-r--r--tests/common/satisfy/t12b/foo-0.1.0.tar.gzbin0 -> 357 bytes
-rw-r--r--tests/pkg-build.testscript77
4 files changed, 77 insertions, 0 deletions
diff --git a/tests/common/satisfy/t12b/baz-0.1.0.tar.gz b/tests/common/satisfy/t12b/baz-0.1.0.tar.gz
new file mode 100644
index 0000000..2676c52
--- /dev/null
+++ b/tests/common/satisfy/t12b/baz-0.1.0.tar.gz
Binary files differ
diff --git a/tests/common/satisfy/t12b/baz-1.0.0.tar.gz b/tests/common/satisfy/t12b/baz-1.0.0.tar.gz
new file mode 100644
index 0000000..1aec461
--- /dev/null
+++ b/tests/common/satisfy/t12b/baz-1.0.0.tar.gz
Binary files differ
diff --git a/tests/common/satisfy/t12b/foo-0.1.0.tar.gz b/tests/common/satisfy/t12b/foo-0.1.0.tar.gz
new file mode 100644
index 0000000..a282f20
--- /dev/null
+++ b/tests/common/satisfy/t12b/foo-0.1.0.tar.gz
Binary files differ
diff --git a/tests/pkg-build.testscript b/tests/pkg-build.testscript
index c3916ca..5347f62 100644
--- a/tests/pkg-build.testscript
+++ b/tests/pkg-build.testscript
@@ -227,8 +227,11 @@
# |-- t12b -> t12b (prerequisite repository)
# | |-- libbaz-0.1.0.tar.gz
# | |-- libbar-1.0.0.tar.gz -> libbaz == 0.1.0
+# | |-- foo-0.1.0.tar.gz
# | |-- foo-1.0.0.tar.gz -> libbar
# | |-- bar-1.0.0.tar.gz -> libbar == 0.1.0
+# | |-- baz-0.1.0.tar.gz -> libbaz
+# | |-- baz-1.0.0.tar.gz -> libbaz == 1.0.0
# | `-- repositories.manifest
# |
# `-- git
@@ -4630,6 +4633,80 @@ test.options += --no-progress
}
}
+ : drop-dependent
+ :
+ {
+ +$clone_root_cfg && $rep_add $rep/t12b && $rep_fetch
+
+ test.arguments += --yes
+
+ : unhold
+ :
+ : Test that the being dropped dependent does not constrain a dependency
+ : anymore.
+ :
+ {
+ $clone_cfg;
+
+ $* libbar 2>!;
+
+ $pkg_status -r >>EOO;
+ !libbar configured 1.0.0
+ libbaz configured 0.1.0 available [1.0.0]
+ EOO
+
+ $* baz/0.1.0 ?libbar ?libbaz 2>!;
+
+ $pkg_status -r >>EOO;
+ !baz configured !0.1.0 available 1.0.0
+ libbaz configured 1.0.0
+ EOO
+
+ $pkg_drop baz
+ }
+
+ : unuse
+ :
+ : Unlike the previous test, at the time we check the constraint applied
+ : by libbar on libbaz (== 0.1.0) there is no evidence that libbar will be
+ : dropped, which will happen some later execution plan refinement
+ : iteration.
+ :
+ : @@ This scenario is not supported yet and fails with:
+ :
+ : error: unable to upgrade package libbaz/0.1.0 to 1.0.0
+ : info: because package libbar depends on (libbaz == 0.1.0)
+ : info: package libbaz/1.0.0 required by baz
+ : info: explicitly request up/downgrade of package libbar
+ : info: or explicitly specify package libbaz version to manually satisfy these constraints
+ :
+ : We could probably fix this postponing the constraints check in
+ : collect_order_dependents() until the final execution plan is produced
+ : (after all that refinement iterations). We could have an additional
+ : iteration after all the refinements which would enable the constraint
+ : check in collect_order_dependents().
+ :
+ if false
+ {
+ $clone_cfg;
+
+ $* foo 2>!;
+
+ $pkg_status -r >>EOO;
+ !foo configured 1.0.0
+ libbar configured 1.0.0
+ libbaz configured 0.1.0 available [1.0.0]
+ EOO
+
+ $* baz foo/0.1.0 2>|;
+
+ $pkg_status -r >>EOO;
+ EOO
+
+ $pkg_drop foo
+ }
+ }
+
: configuration-negotiation
:
{