From d0c1e6cb058fe0adaa6fe135bc0a1005cfebd535 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Mon, 8 Nov 2021 14:21:59 +0100 Subject: [PATCH] Add InstallerTest for path repo symlink unfixing --- ...tial-update-with-symlinked-path-repos.test | 91 +++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 tests/Composer/Test/Fixtures/installer/partial-update-with-symlinked-path-repos.test diff --git a/tests/Composer/Test/Fixtures/installer/partial-update-with-symlinked-path-repos.test b/tests/Composer/Test/Fixtures/installer/partial-update-with-symlinked-path-repos.test new file mode 100644 index 000000000..79a6b8b3c --- /dev/null +++ b/tests/Composer/Test/Fixtures/installer/partial-update-with-symlinked-path-repos.test @@ -0,0 +1,91 @@ +--TEST-- +Partially updating one root requirement with transitive deps fully updates transitive deps, and always updates symlinked path repos, but not the transitive deps of the path repos. + +--COMPOSER-- +{ + "repositories": [ + {"type": "path", "url": "./DependencyResolver/Fixtures/poolbuilder/symlinked-path-repo"}, + {"type": "path", "url": "./DependencyResolver/Fixtures/poolbuilder/mirrored-path-repo", "options": {"symlink": false}}, + { + "type": "package", + "package": [ + {"name": "root/update", "version": "1.0.4", "require": {"symlinked/transitive2": ">=1.0.1", "mirrored/transitive2": ">=1.0.1"}}, + {"name": "symlinked/transitive", "version": "1.0.0"}, + {"name": "symlinked/transitive", "version": "1.0.1"}, + {"name": "symlinked/transitive", "version": "2.0.3"}, + {"name": "symlinked/transitive2", "version": "1.0.0"}, + {"name": "symlinked/transitive2", "version": "1.0.3"}, + {"name": "symlinked/transitive2", "version": "2.0.3"}, + {"name": "mirrored/transitive", "version": "1.0.0"}, + {"name": "mirrored/transitive", "version": "1.0.5"}, + {"name": "mirrored/transitive2", "version": "1.0.0"}, + {"name": "mirrored/transitive2", "version": "1.0.7"} + ] + } + ], + "require": { + "root/update": "*", + "symlinked/path-pkg": "*", + "mirrored/path-pkg": "*" + } +} +--LOCK-- +{ + "packages": [ + {"name": "root/update", "version": "1.0.1", "require": {"symlinked/transitive2": ">=1.0.1", "mirrored/transitive2": ">=1.0.1"}}, + {"name": "symlinked/transitive", "version": "1.0.0"}, + {"name": "symlinked/transitive2", "version": "1.0.0"}, + {"name": "mirrored/transitive", "version": "1.0.0"}, + {"name": "mirrored/transitive2", "version": "1.0.0"}, + { + "name": "symlinked/path-pkg", + "version": "1.0.0", + "require": { + "symlinked/transitive": "1.*", + "symlinked/transitive2": "1.*" + }, + "dist": {"type": "path", "url": "./symlinked-path-repo", "reference": "abcd"}, "transport-options": {} + }, + { + "name": "mirrored/path-pkg", + "version": "1.0.0", + "require": { + "mirrored/transitive": "1.*", + "mirrored/transitive2": "1.*" + }, + "dist": {"type": "path", "url": "./mirrored-path-repo", "reference": "abcd"}, "transport-options": {"symlink": false} + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": { + }, + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [] +} +--INSTALLED-- +[ + { "name": "a/old", "version": "0.9.0" }, + { "name": "b/unstable", "version": "1.1.0-alpha", "require": {"f/dependency": "1.*"} }, + { "name": "c/uptodate", "version": "2.0.0" }, + { "name": "f/dependency", "version": "1.0.0" } +] +--RUN-- +update --with-all-dependencies root/update + +--EXPECT-EXIT-CODE-- +2 + +--EXPECT-OUTPUT-- +Loading composer repositories with package information +Updating dependencies +Your requirements could not be resolved to an installable set of packages. + + Problem 1 + - Root composer.json requires symlinked/path-pkg * -> satisfiable by symlinked/path-pkg[2.0.0]. + - symlinked/path-pkg 2.0.0 requires symlinked/transitive 2.* -> found symlinked/transitive[2.0.3] but the package is fixed to 1.0.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command. + +--EXPECT--