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

Additional Common Test regression tests #580

Merged
merged 1 commit into from
Feb 19, 2016

Conversation

lrascao
Copy link
Contributor

@lrascao lrascao commented Jan 22, 2016

One test that checks for a failed make, another
that detects a failed test run when only one of several
suites fails.

@ghost
Copy link

ghost commented Jan 23, 2016

+1, but it seems to fail on anything older than R15.

@lrascao
Copy link
Contributor Author

lrascao commented Jan 24, 2016

In one of the test cases i have a test.spec file with the relative path of the test location:
{suites,"../itest",[test_SUITE, test2_SUITE]}.

This ../itestpath is correct since the erlang doc says (http://erlang.org/doc/apps/common_test/run_test_chapter.html#id77160):

Any relative paths specified in the test specification, will be relative to the directory which contains the 
test specification file, if ct_run -spec TestSpecFile ... or ct:run:test([{spec,TestSpecFile},...]) executes the 
test. The path will be relative to the top level log directory, if ct:run:testspec(TestSpec) executes the test.

however this doesn't seem to apply to versions older than R15 where what counts is the project root path and not the path of the location of the test spec.
This issue could probably be fixed in rebar so the user doesn't have to worry about writing tests specific for different OTP versions. Maybe we can check the otp version we're running and if below R15 make sure the dir exists and change the relative path.
@Tuncer do you agree?

@ghost
Copy link

ghost commented Jan 25, 2016

On 24 January 2016 at 16:58, Luis Rascão notifications@github.com wrote:

@Tuncer do you agree?

If it's as trivial as that, yes, the proposed solution sounds reasonable.

@lrascao lrascao force-pushed the feature/check_common_test_result branch 2 times, most recently from 47f80b4 to 88f1766 Compare February 15, 2016 14:10
@lrascao
Copy link
Contributor Author

lrascao commented Feb 15, 2016

It turns out that the solution was not as trivial as it seemed, it involved rewriting the .spec file since ct_run reads directly from it, this is not acceptable since it's a user file.
I ended up simply disabling the ct_test_fails for OTP versions older than R16.

@lrascao lrascao force-pushed the feature/check_common_test_result branch from 88f1766 to d2c1524 Compare February 15, 2016 14:24
One test that checks for a failed make, another
that detects a failed test run when only one of several
suites fails. The ct test fails is only applicable to OTP
versions older than R16 (inclusive), this is related to the way
older versions handle the test .spec files.
@lrascao lrascao force-pushed the feature/check_common_test_result branch from d2c1524 to fa571d3 Compare February 19, 2016 17:13
lrascao added a commit that referenced this pull request Feb 19, 2016
@lrascao lrascao merged commit 8a59272 into rebar:master Feb 19, 2016
@lrascao lrascao deleted the feature/check_common_test_result branch February 19, 2016 18:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
1 participant