-suites argument: When ct suite is not found in dir, skip it instead of stopping. #284

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
6 participants
Contributor

arjan commented Aug 1, 2012

This allows rebar ct -suites=abc to work when you have a rebar setup with multiple sub_dirs.

Currently, rebar halts after it could not find the suite in the first dir. But the suite might be present in another dir (when sub_dirs contains multiple dirs).

This patch makes it so instead of halting, it prints a warning and continues with looking for the suite in the other sub_dirs.

Contributor

tuncer commented Aug 2, 2012

Looks reasonable in principle. @dizzyd @joewilliams?

@ghost ghost assigned tuncer Aug 2, 2012

Contributor

arjan commented Aug 6, 2012

@tuncer Are you still waiting on something before merging this request?

Contributor

tuncer commented Aug 6, 2012

Waiting for feedback from @joewilliams and @dizzyd.

Contributor

joewilliams commented Aug 6, 2012

+1

Contributor

ferd commented Aug 7, 2012

First, the use of throw is perfectly fine for this. It's an in-module exception that you know how to handle (return ok and show a message).

Second, this seems to be a good patch. Ideally it'd only complain if nothing is found, but the current structure appears to make this the best way to go about it.

+1

essen commented Aug 23, 2012

+1

ct: skip instead of halt on missing/unknown suite
This allows `rebar ct suites=abc` to consider all suites when
you have a rebar setup with multiple sub_dirs.

Previously, rebar halted after it could not find the suite in the
first dir. But the suite might be present in another dir (when
sub_dirs contains multiple dirs).

This commit makes it so instead of halting, it prints a warning and
continues with looking for the suite in the other `sub_dir`s.

Note -- This uses try/catch to cause the test to be skipped because
otherwise I needed to adjust the return values of 4 functions, the
code path is pretty deeply nested here. Otherwise the whole call chain
needed to be adjusted for this return value:

`run_test -> make_cmd -> get_suites -> find_suite_path`

IMHO, I think for exceptional cases like this it is fine to use throw;
specially since only the {skip} is catched and nothing else.
Contributor

arjan commented Oct 15, 2012

@tuncer any update here?

Contributor

tuncer commented Oct 15, 2012

Contributor

dizzyd commented Oct 31, 2012

I need to rebase this on master, but looks reasonable. Will look deeper this evening.

Contributor

dizzyd commented Nov 1, 2012

Rebased to master and merged.

@dizzyd dizzyd closed this Nov 1, 2012

mattsta pushed a commit to mattsta/rebar that referenced this pull request Jun 21, 2014

Merge pull request #284 from habibutsu/master
Error 'Command not found' when sname is used
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment