[erlang-questions] Rebar to run CT

Fred Hebert mononcqc@REDACTED
Thu Apr 30 15:53:30 CEST 2015

On 04/30, Roberto Ostinelli wrote:
>Dear List,
>I'm trying to use CT on Travis. Test run fine when run locally. I start
>them from the project root, and use rebar ct command.
>However, when I run then in Travis I get:
>WARN:  'ct' command does not apply to directory

This is a problem with rebar 2.x's model versus the directory structure 
you have. The one you have described here:

>-- myproject
>   rebar.config
>   |-- apps
>       |-- myapp
>           |-- src
>           |-- test
>       rebar.config
>   |-- deps
>       |-- dep1
>       |-- dep2
>   |-- ...

Works for a release, but rebar 2.x more or less expects OTP applications 
everywhere. Anything else and you need special configurations or 

In the case of ct for that one, you have to run `rebar ct -r' to run it 
recursively in all directories it finds, and then add `skip_deps=true' 
to avoid running it on all your dependencies. Final command is:

    rebar ct -r skip_deps=true

You'll still see a warning printed (when rebar looks for a `test/' 
directory at the root) but then it'll run the tests fine.

Rebar3 should take care of this and work fine on the first run, as we 
changed the model it uses to figure out structure of both OTP apps and 
releases and takes an app-based structure.


More information about the erlang-questions mailing list