summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
...
* | 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.
* Merge pull request #1756 from ferd/handle-schemeless-proxyFred Hebert2018-04-201-6/+8
|\ | | | | Handle Schema-less Proxy URLs in ENV vars
| * Add proxy auto-scheme testFred Hebert2018-04-201-6/+8
| |
* | (#1743): store the etags in cache filesLaszlo Toth2018-04-111-5/+12
|/
* sort-as: bar profile specializes dep "b" into a version anterior to what ↵Pierre Fenoll2018-03-021-1/+1
| | | | test profile wants
* Revert "sort-as: show issue more clearly"Pierre Fenoll2018-03-021-16/+3
| | | | This reverts commit 4ad1db97336a3ac070880876ada07d4c7b769327.
* sort-as: show issue more clearlyPierre Fenoll2018-03-021-3/+16
|
* rebar_package: do not return first package version for constraint with no matchTristan Sloughter2018-02-261-1/+9
|
* Merge pull request #1698 from campanja-forks/run-clean-hooksFred Hebert2018-02-211-2/+25
|\ | | | | fix hooks and plugins usage when cleaning build artifacts for deps
| * add test for provider_hook cleanCarl-Johan Kjellander2018-01-191-2/+25
| |
* | Issue #1704: Fix alias provider argument passingTobias Schlager2018-01-241-1/+26
|/ | | | | | | | | | | | The way arguments are passed by the alias provider is not compatible with all rebar providers/commands. Especially the release (relx) provider does not like getting its arguments as a plain string. It expects its arguments in a pre-parsed format as returned by getopt:parse/2. Other commands, e.g. eunit, seem to be fine with both ways of argument passing. Therefore, this fix changes the alias provider argument passing to the getopt format in general.
* Fix escriptize failure when ebin/ has subdirsFred Hebert2017-12-141-2/+25
| | | | | | | | | | | Although fairly irregular, the presence of a subdirectory in ebin/ while running rebar3 escriptize would crash the run and generate a dump. Since ebin subdirectories are generally not supported (adding a path for an application only adds ebin/ and no subdirectories to the VM's path set), we just silently ignore the directory altogether. Fixes #1693
* Alias plugin promoted to built-in commandFred Hebert2017-12-051-0/+113
| | | | | | | | | | - Uses the code at https://github.com/tsloughter/rebar_alias and brings it within rebar3 - adds safety checks to prevent redefining built-in commands or obvious circular dependencies between commands (indirect circular deps are still possible) - adds tests - adds a systest to ensure no clash with the existing plugin
* Merge pull request #1679 from ferd/min-coverageFred Hebert2017-12-041-2/+48
|\ | | | | Support minimal coverage validation in tests
| * Support minimal coverage validation in testsFred Hebert2017-12-021-2/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds an option (-m, --min_coverage, or {cover_opts, {min_coverage,X}}) to the 'cover' command, where the value is an integer between 0 and 100. If the total coverage during the analysis is below the value received, the command will fail with output like: ===> Requiring 64% coverage to pass. Only 62% obtained If the rate is correct, the command silently passes as it currently does. This feature allows to enforce code coverage standards in a project if desired.
* | add eunit and ct option to set coverdata file nameTristan Sloughter2017-12-042-1/+43
| |
* | fix code path when validating pluginsTristan Sloughter2017-12-032-6/+31
|/
* Fix test mocking for profile overridesFred Hebert2017-11-211-2/+4
|
* Merge branch 'profile_dep_countertest' of https://github.com/lrascao/rebar3 ↵Fred Hebert2017-11-211-0/+15
|\ | | | | | | into lrascao-profile_dep_countertest
| * Profile deps counter testLuis Rascao2017-10-161-0/+15
| |
* | Make debug_info rules clearFred Hebert2017-11-201-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current rebar3 uses debug_info rules where debug_info is added by default, and no_debug_info prevents the default from being added, and removes any explicit debug_info, if any. The problem is that if 'no_debug_info' is anywhere in the config for a run, it cannot be removed even with other profiles. additionally, no_debug_info ignores special tuples like {debug_info, {Mod, Data}} and {debug_info_key, Key}, which can be used to add debug info and encrypt it (in lieu of plain debug_info) respectively. This patch makes it so that the following rules are in place: - the last option seen takes priority, allowing profile overrides by the ordering rules the compiler expects - the overriden options shall be explicitly deleted to avoid confusing the compiler - any option related to debug info seen last cancels any no_debug_info that preceded it - any no_debug_info option seen last cancels all of the other debug_info options - if debug_info is seen last, it cancels out {debug_info_key, Key} - if {debug_info_key, Key} is seen last, it cancels out debug_info - All other options are left untouched in that context (defines can still be expanded and so on) This should allow proper profile rules to be followed. Note that erl_opt profile merging puts precedence on the *last* element of a list, to match the compiler.
* | OTP-21 readiness, Full Unicode supportFred Hebert2017-11-166-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | This replaces all deprecated function usage by alternative ones based on a version switch enacted at compile time, preventing all warnings. This will likely introduce some possible runtime errors in using a Rebar3 compiled on OTP-20 or OTP-21 back in versions 19 and earlier, but we can't really work around that. A bunch of dependencies have been updated to support OTP-21 without warnings as well.
* | Fix include paths in profile multiapp edge caseFred Hebert2017-10-231-0/+35
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | The compiling of OTP applications is done by first topographically sorting them according to their dependencies, deps-first. This allows all compilation to take place in order. In the current code, the same logic extends to top-level applications in an umbrella project. Unfortunately, there are cases where this is not going to be true: when an application has extra_src_dirs entries (or additional directories or files) to conditionally compile under some profiles, it may start depending on another top-level application dedicated to that profile for include files. However, such an app will never make it to production and neither will the compilation artifacts that create the dependency. Under that scenario, current rebar3 is unusable. This patch makes it so that the compilation provider instead changes the logic for top-level apps: rather than copying their directories one by one and compiling them in order, it: 1. copies all top-level apps to the build directory so the files are in their proper locations 2. adds the top-level apps to the path (after the global hooks have run, so the existing scope and env has not changed) 3. runs the compilation as usual. Fixes #1651
* Add tests for unlock state passthroughFred Hebert2017-10-131-2/+5
|
* Bundle in debug for weak testFred Hebert2017-10-041-0/+3
| | | | Getting real tired of that nondeterministic set of runs on OSX CI
* Corrects a fix to src_dir valuesFred Hebert2017-09-271-2/+3
| | | | | | | | | | The previous patch at #7c959cc fixed the usage of duplicate values for directories through relative paths, but mistakenly went overboard and dropped the `./` path, which is still fairly common. Similarly for `../". The code is modified to special-case such values and keep the code working.
* Merge pull request #1625 from tsloughter/ct-sys-config-mergingFred Hebert2017-09-011-1/+11
|\ | | | | fix sys config merging
| * fix sys config mergingTristan Sloughter2017-09-011-1/+11
| |
* | Merge pull request #1624 from ferd/fix-rel-srcdirsFred Hebert2017-09-011-1/+1
|\ \ | |/ |/| Fix relative src_dir specifications to avoid double .app.src file detection
| * Fix relative src dir specificationsFred Hebert2017-08-301-1/+1
| | | | | | | | | | | | | | | | When fetching src_dir values, some relative paths can be inserted. When deduplicating the paths on the fetch, this fact means that logically duplicate (but literally different) directories can be returned at once. By normalizing the names, duplication bugs can be resolved.
* | Recompile when include files changesuexcxine2017-08-291-0/+49
|/
* Fix ordering of overlays and overlay vars in RelxFred Hebert2017-08-151-7/+33
| | | | | | | | | | | | | | | | | | | | | Specifically, this impacts profiles. It appears that relx as a whole requires its configuration to be merged in one tuple order (New takes precedence over Old), whereas the overlays require the opposite (Old takes precedence over New) since the operation order on disk is important to work well. This patch reorders overlay values such that the overlay of a profile takes place *after* the basic overlay, ensuring that the profile actions take place after the basic ones; this allows profiles to properly overwrite files as expected (see #1609) This is done while adequately maintaining the order of operations that were required as part of #1563 Overlay vars of profiles are also checked to be working fine, along with a test. This fixes #1247 and #1609
* Fix recursive profile merging in umbrella appsFred Hebert2017-08-111-1/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a config file exists at the root of a project, defines a given configuration value for a given profile, and that a sub-application (umbrella app) also has the same profile defined with the same key (but different values), the configuration values of the sub-application's profile would get silently dropped. The problem being that when the function to merge profiles is applied recursively, it is applied to each profile (so it will merge on the keys test, prod, etc.) rather than to each of the values of each profile. This patch reworks the profile merging so that the current behaviour is respected overall (a profile cannot be cancelled by a subdep's non-existant profile since its value should have been ignored), but ensures that sub-deps' profiles are otherwise applied recursively with the proper rules: - dependencies favor prior values - plugins favor new values - erl_first_files combine the lists - relx uses the tuple merge algorithm - erl_opts has its own custom merge as well - otherwise the new value takes precedence A test has also been added. There is a risk of breakage in some applications that may have relied on the buggy behaviour to work, though at this time we are aware of none of them.
* Merge pull request #1596 from ferd/local-apps-override-depsFred Hebert2017-08-091-1/+29
|\ | | | | Allow top-level apps to take precedence over deps
| * Allow top-level apps to take precedence over depsFred Hebert2017-08-051-1/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The use case has been described in issue #1478 where a local application can exist while being declared as a dependency as well. This allows, for example, to work on a release where all applications may require to be published independently, or to provide some form of 'vendoring' with a local app. The fix is done by decoupling the dependency source resolution form the dependency parsing. The reason for this being that the discovery phase needs to parse apps for their top-level deps, and dep installation needs to resolve the packages with accuracy. In the current implementation, both code paths call to the same function. This patch splits up the precise discovery and makes it happen *only* when installing dependencies, and only if a top-level app does not already define the application needing resolving. One weakness of this fix is that it necessarily breaks cycle detection in dependencies that involve a root application depending on itself since its own version as a dep will not be expanded. There appears to be no possible way to prevent this, but should be rare enough to be worth the tradeoff for the common case.
* | Unicode support in all the placesFred Hebert2017-08-063-7/+7
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | This is done through 3 main change groups: - replacing `~s` by `~ts` in format strings, so that strings that contain unicode are properly printed rather than crashing - adding the `unicode` argument to all function of the `re` module to ensure transformations on strings containing unicode data are valid instead of crashing (see issue #1302) - replacing `ec_cnv:to_binary/1` and `ec_cnv:to_list/1` with matching functions in `rebar_utils`. The last point has been done, rather than modifying and updating erlware commons, because binary and list conversions can be a contentious subject. For example, if what is being handled is actually bytes from a given binary stream, then forcing a byte-oriented interpretation of the data can corrupt it. As such, it does not appear safe to modify erlware commons' conversion functions since it may not be safe for all its users. Instead, rebar3 reimplements a subset of them (only converting atoms and chardata, ignoring numbers) with the explicit purpose of handling unicode string data. Tests were left as unchanged as possible. This may impact the ability to run rebar3's own suites in a unicode path, but respects a principle of least change for such a large patch.
* add ct compile_only test, checks for compiled appTristan Sloughter2017-07-141-2/+20
|
* Prevent xref crashes with undef behavioursFred Hebert2017-06-131-2/+44
| | | | | | | | | When a given behaviour module does not exist, rebar3 brutally crashes. This patch makes it so instead, there is a warning output menitoning the missing behaviour, and this one is omitted from the unused function calls check. This means that unused calls will instead be shown for the module implementing a non-existing behaviour, as if no behaviour were declared in the first place.
* Fix xref compile hook on depsFred Hebert2017-06-078-2/+182
| | | | | | | | | | | If xref analysis is being run by a dependency during its compilation phase, the xref provider will try to add that deps' parents to the check job while the ebin/ directories for them do not exist. This causes a crash. This patch makes it so directories are only added if they are existing, preventing failure on any compile hook for dependencies and allowing successful compilation as a best effort.
* Merge pull request #1564 from tsloughter/reset_profile_hooksTristan Sloughter2017-06-021-2/+16
|\ | | | | reset hooks under profiles for application opts
| * reset hooks under profiles for application optsTristan Sloughter2017-06-021-2/+16
| |
* | Avoid reversing relx overlays.Anthony Molinaro2017-06-011-0/+25
|/ | | | | This mostly moves a lists:reverse/1 which ensures that profile overlays are run first but keeps the order of overlays otherwise.
* Merge pull request #1540 from ferd/allow-profile-deps-upgradeFred Hebert2017-05-191-2/+91
|\ | | | | Allow profile deps upgrade
| * 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
| |
* | Bump cth_readable to 1.2.6Fred Hebert2017-05-121-1/+1
| | | | | | | | | | | | | | | | This fixes the output of end_per_testcase crash notifications when the test passes. This also detect an issue of the kind with rebar_pkg_SUITE which is now fixed.
* | Add tests for the first_files profile mergesFred Hebert2017-05-111-2/+23
|/
* eunit in 19.3 errors if `init_per_*` isn't paired with `end_per_*`alisdair sullivan2017-03-181-1/+4
|
* Allow single test spec in ct_optsSiri Hansen2017-03-061-2/+39
| | | | | | The option {spec,Specs} is allowed in ct_opts, but rebar_prv_common_test:test_dirs did not take into account that Specs could also be a string only, i.e. not a list of strings.