ct: Not adding all dependencies #267

Closed
nifoc opened this Issue Apr 17, 2014 · 2 comments

Projects

None yet

2 participants

@nifoc
nifoc commented Apr 17, 2014

My application depends on lager (2.0.3) which in turn depends on goldrush. When running rebar ct skip_deps=true, the lager ebin folder (deps/lager/ebin) is correctly added to ct_run -pa ...

"ct_run -noshell
-pa \"/Users/daniel/Documents/Work/xxx/xxx_stats/ebin\"
\"/Users/daniel/Documents/Work/xxx/xxx_stats/deps/lager/ebin\"
\"/Users/daniel/.erlang_library/bin/rebar/rebar/ebin\"
\"/Users/daniel/.erlang_library/tools/rebar/rebar\"
\"/Users/daniel/Documents/Work/xxx/xxx_stats/.\" 
-include \"/Users/daniel/Documents/Work/xxx/xxx_stats/include\"
-name test@erlang
-logdir \"/Users/daniel/Documents/Work/xxx/xxx_stats/logs\"
-env TEST_DIR \"/Users/daniel/Documents/Work/xxx/xxx_stats/test\" 
-cover /Users/daniel/Documents/Work/xxx/xxx_stats/test/cover.spec
-dir test"

As you can see, the -pa switch does not reference the goldrush ebin folder (deps/goldrush/ebin), which causes application:start(goldrush) to return the following:

stats_SUITE:init_per_suite failed
Reason: {badmatch,{error,{"no such file or directory","goldrush.app"...}

Goldrush compiled just fine and when I look at deps/goldrush/ebin I can see the .app file.

$ rebar version
rebar 2.2.0 17 20140417_110110 git 2.1.0-115-g8edaa08
$ cat rebar.config
% Dependencies
{deps, [
  {lager, ".*", {git, "git://github.com/basho/lager.git", {tag, "2.0.3"}}}
]}.

% Set compiler flags
{erl_opts, [{parse_transform, lager_transform}]}.

% Cover
{cover_enabled, true}.
{cover_print_enabled, true}.

% Cleanup
{clean_files, ["*.eunit", "ebin/*.beam", "test/*.beam"]}.
Erlang/OTP 17 [erts-6.0] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]
nifoc commented Apr 17, 2014

rebar skip_deps=true ct -r fixed it.

@nifoc nifoc closed this Apr 17, 2014
@tuncer tuncer added a commit to tuncer/rebar that referenced this issue Apr 20, 2014
@tuncer tuncer Fix #267 (code path regression)
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 choose 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.
bb822d6
@tuncer tuncer added a commit to tuncer/rebar that referenced this issue Apr 20, 2014
@tuncer tuncer Fix #267 (code path regression)
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 choose 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.
56e4bec
@tuncer tuncer added a commit to tuncer/rebar that referenced this issue Apr 20, 2014
@tuncer tuncer Fix #267 (code path regression)
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 choose 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.
e7c1807
Contributor
tuncer commented Apr 20, 2014

That's a regression. Can you please test #268?

@tuncer tuncer added a commit to tuncer/rebar that referenced this issue Apr 20, 2014
@tuncer tuncer Fix #267 (code path regression)
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 choose 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.
0354355
@tuncer tuncer added a commit to tuncer/rebar that referenced this issue Apr 20, 2014
@tuncer tuncer Fix #267 (code path regression)
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 choose 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.
f00eaa4
@tuncer tuncer added a commit to tuncer/rebar that referenced this issue Apr 21, 2014
@tuncer tuncer Fix #267 (code path regression)
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.
121bce5
@tuncer tuncer added a commit to tuncer/rebar that referenced this issue Apr 23, 2014
@tuncer tuncer Fix #267 (code path regression)
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.
0d7d380
@tuncer tuncer added a commit to tuncer/rebar that referenced this issue Apr 23, 2014
@tuncer tuncer Fix #267 (code path regression)
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.
99fe270
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment