Skip to content

ct fixes #130

Merged
merged 4 commits into from Jun 14, 2014

4 participants

@yamt
yamt commented Sep 1, 2013

No description provided.

@yamt
yamt commented Sep 1, 2013

this is a resubmit of basho/rebar#376

@tuncer tuncer commented on an outdated diff Sep 11, 2013
src/rebar_ct.erl
- filelib:fold_files(Cwd, Glob, true, fun collect_files/2, []).
-
-collect_files(F, Acc) ->
- %% Ignore any specs under the deps/ directory. Do this pulling
- %% the dirname off the the F and then splitting it into a list.
- Parts = filename:split(filename:dirname(F)),
- case lists:member("deps", Parts) of
- true ->
- Acc; % There is a directory named "deps" in path
- false ->
- [F | Acc] % No "deps" directory in path
- end.
+ CwdParts = filename:split(Cwd),
+ filelib:fold_files(Cwd, Glob, true, fun(F, Acc) ->
+ %% Ignore any specs under the deps/ directory. Do this pulling
+ %% the dirname off the the F and then splitting it into a list.
@tuncer
tuncer added a note Sep 11, 2013

While at it, do you mind fixing the double "the" (s/the the/the/)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@tuncer tuncer commented on an outdated diff Sep 11, 2013
src/rebar_ct.erl
- %% Ignore any specs under the deps/ directory. Do this pulling
- %% the dirname off the the F and then splitting it into a list.
- Parts = filename:split(filename:dirname(F)),
- case lists:member("deps", Parts) of
- true ->
- Acc; % There is a directory named "deps" in path
- false ->
- [F | Acc] % No "deps" directory in path
- end.
+ CwdParts = filename:split(Cwd),
+ filelib:fold_files(Cwd, Glob, true, fun(F, Acc) ->
+ %% Ignore any specs under the deps/ directory. Do this pulling
+ %% the dirname off the the F and then splitting it into a list.
+ Parts = filename:split(filename:dirname(F)),
+ Parts2 = remove_common_prefix(Parts, CwdParts),
+ case lists:member("deps", Parts2) of
@tuncer
tuncer added a note Sep 11, 2013

While at it, we should correct this code and use the effective deps dir which may not necessarily be the default "deps".
So, how about exporting rebar_deps:get_deps_dir/1 for internal use only by adding it here and reusing it in rebar_ct:collect_files/2? There may be other files where we should reuse get_deps_dir/1 for correctness.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@Vagabond
Vagabond commented Mar 5, 2014

ping, where are we on this?

@tuncer
tuncer commented May 29, 2014

@yamt ping?

yamt added some commits Aug 30, 2013
@yamt yamt Fix a format of a debug output 7fd5a2d
@yamt yamt Fix spec file look up
When trying to skip spec files under deps/ directory,
ignore "deps" component which is also included in Cwd.
For example, "/home/deps/src/myapp/test/cover.spec"
contains "deps" component but should not be skipped if
Cwd is "/home/deps/src/myapp/".
9713daf
@yamt yamt fix double "the" in a comment
noted by @tuncer
ad588a7
@yamt yamt use the effective deps dir instead of hardcoding "deps"
suggested by @tuncer
5e91322
@yamt
yamt commented May 30, 2014

pushed new versions

@tsloughter tsloughter merged commit 37cf470 into rebar:master Jun 14, 2014

1 check passed

Details continuous-integration/travis-ci The Travis CI build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.