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

More error resilient test runner #2036

Merged
merged 4 commits into from
Nov 6, 2018
Merged

Conversation

arcusfelis
Copy link
Contributor

This PR addresses some errors, because test runner assumes that someone run it before. And it expects beam files of SUITEs to be available for spec generation and autocompletion.

Be aware, that with this patch travis test would stop, if redis-server is running without a docker container. Use --db in this case.

Later we can add code, that would test database options sanity before running any tests (gen_tcp connect? actually probing connection with some library? idk).

Ensures that test-runner spec expansion works properly on first run

Fails test-runner, if big SUITE cannot be compiled
Generate specs after big tests are compiled
@mongoose-im

This comment has been minimized.

@michalwski michalwski closed this Nov 5, 2018
@michalwski michalwski reopened this Nov 5, 2018
@codecov
Copy link

codecov bot commented Nov 5, 2018

Codecov Report

Merging #2036 into master will increase coverage by 1.89%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2036      +/-   ##
==========================================
+ Coverage   75.06%   76.95%   +1.89%     
==========================================
  Files         315      351      +36     
  Lines       28675    37929    +9254     
==========================================
+ Hits        21524    29189    +7665     
- Misses       7151     8740    +1589
Impacted Files Coverage Δ
src/mongoose_riak.erl 44.11% <0%> (-51.72%) ⬇️
src/pubsub/nodetree_tree.erl 16.32% <0%> (-30.45%) ⬇️
src/mongoose_client_api_sse.erl 57.77% <0%> (-7.94%) ⬇️
...c/global_distrib/mod_global_distrib_connection.erl 72.88% <0%> (-6.19%) ⬇️
...rc/global_distrib/mod_global_distrib_transport.erl 47.05% <0%> (-5.89%) ⬇️
src/mam/mod_mam_muc_odbc_async_pool_writer.erl 62.76% <0%> (-4.26%) ⬇️
src/mam/mod_mam_odbc_prefs.erl 92.52% <0%> (-3.74%) ⬇️
src/mod_disco.erl 53.08% <0%> (-3.59%) ⬇️
src/mod_push_service_mongoosepush.erl 80% <0%> (-2.86%) ⬇️
src/rdbms/mongoose_rdbms_odbc.erl 75.8% <0%> (-2.68%) ⬇️
... and 133 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e1eb536...43f2fdf. Read the comment docs.

@mongoose-im
Copy link
Collaborator

mongoose-im commented Nov 5, 2018

5810.1 / Erlang 19.3 / small_tests / 7172d25
Reports root / small


5810.3 / Erlang 19.3 / mysql_redis / 7172d25
Reports root/ big
OK: 2887 / Failed: 1 / User-skipped: 222 / Auto-skipped: 0

mod_global_distrib_SUITE:mod_global_distrib:test_pm_with_ungraceful_reconnection_to_different_server
{error,
  {{assertion_failed,assert,is_chat_message,
     [<<"Hi again from Europe1!">>],
     {xmlel,<<"message">>,
       [{<<"from">>,<<"alicE0.501035@localhost/res1">>},
        {<<"to">>,<<"eve0.469205@localhost">>},
        {<<"xml:lang">>,<<"en">>},
        {<<"type">>,<<"chat">>},
        {<<"id">>,<<"-576459798885834869">>}],
       [{xmlel,<<"body">>,[],[{xmlcdata,<<"Hi from Europe1!">>}]}]},
     "<message from='alicE0.501035@localhost/res1' to='eve0.469205@localhost' xml:lang='en' type='chat' id='-576459798885834869'><body>Hi from Europe1!</body></message>"},
   [{escalus_new_assert,assert_true,2,
      [{file,
         "/home/travis/build/esl/MongooseIM/big_tests/_build/default/lib/escalus/src/escalus_new_assert.erl"},
       {line,84}]},
    {mod_global_distrib_SUITE,
      '-test_pm_with_ungraceful_reconnection_to_different_server/1-fun-0-',
      4,
      [{file,"mod_global_distrib_SUITE.erl"},{line,613}]},
    {escalus_story,story,4,
      [{file,
         "/home/travis/build/esl/MongooseIM/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
       {line,72}]},
    {test_server,ts_tc,3,[{file,"test_server.erl"},{line,1529}]},
    {test_server,run_test_case_eval1,6,
      [{file,"test_server.erl"},{line,1045}]},
    {test_server,run_test_case_eval,9,
      [{file,"test_server.erl"},{line,977}]}]}}

Report log


5810.2 / Erlang 19.3 / internal_mnesia / 7172d25
Reports root/ big
OK: 1103 / Failed: 0 / User-skipped: 51 / Auto-skipped: 0


5810.4 / Erlang 19.3 / odbc_mssql_mnesia / 7172d25
Reports root/ big
OK: 2888 / Failed: 0 / User-skipped: 208 / Auto-skipped: 0


5810.5 / Erlang 19.3 / ldap_mnesia / 7172d25
Reports root/ big
OK: 1068 / Failed: 0 / User-skipped: 86 / Auto-skipped: 0


5810.6 / Erlang 19.3 / elasticsearch_and_cassandra_mnesia / 7172d25
Reports root/ big
OK: 445 / Failed: 0 / User-skipped: 8 / Auto-skipped: 0


5810.8 / Erlang 20.0 / pgsql_mnesia / 7172d25
Reports root/ big / small
OK: 2920 / Failed: 0 / User-skipped: 176 / Auto-skipped: 0


5810.9 / Erlang 21.0 / riak_mnesia / 7172d25
Reports root/ big / small
OK: 1326 / Failed: 0 / User-skipped: 49 / Auto-skipped: 0

@michalwski
Copy link
Contributor

@arcusfelis could you explain this paragraph:

Be aware, that with this patch travis test would stop, if redis-server is running without a docker container. Use --db in this case.

I see that both big tests with preset mysql_redis and small tests' ejabberd_sm_SUITE with redis backend passed even though redis on travis is not run in docker.

@arcusfelis
Copy link
Contributor Author

@michalslaski More like:
Be aware, that with this patch travis-test.sh script would exit with error on database setup step because of port conflict, if it can't bind port (i.e. it's already in use, most likely by regular redis-server daemon). Basically, it tries to start redis in a docker container => failed to bind the port => complain about it (before it was just ignore the error).

Basically, the problem with the current behavior is it kinda confusing not to see redis in docker ps, if it's already running without a container.

if you provide --db option without redis in it, we would not try to start it from the test runner script. I.e. something like --db mysql. In such case we would just use the one you already have.

Alternative behavior WOULD be (need to be coded, if we want it) to skip starting some database, if the port is already used by something.

@michalwski michalwski merged commit 0a0d847 into master Nov 6, 2018
@fenek fenek added this to the 3.1.0++ milestone Nov 8, 2018
@michalwski michalwski deleted the more-error-resilient-test-runner branch August 26, 2019 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants