summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* Ensure EDoc opts in umbrella apps are respectedFred Hebert2019-07-043-1/+11
| | | | | | | | | | | | | This adds an additional loading and merging of options for EDoc using the values from the top-level along with those specified in the rebar.config of an umbrella application. The app-specific config values are prepended to the global ones; this can likely cause some problems with manual path handling, but is unlikely to happen in practice and the rest seems to work fine based on order Fixes the issue in #2114
* Support rebar config dir env varBryan Paxton2019-06-301-1/+30
|
* Only lint app files when compilingFred Hebert2019-06-021-1/+0
| | | | | | | | This allows to reduce the number of noise to only checking deps' app files when they're built, rather than on every run. Since main apps and checkouts are still compiled every time, the linting takes place there and then with a higher frequency.
* Do not apply overrides to a root application.Fred Hebert2019-05-191-21/+52
| | | | | | | | | | | | | Overrides should apply to a layer below where they are declared. This patch makes it so if the project root is an application (i.e. it isn't 'root' and therefore not an umbrella project), we omit applying overrides in rebar_app_discover. This in turn required changing a bunch of tests, because all the tests worked with the idea that all overrides applied to all apps to validate that they get inherited properly. The changes re-structure the cases so they are written with an umbrella app, demonstrating that the changes stick.
* maybe a bit too exhaustive pattern matching to pass testsPierre Fenoll2019-05-062-8/+14
| | | | Signed-off-by: Pierre Fenoll <pierrefenoll@gmail.com>
* Merge pull request #2054 from tolbrino/fix-parallel-edoc-testFred Hebert2019-04-1813-22/+23
|\ | | | | Fix duplicate module naming in edoc test suite data
| * Fix duplicate module naming in edoc test suite dataTino Breddin2019-04-1613-22/+23
| |
* | Merge pull request #2035 from ankhers/lint_app_fileFred Hebert2019-04-161-2/+18
|\ \ | |/ |/| Add basic linting for .app file
| * Remove debuggingJustin Wood2019-04-161-2/+0
| |
| * test for app file lintingJustin Wood2019-04-041-2/+20
| |
* | support dialyzer plt location and prefix in cli argsTristan Sloughter2019-04-061-2/+39
| |
* | Refactor deps command to show lock vs config fileJose M Perez2019-04-011-6/+29
| | | | | | | | | | | | Deps command shows an * if the local state of the dependencies do not match the config file, highlighting the differences between the lock file and the config file if there are any.
* | Make deps command check needs_update for every depJose M Perez2019-03-271-2/+46
|/ | | | | deps command was printing an * even when deps were updated, this commit makes it call rebar_fetch:needs_update/2 for each of them
* 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
* Fix fetching of private packages from orgs on hex repos (#2020)Bryan Paxton2019-03-076-12/+27
| | | | | | | | | | | | | - vendor in hex_core at v0.5.0 - Change where repo_name should be the org and not the parent - Changed rebar_utils:url_append_path/2 to not explicitly add a '?', this is returned in the Query chunk by http_uri:parse/1 (e.g., "?foo=bar") - update organization_merging test to expect the sub-repo as the repo_name - Add tests for rebar_utils:url_append_path/2 - Stop referencing/setting "organization" in config and use new organization settings (api_repository and repo_organization) - Do not set (assume) the read key is valid for any/every repo - Set repo_organization and api_repository to org - Update tests to check for new config opts
* Abort when file:consult/1 returns an errorBryan Paxton2019-02-201-2/+39
| | | | | | - Modified rebar_hex_repos:auth_config/1 to abort on error except in the case of enoent, in which we return an empty map. - added auth_config_errors test to test/rebar_pkg_repos_SUITE
* Fix handling of updated files in extra_src_dirsFred Hebert2019-02-011-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change fixes cases where changes in .hrl files would not be picked up in .erl files that are in extra source directories (such as those defined with `extra_src_dirs` or modules in the test/ directory during a CT or Eunit run). The problem was due to the way the Directed Acyclic Graph (DAG) of dependencies between files was being loaded and stored by the compiler modules. Prior to this fix, a single DAG would be used for all runs. On a regular run, the prior DAG is loaded from disk, re-checked, and if changed, it would get re-written to disk with the changes deciding what to re-compile. However, whenever extra source directories were specified, a second run would be done which swaps target directories around in the compiler modules. Bug 1: this second run was done without properly tracking the private .hrl files (in src/), so the changes were invisible. This has been fixed by re-adding the paths. The problem is that the DAG handling is self-contained; just invoking it was sufficient to get it loaded and rewritten to disk. But since runs with extra src dirs were done on different sets, the compilation of extra src dirs would be done with bad historical data (all the modules in src/ are dropped, all those in test/ are re-added); this DAG was then written to disk once again, polluting the next non-extra run. This is bug 2, and it is fixed by adding an optional label to each run so that a regular or extra compile round can be distinguished, each tracking their own files in their own DAG. A single test (and a lot of diffing) were sufficient for this.
* add repo_name to repoconfig used with hex_core to be compatible (#1996)Tristan Sloughter2019-01-131-3/+5
|
* Merge pull request #1986 from ericmj/emj/mirror-ofFred Hebert2019-01-012-18/+18
|\ | | | | Update hex_core and add mirror_of repo config
| * Update hex_core and add mirror_of repo configEric Meadows-Jönsson2018-12-302-18/+18
| |
* | Add --generator option for eunitmopp2018-12-291-1/+34
|/
* check for mib_first_files regression in umbrella_mib_first_testStefan Grundmann2018-12-051-9/+57
| | | | | | | consider A-MIB imports from B-MIB: rebar compile MUST FAIL if mib_first_files is ["mibs/A-MIB.mib"] rebar compile MUST SUCCEED if mib_first_files is ["mibs/B-MIB.mib"]
* Support ignoring whole modules in xref resultsBryan Paxton2018-12-021-7/+34
| | | | | | | - Added support to rebar_prv_xref for filtering out whole module. A module may now be added to the list of xref_ignores in rebar.config or via -ignore_xref() module attribute - Added unit test for whole module filtering support to xref CT suite
* fix to include beams built from src files in subdirs in modules listTristan Sloughter2018-11-231-1/+7
|
* fix base path used for yrl/xrl includefile configs (#1952)Tristan Sloughter2018-11-231-2/+148
|
* Merge pull request #1938 from erlang/xrl-yrl-recompileFred Hebert2018-11-181-6/+19
|\ | | | | check last modified time on erl files for xrl and yrl files before compiling
| * check last modified time on erl files for xrl and yrl files before compilingTristan Sloughter2018-11-091-6/+19
| |
* | Support alias format {Namespace, Cmd} and {Namespace, Cmd, Args} (#1940)tothlac2018-11-171-2/+29
|/
* Fix shell hook expansion on windowsFred Hebert2018-10-181-3/+3
| | | | | | | | | | | Dollar Variable expansion (`$VAR`) was inadvertently disabled for windows variables, although %VARIABLES% already worked. This reduced the portability of hooks in general. Additionally, tests would fail on windows due to bad quoting of paths: the path C:/a/b/c would fail when passed to the command `cmd /q /c C:/a/b/c` because it would interpret /a /b and /c as 3 options. Using quotes makes the tests pass.
* Merge pull request #1907 from ferd/refactor-env-pathsFred Hebert2018-10-153-3/+244
|\ | | | | Refactor env path handling and fix some bugs related to it
| * Optimize path handlingFred Hebert2018-10-111-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Only set paths that need to be put as a priority - Clean up paths before leaving API mode The first point accounted for some performance cost, but the latter one explains the 40% overhead in test runs: since rebar3 calls rebar3 a lot with a bunch of fake apps, and that the new mechanism for path handling by default does not _remove_ paths, it just _orders_ them, we would end up in a situation where as the tests ran, more and more fake paths would get added to the VM. By the time the run was over, all path handling would take longer since more paths needed filtering every time. By resetting paths at the end of an API run, we prevent a given 'project' from polluting another one's runtime and performance once the API successfully returns.
| * Clean path code, add tests, add clash detectionFred Hebert2018-10-111-3/+34
| | | | | | | | Some finishing touch to that code
| * Abstracted path managementFred Hebert2018-10-113-3/+215
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move path management out of rebar_utils manual code path function handling (which we leave there for backwards compat), and centralize them to allow easier coordination of paths between plugins and deps. On top of path handling, do a check of loaded modules to only purge and reload those that actually need it done in order to prevent all kinds of weird interaction and accidental purge kills. It also allows the possible cohabitation of both at once, with a "in case of conflict pick X" as a policy Changing path handling in providers also highlighted a bunch of bugs in some tests and appears to fix some in other providers, specifically around plugins.
* | fix finding transitive deps with prerelease versions (#1914)Tristan Sloughter2018-10-141-5/+11
|/
* fix yrl compiler and add test (#1906)Tristan Sloughter2018-10-061-3/+20
|
* compiler behaviour (#1893)Tristan Sloughter2018-10-051-1/+1
| | | | | | | | | | | | | | | | * add compile type for dynamic project compilation * new rebar_compiler abstraction for running multiple compilers rebar_compiler is a new behaviour that a plugin can implement to be called on any ues of the compile provider to compile source files and keep track of their dependencies. * fix check that modules in .app modules list are from src_dirs * use project_type to find module for building projects * allow plugins to add project builders and compilers
* warn if the matched package is retired, skip prerelease (#1897)Tristan Sloughter2018-10-014-31/+76
| | | | | | | retired packages are now used the same as any other but a warning will be printed when it is resolved. prerelease versions are skipped unless explicitly given as the version in the constraint or lock file.
* properly support top level app erl_opts from REBAR_CONFIG os var (#1889)Tristan Sloughter2018-09-213-21/+101
| | | | | | When REBAR_CONFIG was set it would not effect the top level app's configuration because app_discover was rereading the top level rebar.config which ignored REBAR_CONFIG. Instead this patch has it use the existing configuration from REBAR_CONFIG.
* add option to compiler provider to only build dependencies (#1888)Tristan Sloughter2018-09-192-1/+28
|
* only print skip warning if version is different (#1886)Tristan Sloughter2018-09-171-2/+13
|
* support for hex v2, multiple repository fetching, private organizations (#1884)Tristan Sloughter2018-09-1316-565/+1029
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* run compile provider in default namespace from bareTristan Sloughter2018-06-081-1/+18
|
* Abort if erl_first_files is not a list of stringsBryan Paxton2018-06-081-2/+9
| | | | - resolves #1645
* Introduce support of add and del operations under erl_opts directiveAlexander Petrovsky2018-05-311-12/+375
|
* Fix override_deps test from suite rebar_compile_SUITEAlexander Petrovsky2018-05-301-6/+7
|
* Prevent copying or symlink non-existing src_dirsFred Hebert2018-04-271-3/+0
| | | | | | | | | | This would cause crashes on linux and force people to have a src_dirs config that is strictly matching what is on the file system rather than acting as a specification of those that are valid. To compare, if lib_dirs worked the same, then any repo that did not both have apps/ and lib/ would crash, as the spec mentions both options as valid.
* Merge branch 'feature_long_src_paths' of https://github.com/danikp/rebar3 ↵Fred Hebert2018-04-271-2/+22
|\ | | | | | | into danikp-feature_long_src_paths
| * fix & testDmitry2018-04-231-2/+22
| |
* | Clear all dialyzer errorsFred Hebert2018-04-231-1/+11
|/ | | | | - this is done by adding a HiPE dependency - also in this: adding a test for directories, and fixing some indent
* Fix precedence rules of erl_opts for test profileFred Hebert2018-04-201-0/+32
| | | | | | | | | | | | | | When adding the 'TEST' macro to the test profile, we mistakenly sourced the erl_opts values from the base profile rather than the test profile itself. This means that in cases where the base profile set an option such as 'no_debug_info' and a profile overrode it with 'debug_info', the default options would get injected within the test profile, and broke the precedence rules, yielding incompatible values. This patch fixes things by adding the macro to the values sourced from the test profile itself, fixing the issue.