From 56b7d88975aa8da6446857cfd92de0825024bf63 Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Thu, 13 Sep 2018 19:36:00 -0600 Subject: support for hex v2, multiple repository fetching, private organizations (#1884) * update to hex_core for hex-v2 repo support (#1865) * update to hex_core for hex-v2 repo support This patch adds only single repo hex-v2 support through hex_core. Packages no longer filtered out by buildtool metadata and the package index is updated per-package instead of fetched as one large ets dump. * tell travis to also build hex_core branch * support list of repos for hex packages (#1866) * support list of repos for hex packages repos are defined under the hex key in rebar configs. They can be defined at the top level of a project or globally, but not in profiles and the repos configured in dependencies are also ignored. Searching for packages involves first checking for a match in the local repo index cache, in the order repos are defined. If not found each repo is checked through the hex api for any known versions of the package and the first repo with a version that fits the constraint is used. * add {repos, replace, []} for overriding the global & default repos * add hex auth handling for repos (#1874) auth token are kept in a hex.config file that is modified by the rebar3 hex plugin. Repo names that have a : separating a parent and child are considered organizations. The parent repo's auth will be included with the child. So an organization named hexpm:rebar3_test will include any hexpm auth tokens found in the rebar3_test organization's configuration. * move packages to top level of of hexpm cache dir (#1876) * move packages to top level of of hexpm cache dir * append organization name to parent's repo_url when parsing repos * only eval config scripts and apply overrides once per app (#1879) * only eval config scripts and apply overrides once per app * move new resource behaviour to rebar_resource_v2 and keep v1 * cleanup use of rebar_resource module and unused functions * cleanup error messages and unused code * when discovering apps support mix packages as unbuilt apps (#1882) * use hex_core tarball unpacking support in pkg resource (#1883) * use hex_core tarball unpacking support in pkg resource * ignore etag if package doesn't exist and delete if checksum fails * add back tests for bad package checksums * improve bad registry checksum error message --- test/rebar_upgrade_SUITE.erl | 442 +++++++++++++++++++++---------------------- 1 file changed, 221 insertions(+), 221 deletions(-) (limited to 'test/rebar_upgrade_SUITE.erl') diff --git a/test/rebar_upgrade_SUITE.erl b/test/rebar_upgrade_SUITE.erl index 45a7433..c55456c 100644 --- a/test/rebar_upgrade_SUITE.erl +++ b/test/rebar_upgrade_SUITE.erl @@ -112,25 +112,25 @@ setup_project(Case, Config0, Deps, UpDeps) -> upgrades(top_a) -> %% Original tree - {[{"A", "1", [{"B", [{"D", "1", []}]}, - {"C", [{"D", "2", []}]}]} + {[{"A", "1.0.0", [{"B", [{"D", "1.0.0", []}]}, + {"C", [{"D", "2.0.0", []}]}]} ], %% Updated tree - [{"A", "1", [{"B", [{"D", "3", []}]}, - {"C", [{"D", "2", []}]}]} + [{"A", "1.0.0", [{"B", [{"D", "3.0.0", []}]}, + {"C", [{"D", "2.0.0", []}]}]} ], %% Modified apps, gobally ["A","B","D"], %% upgrade vs. new tree - {"A", [{"A","1"}, "B", "C", {"D","3"}]}}; + {"A", [{"A","1.0.0"}, "B", "C", {"D","3.0.0"}]}}; upgrades(top_b) -> %% Original tree - {[{"A", "1", [{"B", [{"D", "1", []}]}, - {"C", [{"D", "2", []}]}]} + {[{"A", "1.0.0", [{"B", [{"D", "1.0.0", []}]}, + {"C", [{"D", "2.0.0", []}]}]} ], %% Updated tree - [{"A", "1", [{"B", [{"D", "3", []}]}, - {"C", [{"D", "2", []}]}]} + [{"A", "1.0.0", [{"B", [{"D", "3.0.0", []}]}, + {"C", [{"D", "2.0.0", []}]}]} ], %% Modified apps, gobally ["A","B","D"], @@ -138,12 +138,12 @@ upgrades(top_b) -> {"B", {error, {rebar_prv_upgrade, {transitive_dependency, <<"B">>}}}}}; upgrades(top_c) -> %% Original tree - {[{"A", "1", [{"B", [{"D", "1", []}]}, - {"C", [{"D", "2", []}]}]} + {[{"A", "1.0.0", [{"B", [{"D", "1.0.0", []}]}, + {"C", [{"D", "2.0.0", []}]}]} ], %% Updated tree - [{"A", "1", [{"B", [{"D", "3", []}]}, - {"C", [{"D", "2", []}]}]} + [{"A", "1.0.0", [{"B", [{"D", "3.0.0", []}]}, + {"C", [{"D", "2.0.0", []}]}]} ], %% Modified apps, gobally ["A","B","D"], @@ -151,12 +151,12 @@ upgrades(top_c) -> {"C", {error, {rebar_prv_upgrade, {transitive_dependency, <<"C">>}}}}}; upgrades(top_d1) -> %% Original tree - {[{"A", "1", [{"B", [{"D", "1", []}]}, - {"C", [{"D", "2", []}]}]} + {[{"A", "1.0.0", [{"B", [{"D", "1.0.0", []}]}, + {"C", [{"D", "2.0.0", []}]}]} ], %% Updated tree - [{"A", "1", [{"B", [{"D", "3", []}]}, - {"C", [{"D", "2", []}]}]} + [{"A", "1.0.0", [{"B", [{"D", "3.0.0", []}]}, + {"C", [{"D", "2.0.0", []}]}]} ], %% Modified apps, gobally ["A","B","D"], @@ -164,12 +164,12 @@ upgrades(top_d1) -> {"D", {error, {rebar_prv_upgrade, {transitive_dependency, <<"D">>}}}}}; upgrades(top_d2) -> %% Original tree - {[{"A", "1", [{"B", [{"D", "1", []}]}, - {"C", [{"D", "2", []}]}]} + {[{"A", "1.0.0", [{"B", [{"D", "1.0.0", []}]}, + {"C", [{"D", "2.0.0", []}]}]} ], %% Updated tree - [{"A", "1", [{"B", [{"D", "3", []}]}, - {"C", [{"D", "2", []}]}]} + [{"A", "1.0.0", [{"B", [{"D", "3.0.0", []}]}, + {"C", [{"D", "2.0.0", []}]}]} ], %% Modified apps, gobally ["A","B","D"], @@ -177,342 +177,342 @@ upgrades(top_d2) -> {"D", {error, {rebar_prv_upgrade, {transitive_dependency, <<"D">>}}}}}; upgrades(top_e) -> %% Original tree - {[{"A", "1", [{"B", [{"D", "1", []}]}, - {"C", [{"D", "2", []}]}]} + {[{"A", "1.0.0", [{"B", [{"D", "1.0.0", []}]}, + {"C", [{"D", "2.0.0", []}]}]} ], %% Updated tree - [{"A", "1", [{"B", [{"D", "3", []}]}, - {"C", [{"D", "2", []}]}]} + [{"A", "1.0.0", [{"B", [{"D", "3.0.0", []}]}, + {"C", [{"D", "2.0.0", []}]}]} ], %% Modified apps, gobally ["A","B","D"], %% upgrade vs. new tree {"E", {error, {rebar_prv_upgrade, {unknown_dependency, <<"E">>}}}}}; upgrades(pair_a) -> - {[{"A", "1", [{"C", "1", []}]}, - {"B", "1", [{"D", "1", []}]} + {[{"A", "1.0.0", [{"C", "1.0.0", []}]}, + {"B", "1.0.0", [{"D", "1.0.0", []}]} ], - [{"A", "2", [{"C", "2", []}]}, - {"B", "2", [{"D", "2", []}]} + [{"A", "2.0.0", [{"C", "2.0.0", []}]}, + {"B", "2.0.0", [{"D", "2.0.0", []}]} ], ["A","B","C","D"], - {"A", [{"A","2"},{"C","2"},{"B","1"},{"D","1"}]}}; + {"A", [{"A","2.0.0"},{"C","2.0.0"},{"B","1.0.0"},{"D","1.0.0"}]}}; upgrades(pair_b) -> - {[{"A", "1", [{"C", "1", []}]}, - {"B", "1", [{"D", "1", []}]} + {[{"A", "1.0.0", [{"C", "1.0.0", []}]}, + {"B", "1.0.0", [{"D", "1.0.0", []}]} ], - [{"A", "2", [{"C", "2", []}]}, - {"B", "2", [{"D", "2", []}]} + [{"A", "2.0.0", [{"C", "2.0.0", []}]}, + {"B", "2.0.0", [{"D", "2.0.0", []}]} ], ["A","B","C","D"], - {"B", [{"A","1"},{"C","1"},{"B","2"},{"D","2"}]}}; + {"B", [{"A","1.0.0"},{"C","1.0.0"},{"B","2.0.0"},{"D","2.0.0"}]}}; upgrades(pair_ab) -> - {[{"A", "1", [{"C", "1", []}]}, - {"B", "1", [{"D", "1", []}]} + {[{"A", "1.0.0", [{"C", "1.0.0", []}]}, + {"B", "1.0.0", [{"D", "1.0.0", []}]} ], - [{"A", "2", [{"C", "2", []}]}, - {"B", "2", [{"D", "2", []}]} + [{"A", "2.0.0", [{"C", "2.0.0", []}]}, + {"B", "2.0.0", [{"D", "2.0.0", []}]} ], ["A","B","C","D"], - {"A,B", [{"A","2"},{"C","2"},{"B","2"},{"D","2"}]}}; + {"A,B", [{"A","2.0.0"},{"C","2.0.0"},{"B","2.0.0"},{"D","2.0.0"}]}}; upgrades(pair_c) -> - {[{"A", "1", [{"C", "1", []}]}, - {"B", "1", [{"D", "1", []}]} + {[{"A", "1.0.0", [{"C", "1.0.0", []}]}, + {"B", "1.0.0", [{"D", "1.0.0", []}]} ], - [{"A", "2", [{"C", "2", []}]}, - {"B", "2", [{"D", "2", []}]} + [{"A", "2.0.0", [{"C", "2.0.0", []}]}, + {"B", "2.0.0", [{"D", "2.0.0", []}]} ], ["A","B","C","D"], {"C", {error, {rebar_prv_upgrade, {transitive_dependency, <<"C">>}}}}}; upgrades(pair_all) -> - {[{"A", "1", [{"C", "1", []}]}, - {"B", "1", [{"D", "1", []}]} + {[{"A", "1.0.0", [{"C", "1.0.0", []}]}, + {"B", "1.0.0", [{"D", "1.0.0", []}]} ], - [{"A", "2", [{"C", "2", []}]}, - {"B", "2", [{"D", "2", []}]} + [{"A", "2.0.0", [{"C", "2.0.0", []}]}, + {"B", "2.0.0", [{"D", "2.0.0", []}]} ], ["A","B","C","D"], - {"", [{"A","2"},{"C","2"},{"B","2"},{"D","2"}]}}; + {"", [{"A","2.0.0"},{"C","2.0.0"},{"B","2.0.0"},{"D","2.0.0"}]}}; upgrades(triplet_a) -> - {[{"A", "1", [{"D",[]}, - {"E","3",[]}]}, - {"B", "1", [{"F","1",[]}, + {[{"A", "1.0.0", [{"D",[]}, + {"E","3.0.0",[]}]}, + {"B", "1.0.0", [{"F","1.0.0",[]}, {"G",[]}]}, - {"C", "0", [{"H","3",[]}, + {"C", "0.0.0", [{"H","3.0.0",[]}, {"I",[]}]}], - [{"A", "1", [{"D",[]}, - {"E","2",[]}]}, - {"B", "1", [{"F","1",[]}, + [{"A", "1.0.0", [{"D",[]}, + {"E","2.0.0",[]}]}, + {"B", "1.0.0", [{"F","1.0.0",[]}, {"G",[]}]}, - {"C", "1", [{"H","4",[]}, + {"C", "1.0.0", [{"H","4.0.0",[]}, {"I",[]}]}], ["A","C","E","H"], - {"A", [{"A","1"}, "D", {"E","2"}, - {"B","1"}, {"F","1"}, "G", - {"C","0"}, {"H","3"}, "I"]}}; + {"A", [{"A","1.0.0"}, "D", {"E","2.0.0"}, + {"B","1.0.0"}, {"F","1.0.0"}, "G", + {"C","0.0.0"}, {"H","3.0.0"}, "I"]}}; upgrades(triplet_b) -> - {[{"A", "1", [{"D",[]}, - {"E","3",[]}]}, - {"B", "1", [{"F","1",[]}, + {[{"A", "1.0.0", [{"D",[]}, + {"E","3.0.0",[]}]}, + {"B", "1.0.0", [{"F","1.0.0",[]}, {"G",[]}]}, - {"C", "0", [{"H","3",[]}, + {"C", "0.0.0", [{"H","3.0.0",[]}, {"I",[]}]}], - [{"A", "2", [{"D",[]}, - {"E","2",[]}]}, - {"B", "1", [{"F","1",[]}, + [{"A", "2.0.0", [{"D",[]}, + {"E","2.0.0",[]}]}, + {"B", "1.0.0", [{"F","1.0.0",[]}, {"G",[]}]}, - {"C", "1", [{"H","4",[]}, + {"C", "1.0.0", [{"H","4.0.0",[]}, {"I",[]}]}], ["A","C","E","H"], - {"B", [{"A","1"}, "D", {"E","3"}, - {"B","1"}, {"F","1"}, "G", - {"C","0"}, {"H","3"}, "I"]}}; + {"B", [{"A","1.0.0"}, "D", {"E","3.0.0"}, + {"B","1.0.0"}, {"F","1.0.0"}, "G", + {"C","0.0.0"}, {"H","3.0.0"}, "I"]}}; upgrades(triplet_c) -> - {[{"A", "1", [{"D",[]}, - {"E","3",[]}]}, - {"B", "1", [{"F","1",[]}, + {[{"A", "1.0.0", [{"D",[]}, + {"E","3.0.0",[]}]}, + {"B", "1.0.0", [{"F","1.0.0",[]}, {"G",[]}]}, - {"C", "0", [{"H","3",[]}, + {"C", "0.0.0", [{"H","3.0.0",[]}, {"I",[]}]}], - [{"A", "2", [{"D",[]}, - {"E","2",[]}]}, - {"B", "1", [{"F","1",[]}, + [{"A", "2.0.0", [{"D",[]}, + {"E","2.0.0",[]}]}, + {"B", "1.0.0", [{"F","1.0.0",[]}, {"G",[]}]}, - {"C", "1", [{"H","4",[]}, + {"C", "1.0.0", [{"H","4.0.0",[]}, {"I",[]}]}], ["A","C","E","H"], - {"C", [{"A","1"}, "D", {"E","3"}, - {"B","1"}, {"F","1"}, "G", - {"C","1"}, {"H","4"}, "I"]}}; + {"C", [{"A","1.0.0"}, "D", {"E","3.0.0"}, + {"B","1.0.0"}, {"F","1.0.0"}, "G", + {"C","1.0.0"}, {"H","4.0.0"}, "I"]}}; upgrades(tree_a) -> - {[{"A", "1", [{"D",[{"J",[]}]}, - {"E",[{"I","1",[]}]}]}, - {"B", "1", [{"F",[]}, + {[{"A", "1.0.0", [{"D",[{"J",[]}]}, + {"E",[{"I","1.0.0",[]}]}]}, + {"B", "1.0.0", [{"F",[]}, {"G",[]}]}, - {"C", "1", [{"H",[]}, - {"I","2",[]}]} + {"C", "1.0.0", [{"H",[]}, + {"I","2.0.0",[]}]} ], - [{"A", "1", [{"D",[{"J",[]}]}, - {"E",[{"I","1",[]}]}]}, - {"B", "1", [{"F",[]}, + [{"A", "1.0.0", [{"D",[{"J",[]}]}, + {"E",[{"I","1.0.0",[]}]}]}, + {"B", "1.0.0", [{"F",[]}, {"G",[]}]}, - {"C", "2", [{"H",[]}]} + {"C", "2.0.0", [{"H",[]}]} ], ["C"], - {"A", [{"A","1"}, "D", "J", "E", - {"B","1"}, "F", "G", - {"C","1"}, "H", {"I","2"}]}}; + {"A", [{"A","1.0.0"}, "D", "J", "E", + {"B","1.0.0"}, "F", "G", + {"C","1.0.0"}, "H", {"I","2.0.0"}]}}; upgrades(tree_b) -> - {[{"A", "1", [{"D",[{"J",[]}]}, - {"E",[{"I","1",[]}]}]}, - {"B", "1", [{"F",[]}, + {[{"A", "1.0.0", [{"D",[{"J",[]}]}, + {"E",[{"I","1.0.0",[]}]}]}, + {"B", "1.0.0", [{"F",[]}, {"G",[]}]}, - {"C", "1", [{"H",[]}, - {"I","2",[]}]} + {"C", "1.0.0", [{"H",[]}, + {"I","2.0.0",[]}]} ], - [{"A", "1", [{"D",[{"J",[]}]}, - {"E",[{"I","1",[]}]}]}, - {"B", "1", [{"F",[]}, + [{"A", "1.0.0", [{"D",[{"J",[]}]}, + {"E",[{"I","1.0.0",[]}]}]}, + {"B", "1.0.0", [{"F",[]}, {"G",[]}]}, - {"C", "2", [{"H",[]}]} + {"C", "2.0.0", [{"H",[]}]} ], ["C"], - {"B", [{"A","1"}, "D", "J", "E", - {"B","1"}, "F", "G", - {"C","1"}, "H", {"I","2"}]}}; + {"B", [{"A","1.0.0"}, "D", "J", "E", + {"B","1.0.0"}, "F", "G", + {"C","1.0.0"}, "H", {"I","2.0.0"}]}}; upgrades(tree_c) -> - {[{"A", "1", [{"D",[{"J",[]}]}, - {"E",[{"I","1",[]}]}]}, - {"B", "1", [{"F",[]}, + {[{"A", "1.0.0", [{"D",[{"J",[]}]}, + {"E",[{"I","1.0.0",[]}]}]}, + {"B", "1.0.0", [{"F",[]}, {"G",[]}]}, - {"C", "1", [{"H",[]}, - {"I","2",[]}]} + {"C", "1.0.0", [{"H",[]}, + {"I","2.0.0",[]}]} ], - [{"A", "1", [{"D",[{"J",[]}]}, - {"E",[{"I","1",[]}]}]}, - {"B", "1", [{"F",[]}, + [{"A", "1.0.0", [{"D",[{"J",[]}]}, + {"E",[{"I","1.0.0",[]}]}]}, + {"B", "1.0.0", [{"F",[]}, {"G",[]}]}, - {"C", "1", [{"H",[]}]} + {"C", "1.0.0", [{"H",[]}]} ], ["C","I"], - {"C", [{"A","1"}, "D", "J", "E", {"I","1"}, - {"B","1"}, "F", "G", - {"C","1"}, "H"]}}; + {"C", [{"A","1.0.0"}, "D", "J", "E", {"I","1.0.0"}, + {"B","1.0.0"}, "F", "G", + {"C","1.0.0"}, "H"]}}; upgrades(tree_c2) -> - {[{"A", "1", [{"D",[{"J",[]}]}, - {"E",[{"I","1",[]}]}]}, - {"B", "1", [{"F",[]}, + {[{"A", "1.0.0", [{"D",[{"J",[]}]}, + {"E",[{"I","1.0.0",[]}]}]}, + {"B", "1.0.0", [{"F",[]}, {"G",[]}]}, - {"C", "1", [{"H",[]}, - {"I","2",[]}]} + {"C", "1.0.0", [{"H",[]}, + {"I","2.0.0",[]}]} ], - [{"A", "1", [{"D",[{"J",[]}]}, - {"E",[{"I","1",[]}]}]}, - {"B", "1", [{"F",[]}, + [{"A", "1.0.0", [{"D",[{"J",[]}]}, + {"E",[{"I","1.0.0",[]}]}]}, + {"B", "1.0.0", [{"F",[]}, {"G",[]}]}, - {"C", "1", [{"H",[{"K",[]}]}, - {"I","2",[]}]} + {"C", "1.0.0", [{"H",[{"K",[]}]}, + {"I","2.0.0",[]}]} ], ["C", "H"], - {"C", [{"A","1"}, "D", "J", "E", - {"B","1"}, "F", "G", - {"C","1"}, "H", {"I", "2"}, "K"]}}; + {"C", [{"A","1.0.0"}, "D", "J", "E", + {"B","1.0.0"}, "F", "G", + {"C","1.0.0"}, "H", {"I", "2.0.0"}, "K"]}}; upgrades(tree_cj) -> - {[{"A", "1", [{"D",[{"J", "1",[]}]}, - {"E",[{"I","1",[]}]}]}, - {"B", "1", [{"F",[]}, + {[{"A", "1.0.0", [{"D",[{"J", "1.0.0",[]}]}, + {"E",[{"I","1.0.0",[]}]}]}, + {"B", "1.0.0", [{"F",[]}, {"G",[]}]}, - {"C", "1", [{"H",[]}, - {"I","1",[]}]} + {"C", "1.0.0", [{"H",[]}, + {"I","1.0.0",[]}]} ], - [{"A", "1", [{"D",[{"J", "2", []}]}, - {"E",[{"I","1",[]}]}]}, - {"B", "1", [{"F",[]}, + [{"A", "1.0.0", [{"D",[{"J", "2.0.0", []}]}, + {"E",[{"I","1.0.0",[]}]}]}, + {"B", "1.0.0", [{"F",[]}, {"G",[]}]}, - {"C", "1", [{"H",[]}, - {"I","1",[]}]} + {"C", "1.0.0", [{"H",[]}, + {"I","1.0.0",[]}]} ], ["C","J"], - {"C", [{"A","1"}, "D", {"J", "1"}, "E", {"I","1"}, - {"B","1"}, "F", "G", - {"C","1"}, "H"]}}; + {"C", [{"A","1.0.0"}, "D", {"J", "1.0.0"}, "E", {"I","1.0.0"}, + {"B","1.0.0"}, "F", "G", + {"C","1.0.0"}, "H"]}}; upgrades(tree_ac) -> - {[{"A", "1", [{"D",[{"J",[]}]}, - {"E",[{"I","1",[]}]}]}, - {"B", "1", [{"F",[]}, + {[{"A", "1.0.0", [{"D",[{"J",[]}]}, + {"E",[{"I","1.0.0",[]}]}]}, + {"B", "1.0.0", [{"F",[]}, {"G",[]}]}, - {"C", "1", [{"H",[]}, - {"I","2",[]}]} + {"C", "1.0.0", [{"H",[]}, + {"I","2.0.0",[]}]} ], - [{"A", "1", [{"D",[{"J",[]}]}, - {"E",[{"I","1",[]}]}]}, - {"B", "1", [{"F",[]}, + [{"A", "1.0.0", [{"D",[{"J",[]}]}, + {"E",[{"I","1.0.0",[]}]}]}, + {"B", "1.0.0", [{"F",[]}, {"G",[]}]}, - {"C", "1", [{"H",[]}]} + {"C", "1.0.0", [{"H",[]}]} ], ["C","I"], - {"C, A", [{"A","1"}, "D", "J", "E", {"I","1"}, - {"B","1"}, "F", "G", - {"C","1"}, "H"]}}; + {"C, A", [{"A","1.0.0"}, "D", "J", "E", {"I","1.0.0"}, + {"B","1.0.0"}, "F", "G", + {"C","1.0.0"}, "H"]}}; upgrades(tree_all) -> - {[{"A", "1", [{"D",[{"J",[]}]}, - {"E",[{"I","1",[]}]}]}, - {"B", "1", [{"F",[]}, + {[{"A", "1.0.0", [{"D",[{"J",[]}]}, + {"E",[{"I","1.0.0",[]}]}]}, + {"B", "1.0.0", [{"F",[]}, {"G",[]}]}, - {"C", "1", [{"H",[]}, - {"I","2",[]}]} + {"C", "1.0.0", [{"H",[]}, + {"I","2.0.0",[]}]} ], - [{"A", "1", [{"D",[{"J",[]}]}, - {"E",[{"I","1",[]}]}]}, - {"B", "1", [{"F",[]}, + [{"A", "1.0.0", [{"D",[{"J",[]}]}, + {"E",[{"I","1.0.0",[]}]}]}, + {"B", "1.0.0", [{"F",[]}, {"G",[]}]}, - {"C", "1", [{"H",[]}]} + {"C", "1.0.0", [{"H",[]}]} ], ["C","I"], - {"", [{"A","1"}, "D", "J", "E", {"I","1"}, - {"B","1"}, "F", "G", - {"C","1"}, "H"]}}; + {"", [{"A","1.0.0"}, "D", "J", "E", {"I","1.0.0"}, + {"B","1.0.0"}, "F", "G", + {"C","1.0.0"}, "H"]}}; upgrades(delete_d) -> - {[{"A", "1", [{"B", [{"D", "1", []}]}, - {"C", [{"D", "2", []}]}]} + {[{"A", "1.0.0", [{"B", [{"D", "1.0.0", []}]}, + {"C", [{"D", "2.0.0", []}]}]} ], - [{"A", "2", [{"B", []}, + [{"A", "2.0.0", [{"B", []}, {"C", []}]} ], ["A","B", "C"], %% upgrade vs. new tree - {"", [{"A","2"}, "B", "C"]}}; + {"", [{"A","2.0.0"}, "B", "C"]}}; upgrades(promote) -> - {[{"A", "1", [{"C", "1", []}]}, - {"B", "1", [{"D", "1", []}]} + {[{"A", "1.0.0", [{"C", "1.0.0", []}]}, + {"B", "1.0.0", [{"D", "1.0.0", []}]} ], - [{"A", "2", [{"C", "2", []}]}, - {"B", "2", [{"D", "2", []}]}, - {"C", "3", []} + [{"A", "2.0.0", [{"C", "2.0.0", []}]}, + {"B", "2.0.0", [{"D", "2.0.0", []}]}, + {"C", "3.0.0", []} ], ["A","B","C","D"], - {"C", [{"A","1"},{"C","3"},{"B","1"},{"D","1"}]}}; + {"C", [{"A","1.0.0"},{"C","3.0.0"},{"B","1.0.0"},{"D","1.0.0"}]}}; upgrades(stable_lock) -> - {[{"A", "1", [{"C", "1", []}]}, - {"B", "1", [{"D", "1", []}]} + {[{"A", "1.0.0", [{"C", "1.0.0", []}]}, + {"B", "1.0.0", [{"D", "1.0.0", []}]} ], % lock after this - [{"A", "2", [{"C", "2", []}]}, - {"B", "2", [{"D", "2", []}]} + [{"A", "2.0.0", [{"C", "2.0.0", []}]}, + {"B", "2.0.0", [{"D", "2.0.0", []}]} ], [], %% Run a regular lock and no app should be upgraded - {"any", [{"A","1"},{"C","1"},{"B","1"},{"D","1"}]}}; + {"any", [{"A","1.0.0"},{"C","1.0.0"},{"B","1.0.0"},{"D","1.0.0"}]}}; upgrades(fwd_lock) -> - {[{"A", "1", [{"C", "1", []}]}, - {"B", "1", [{"D", "1", []}]} + {[{"A", "1.0.0", [{"C", "1.0.0", []}]}, + {"B", "1.0.0", [{"D", "1.0.0", []}]} ], - [{"A", "2", [{"C", "2", []}]}, - {"B", "2", [{"D", "2", []}]} + [{"A", "2.0.0", [{"C", "2.0.0", []}]}, + {"B", "2.0.0", [{"D", "2.0.0", []}]} ], ["A","B","C","D"], %% For this one, we should build, rewrite the lock %% file to include the result post-upgrade, and then %% run a regular lock to see that the lock file is respected %% in deps. - {"any", [{"A","2"},{"C","2"},{"B","2"},{"D","2"}]}}; + {"any", [{"A","2.0.0"},{"C","2.0.0"},{"B","2.0.0"},{"D","2.0.0"}]}}; upgrades(compile_upgrade_parity) -> - {[{"A", "1", [{"D",[{"J",[]}]}, - {"E",[{"I","1",[]}]}]}, - {"B", "1", [{"F",[]}, + {[{"A", "1.0.0", [{"D",[{"J",[]}]}, + {"E",[{"I","1.0.0",[]}]}]}, + {"B", "1.0.0", [{"F",[]}, {"G",[]}]}, - {"C", "1", [{"H",[]}, - {"I","2",[]}]} + {"C", "1.0.0", [{"H",[]}, + {"I","2.0.0",[]}]} ], [], [], - {"", [{"A","1"}, "D", "J", "E", {"I","1"}, - {"B","1"}, "F", "G", - {"C","1"}, "H"]}}; + {"", [{"A","1.0.0"}, "D", "J", "E", {"I","1.0.0"}, + {"B","1.0.0"}, "F", "G", + {"C","1.0.0"}, "H"]}}; upgrades(umbrella_config) -> - {[{"A", "1", []}], - [{"A", "2", []}], + {[{"A", "1.0.0", []}], + [{"A", "2.0.0", []}], ["A"], - {"A", [{"A","2"}]}}; + {"A", [{"A","2.0.0"}]}}; upgrades(profiles) -> %% Ensure that we can unlock deps under a given profile; %% B and C should both be in a custom profile %% and must not be locked. - {[{"A", "1", [{"D",[]}, - {"E","3",[]}]}, - {"B", "1", [{"F","1",[]}, + {[{"A", "1.0.0", [{"D",[]}, + {"E","3.0.0",[]}]}, + {"B", "1.0.0", [{"F","1.0.0",[]}, {"G",[]}]}, - {"C", "0", [{"H","3",[]}, + {"C", "0.0.0", [{"H","3.0.0",[]}, {"I",[]}]}], - [{"A", "2", [{"D",[]}, - {"E","2",[]}]}, - {"B", "2", [{"F","2",[]}, + [{"A", "2.0.0", [{"D",[]}, + {"E","2.0.0",[]}]}, + {"B", "2.0.0", [{"F","2.0.0",[]}, {"G",[]}]}, - {"C", "1", [{"H","4",[]}, + {"C", "1.0.0", [{"H","4.0.0",[]}, {"I",[]}]}], ["A","B","C","E","F","H"], - {"C", [{"A","1"}, "D", {"E","3"}, - {"B","2"}, {"F","2"}, "G", - {"C","1"}, {"H","4"}, "I"]}}; + {"C", [{"A","1.0.0"}, "D", {"E","3.0.0"}, + {"B","2.0.0"}, {"F","2.0.0"}, "G", + {"C","1.0.0"}, {"H","4.0.0"}, "I"]}}; upgrades(profiles_exclusion) -> %% Ensure that we can unlock deps under a given profile; %% B and C should both be in a custom profile %% and must not be locked. - {[{"A", "1", [{"D",[]}, - {"E","3",[]}]}, - {"B", "1", [{"F","1",[]}, + {[{"A", "1.0.0", [{"D",[]}, + {"E","3.0.0",[]}]}, + {"B", "1.0.0", [{"F","1.0.0",[]}, {"G",[]}]}, - {"C", "0", [{"H","3",[]}, + {"C", "0.0.0", [{"H","3.0.0",[]}, {"I",[]}]}], - [{"A", "2", [{"D",[]}, - {"E","2",[]}]}, - {"B", "2", [{"F","2",[]}, + [{"A", "2.0.0", [{"D",[]}, + {"E","2.0.0",[]}]}, + {"B", "2.0.0", [{"F","2.0.0",[]}, {"G",[]}]}, - {"C", "1", [{"H","4",[]}, + {"C", "1.0.0", [{"H","4.0.0",[]}, {"I",[]}]}], ["A","B","C","E","F","H"], - {"A", [{"A","1"}, "D", {"E","3"}, - {"B","2"}, {"F","2"}, "G", - {"C","1"}, {"H","4"}, "I"]}}. + {"A", [{"A","1.0.0"}, "D", {"E","3.0.0"}, + {"B","2.0.0"}, {"F","2.0.0"}, "G", + {"C","1.0.0"}, {"H","4.0.0"}, "I"]}}. %% TODO: add a test that verifies that unlocking files and then %% running the upgrade code is enough to properly upgrade things. -- cgit v1.1