Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid silently throwing error #290

Merged
merged 2 commits into from
Mar 6, 2017
Merged

Avoid silently throwing error #290

merged 2 commits into from
Mar 6, 2017

Conversation

lucafavatella
Copy link

I did not setup running tests locally yet, so opening PR so that any bots configured can do their job and in the meantime I will try to figure out how to run tests.

@lucafavatella
Copy link
Author

I used this code while testing inaka/sumo_db_riak#21 but I have not tested sumo_db in isolation yet. Hopefully tomorrow.

Of course if you feel confident to merge anyway, please go ahead.

With `throw`, tests of sumo_db_riak were failing locally for me with
the following error:

```
%%% basic_SUITE ==> find: SKIPPED
%%% basic_SUITE ==> {tc_auto_skip,
    {auto_skipped,{failed,{basic_SUITE,init_per_testcase,{error,0}}}}}
```

that does not provide information on the cause.

With `exit`, the same tests fail with:

```
%%% basic_SUITE ==> find: SKIPPED
%%% basic_SUITE ==> {tc_auto_skip,
    {auto_skipped,
        {failed,
            {basic_SUITE,init_per_testcase,
                {{error,0},
                 [{sumo,delete_all,1,
                      [{file,
                           "/Users/luca/dev/vuk/inaka_crud/sumo_db_riak/_build/default/lib/sumo_db/src/sumo.erl"},
                       {line,227}]},
                  {sumo_basic_test_helper,init_store,1,
                      [{file,
                           "/Users/luca/dev/vuk/inaka_crud/sumo_db_riak/_build/default/lib/sumo_db/src/adapter_test_helpers/sumo_basic_test_helper.erl"},
                       {line,165}]},
                  {basic_SUITE,init_per_testcase,2,
                      [{file,
                           "/Users/luca/dev/vuk/inaka_crud/sumo_db_riak/_build/test/lib/sumo_db_riak/test/basic_SUITE.erl"},
                       {line,51}]},
                  {test_server,do_init_per_testcase,2,
                      [{file,"test_server.erl"},{line,1297}]},
                  {test_server,run_test_case_eval1,6,
                      [{file,"test_server.erl"},{line,1007}]},
                  {test_server,run_test_case_eval,9,
                      [{file,"test_server.erl"},{line,977}]}]}}}}}
```

See also:
* inaka/erlang_guidelines#70
* inaka/erlang_guidelines#71
@lucafavatella
Copy link
Author

Rebased on PR #291 in order to benefit from CI running tests.

@lucafavatella lucafavatella changed the title [WORK IN PROGRESS] Avoid silently throwing error Avoid silently throwing error Mar 6, 2017
@lucafavatella
Copy link
Author

Travis CI finally triggered, I eye-balled the two jobs, look good and ready to merge. Open to comments though!

@elbrujohalcon elbrujohalcon merged commit 0172c67 into inaka:master Mar 6, 2017
@lucafavatella lucafavatella deleted the avaid-silent-throw branch March 7, 2017 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants