Skip to content
This repository has been archived by the owner on May 12, 2018. It is now read-only.

Fix #267 (code path regression) #268

Merged
merged 2 commits into from Apr 24, 2014
Merged

Fix #267 (code path regression) #268

merged 2 commits into from Apr 24, 2014

Conversation

ghost
Copy link

@ghost ghost commented Apr 17, 2014

Since the introduction of -r/--recursive, deps were not properly added
to the code path when running ct, eunit, etc.

To fix that, pass a flag down to process_dir1 and conditionalize
execution of the command. This moves the decision into process_dir1
where we can decide to invoke preprocess/2 and postprocess/2 but not
execute the command.

Without this fix, you'd have to, for example, invoke 'rebar -r ct
skip_deps=true', if you wanted to run base_dir's ct suites with deps on
the code path (while skipping all non-base_dir ct suites).

So, with this patch applied, if you run
$ rebar ct
deps will be on the code path, and only base_dir's ct suites will be
tested.

If you want to test ct suites in base_dir and sub_dirs, you have to run
$ rebar -r ct skip_deps=true

If you want to test ct suites in all dirs, you have to run
$ rebar -r ct

The fix is not specific to ct and applies to all commands.

To be able to add inttest/code_path_no_recurse/deps, I had to fix
.gitignore. While at it, I've updated and fixed all entries.

@ghost ghost closed this Apr 17, 2014
@ghost ghost deleted the code-path-regression branch April 18, 2014 19:55
@ghost ghost restored the code-path-regression branch April 20, 2014 14:19
@ghost ghost reopened this Apr 20, 2014
@ghost ghost changed the title Fix code path regression Fix #267 (code path regression) Apr 20, 2014
* Fix arg order:
  The order of arguments got inconsistent over time. To fix that, use
  the same consistent order in all functions.

* Avoid one erlang:'++'/2 call in process_dir/6.

* Avoid lists:prefix/2 and atom_to_list/1 calls:
  We can easily avoid 2 lists:prefix/2 calls and one atom_to_list/1 call
  in execute/5 by passing in whether the command is a hook or not. The
  resulting code is simpler and easier to read.
@ferd
Copy link
Contributor

ferd commented Apr 21, 2014

I'd certainly like to see this one included as it has forced me to go back to using ERL_LIBS=deps ct_run on many projects where I depend on transitive dependencies to run tests.

@ghost
Copy link
Author

ghost commented Apr 21, 2014

@ferd have you tested the patch?

@ferd
Copy link
Contributor

ferd commented Apr 21, 2014

Nope, haven't taken the time yet. I'm on vacation finishing today. Avoiding code.

Since the introduction of -r/--recursive, deps were not properly added
to the code path when running ct, eunit, etc.

To fix that, pass a flag down to process_dir1 and conditionalize
execution of the command. This moves the decision into process_dir1
where we can decide to invoke preprocess/2 and postprocess/2 but not
execute the command.

Without this fix, you'd have to, for example, invoke 'rebar -r ct
skip_deps=true', if you wanted to run base_dir's ct suites with deps on
the code path (while skipping all non-base_dir ct suites).

So, with this patch applied, if you run
$ rebar ct
deps will be on the code path, and only base_dir's ct suites will be
tested.

If you want to test ct suites in base_dir and sub_dirs, you have to run
$ rebar -r ct skip_deps=true

If you want to test ct suites in all dirs, you have to run
$ rebar -r ct

The fix is not specific to ct and applies to all commands.

To be able to add inttest/code_path_no_recurse/deps, I had to fix
.gitignore. While at it, I've updated and fixed all entries.
@ferd
Copy link
Contributor

ferd commented Apr 24, 2014

I tested this locally with a couple of projects and can say it finally fixed the issue that kept forcing me to use ct_run instead of rebar ct.

+1.

jaredmorrow added a commit that referenced this pull request Apr 24, 2014
@jaredmorrow jaredmorrow merged commit a838a2e into rebar:master Apr 24, 2014
@ghost ghost deleted the code-path-regression branch April 24, 2014 13:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants