| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This switch aborts the rebar3 run after the first test failure is
reported.
Since Common Test does not support this feature and it can be useful for
interactive development (a demand from one of the teams I work with), I
decided to add the feature as an experimental CT hook.
The hook notices any test failure, and forcefully aborts the current
script execution, but only during the initialization phase of the next
test; this ensure that all other hooks for a post-test failure have the
time to do things right.
The CT logs _will_ be interupted, and hooks of all kinds may also
suffer.
Since this might be a bit tricky to support internally, I will be fine
with a review that results in "no, Fred. Please test this in a project
plugin first" or if I get told to use profiles to mature the feature
(i.e. `rebar3 as failfast ct ...`) with a custom hook declaration.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
cth_readable 1.4.0 supports the new logger interface from OTP-21, which
likely breaks compatibility with R16 builds.
It also includes a new compact interface, displaying output such as:
===> Running Common Test suites...
%%% rebar_alias_SUITE: ......
%%% rebar_as_SUITE: ...........
%%% rebar_compile_SUITE:................................
............................
%%% rebar_compile_SUITE ==> test_name: SKIPPED
%%% rebar_compile_SUITE ==>
{tc_user_skip,"compile:env_compiler_options/0 available"}
..
%%% rebar_cover_SUITE: .............
%%% rebar_ct_SUITE: ....................................
Allowing to display more tests within less screen space.
This mode has been added to the ct_readable option under the name
'compact' (now supporting true | false | compact), and has been made
default for rebar3.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit adds a common test hook along with the cth_readable stuff
whose role is to track failing test cases, and create a test
specification out of them.
The test specification is dumped on disk at
_build/<profile>/logs/retry.spec and can be accessed by calling
'rebar3 ct --retry'. This will auto-load the spec file if it can be
found and re-run the failing cases.
If any other argument is found on the list specifying tests, the
'--retry' argument is ignored.
All code for this is marked as experimental in case we end up (keeping
and then) dropping the feature.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit adds a common test hook along with the cth_readable stuff
whose role is to track failing test cases, and create a test
specification out of them.
The test specification is dumped on disk at
_build/<profile>/logs/retry.spec and can be accessed by calling
'rebar3 ct --retry'. This will auto-load the spec file if it can be
found and re-run the failing cases.
If any other argument is found on the list specifying tests, the
'--retry' argument is ignored.
All code for this is marked as experimental in case we end up (keeping
and then) dropping the feature.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is based on issue #1517 where out of nowhere, CT has returned a
user's error code directly. This in turn caused a crashdump in rebar3
itself.
This patch handles the unexpected cases by:
a) not trying to format them
b) converting them to an error whenever they happen
The execution flow is still interrupted, but we should fail with a
clearer error than a crashdump.
|
|
|
|
|
|
| |
It can't even fetch packages from Hex anymore because of old SSL/TLS
libraries, and so it can't bootstrap anymore either. Plus R20 comes out
soon, and 5 major versions is quite enough.
|
| |
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
... before calling erlang:function_exported(ct_testspec,get_tests,1).
|
|
|
|
|
|
|
|
|
|
| |
Parse given test specs and add all spec- and suite directories as
extra_src_dirs in order to ensure that all these directories are
copied to the _build area and the suites are compiled.
Specs located in the project- or app root are explicitly copied to the
_build area in order to avoid recursive copying of the complete
directory tree.
|
| |
|
|
|
|
|
|
| |
This is a bugfix. It makes sure that the given path to a testspec is
translated so common_test will pick the spec from the _build
directory, and not from the source tree.
|
|
|
|
|
|
| |
This is necessary in order to automatically get the testspec included
as an artifact (i.e. copied to the _build dir) in the case when it is
stored in another directory than 'test'.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Bug: option 'spec' is not specifically handled when merging options
from the command line with options from rebar.config. Due to this, if
the config specifies a 'spec', then this will take precedence over any
'dir' and/or 'suite' on the command line.
This commit takes special care of all options that can be used to
select tests - meaning that if any of the options 'spec', 'dir',
'suite', 'group' or 'case' are specified on the command line, then all
'spec', 'dir', 'suite', 'group' and 'case' options in rebar.config
will be ignored.
|
|
|
|
| |
Some tricky changes in there but should be okay
|
| |
|
|
|
|
|
|
| |
`rebar3 ct --spec foo.spec,bar.spec,baz.spec` now works
also added support for the `join_specs` flag on the command line
|
|
|
|
|
| |
- restore path after loading applications,
- helpful comments.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
add definition of 'COMMON_TEST' macro to eunit provider
|
|
|
|
|
|
|
|
| |
The idea is that given we accept arbitrary config items for CT, we
should similarly be able to pass unsupported options and keep things
running.
However for unsupported options, a warning is very useful to have.
|
|\
| |
| | |
add support for common tests `include` flag
|
| | |
|
|\ \
| | |
| | | |
error on a cover spec in ct_opts
|
| | | |
|
| |/ |
|
|/ |
|
| |
|
|
|
|
| |
this ensures the project apps are compiled to `lib/` instead of `extras/`
|
|
|
|
| |
this allows repeated test suite names across apps without conflicts
|
|
|
|
|
|
|
|
| |
previously rebar3 dropped suites declared at the root of the project (via
`--suite=whatever_SUITE' probably) and warned. this was because the compiler
would recursively copy and compile everything in the directory indicated by
the test suite. this changes the copy mechanism to only copy erl source files
and directories that end with `_SUITE_data' into the `extras' dir in `_build'
|
| |
|
| |
|
|
|
|
|
|
|
| |
when `ct_opts`, `eunit_tests`, `eunit_first_files`, `ct_first_files`, `erl_first_files`,
`eunit_compile_opts`, `ct_compile_opts` and `erl_opts` have values that are single non-list
terms warn and try wrapping them in a list when processing them in the `eunit` and `ct`
providers
|
| |
|