summaryrefslogtreecommitdiff
path: root/test/rebar_upgrade_SUITE.erl
Commit message (Collapse)AuthorAgeFilesLines
* Fix handling of transient locks during upgradeFred Hebert2019-03-151-2/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We currently have a problem in the handling of locks in the `upgrade <app>` command when a transitive dependency switches supervision trees. If we start with: A / \ B1 C | D | E And upgrade to: A / \ B2 C | | E D by calling `rebar3 upgrade b`, we would expect the ugprade command to do so directly. However we are currently left with the following lock file: A / \ B2 C | D | E This is _not_ critical since on the next run, the lock file is fixed automatically through an install-deps sequence. However, this is a jarring state in which to leave a project. The reason is that we proceed the following way to handle an upgrade: 1. pick the name of the chosen app, and unlock it if it's at the level 0 2. grab a list of all its current children (and their own) and unlock them 3. do the same for all the other unlocked dependencies 4. pass this new lock internal format to the get-deps provider in upgrade mode 5. take the result and save it to the lock file. What's interesting is that right now this yields invalid locks at step 3, because we have removed the lock on B1, but not on E (which we don't yet know is going to be a new child of the next B version until we fetch it) In step 4, we fetch dependencies, and in there we compare the pre-upgrade locks and fetch structure with those expected in the current lock state, and rebuild everything. The fix in this commit adds a check there where if the app is in the current lock set at a level deeper than the current one, the lock is forced to be refreshed as if it were not there. This lock would get refreshed on a blank run anyway since the current lock set would start empty (rather than pre-populated by `upgrade`), and the level-order traversal ensures that the locks remain safe in all cases. Fixes #2030
* support for hex v2, multiple repository fetching, private organizations (#1884)Tristan Sloughter2018-09-131-221/+221
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Cull default dep names in non-default upgradeFred Hebert2017-05-191-2/+26
| | | | | | Prevents showing false upgrade messages when upgrading in a non-default profile. Also shows an info message explaining default deps don't get updated in a non-default upgrade.
* Add test for upgrade of profile depsFred Hebert2017-05-071-2/+67
|
* Merge pull request #1207 from ferd/pkg-local-hash-lockFred Hebert2016-06-221-1/+8
|\ | | | | lock file contains expected hash for pkg dependencies
| * Make tests passFred Hebert2016-05-241-1/+8
| | | | | | | | | | Tests have broken as locks were expanded and auto-filled newer versions of lockfiles. This fixes them back.
* | Regression test showing the bug for umbrella appsFred Hebert2016-06-031-4/+48
|/ | | | | | | When the operation for an unlock takes place in the config of a umbrella application, the `unlock' provider does not see the dependency in the `deps' value of the config (since it only includes the deps at the root of the project) and ignores these.
* add test to not upgrade unrelated transitive dep during upgradeTristan Sloughter2015-09-261-1/+21
|
* only upgrade children and transitive children of dep being upgradedTristan Sloughter2015-09-261-2/+8
| | | | | | | | | | This commit replaces the method of upgrading by unlocking all transitive deps by one that utilizes the parent element of each app to only unlock transitive deps of children of the top level deps being upgraded. Additionally the run function of upgrade_SUITE is modified to only create the mock updates before the upgrade provider is run, instead of before any provider is run, which would cause improper behavior in install_deps.
* Add tests for mixed deps installsFred Hebert2015-08-161-4/+8
| | | | | Requires a rework of other test suites using the same dep-handling mechanism.
* upgrade depends on the lock provider and lock prv sets stateTristan Sloughter2015-08-021-6/+4
|
* Failing case for unstable upgrade lock filesFred Hebert2015-07-081-2/+32
|
* Fix upgrade of atom-only packagesFred Hebert2015-05-281-1/+33
| | | | they would always be left unfound otherwise.
* update stable_lock test from Fred's branchTristan Sloughter2015-05-211-1/+1
|
* Add tests for lock forwardingFred Hebert2015-05-211-2/+82
| | | | | | | | | | Lock forwarding is what happens when the file on disk are on a different version from what is specified in the lock file. Files on disk should be updated to respect what's in the lock file. A negative test has been added so that lock files that are outdated vis. the underlying git and packages but match files on disk do not get forwarded. This job is left to the `upgrade' command.
* handle transitive deps being promotedFred Hebert2015-04-241-2/+13
|
* Add tests and fixes for packages upgradesFred Hebert2015-02-231-6/+15
| | | | | | | | | | - Track level of packages properly, they're not level 0 anymore (this could yield an issue where a src dep takes precedence over a pkg dep) - Proper stable sort of vertices in the digraph module - PkgDeps no longer 'see themselves' when fetching and upgrading after locking themselves - Pkg Locks are added to pkg deps rather than source deps - Updating test cases to support pkg mocking on top of src mocking
* Reuse test code and drop duplicated stuffFred Hebert2015-02-231-45/+6
|
* fix order of top_level_deps function in ugprade_SUITETristan Sloughter2015-02-191-3/+3
|
* replace package management with hex.pmTristan Sloughter2015-02-171-5/+4
|
* Warnings for Deletions and friendly errorsFred Hebert2015-02-121-9/+28
| | | | | | | | | Apps that are no longer used are not automatically deleted, but we tell users it can be done. This is safer while we're not sure of the correctness of these messages. Error messages are added for transient dependencies and dependencies not found.
* Support multiple app upgrade & lock testsFred Hebert2015-02-111-5/+36
| | | | | | - Many apps is supported through and through - Not mentioning any app upgrades all apps - Locks are refreshed on disk and tested as such after an upgrade
* Fix testcases, add multi-app upgrade supportFred Hebert2015-02-111-10/+59
| | | | | | | | todo: - relock stuff - default to all apps needing upgrade - more tests? - pkgs?
* More progress on upgradesFred Hebert2015-02-111-4/+9
| | | | | | Only the most complex case is failing, where cross-dependencies would need to be refetched as an update clears an app of its dependencies and a different subtree should override it.
* Partial work + Failing testsFred Hebert2015-02-111-71/+257
| | | | | The problem with the current effort is handling of transitive dependency upgrades and possible values.
* WIPFred Hebert2015-02-111-0/+185
Test that all the correct locks are set for an upgrade run. Now to actually re-run the install deps and prove it works