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

Enable CircleCI Test Insights #3899

Merged
merged 4 commits into from
Dec 21, 2022
Merged

Enable CircleCI Test Insights #3899

merged 4 commits into from
Dec 21, 2022

Conversation

chrzaszcz
Copy link
Member

@chrzaszcz chrzaszcz commented Dec 9, 2022

The goal is to enable CircleCI Test Insights for big tests, that can automatically detect flaky and most failing tests.

This can be achieved by using the cth_surefire common test hook.
However, the hook contained a few bugs, so:

  1. cth_surefire is copied from Erlang/OTP to big tests.
  2. The fixes are applied.

When reviewing, check the last commit to see the diff in cth_surefire.

Here you can see the Insights in action:

Screenshot of a flaky test from reports:

@mongoose-im

This comment was marked as outdated.

@mongoose-im

This comment was marked as outdated.

@codecov
Copy link

codecov bot commented Dec 9, 2022

Codecov Report

Base: 83.16% // Head: 83.13% // Decreases project coverage by -0.03% ⚠️

Coverage data is based on head (199f1b4) compared to base (e528541).
Patch has no changes to coverable lines.

❗ Current head 199f1b4 differs from pull request most recent head 651bdd5. Consider uploading reports for the commit 651bdd5 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3899      +/-   ##
==========================================
- Coverage   83.16%   83.13%   -0.04%     
==========================================
  Files         535      535              
  Lines       34112    34112              
==========================================
- Hits        28370    28359      -11     
- Misses       5742     5753      +11     
Impacted Files Coverage Δ
src/mongoose_cleaner.erl 60.00% <0.00%> (-10.00%) ⬇️
src/async_pools/mongoose_aggregator_worker.erl 63.33% <0.00%> (-5.01%) ⬇️
src/pubsub/node_pep.erl 77.77% <0.00%> (-1.86%) ⬇️
src/ejabberd_s2s_out.erl 62.53% <0.00%> (-0.75%) ⬇️
src/pubsub/mod_pubsub_db_mnesia.erl 92.40% <0.00%> (-0.43%) ⬇️
src/pubsub/mod_pubsub_db_rdbms.erl 95.09% <0.00%> (-0.26%) ⬇️
src/mod_muc_room.erl 78.68% <0.00%> (-0.06%) ⬇️
src/mod_muc_log.erl 62.82% <0.00%> (ø)
src/inbox/mod_inbox_rdbms_async.erl 72.05% <0.00%> (ø)
src/global_distrib/mod_global_distrib_receiver.erl 79.51% <0.00%> (ø)
... and 2 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@mongoose-im

This comment was marked as outdated.

@chrzaszcz chrzaszcz force-pushed the circleci-test-insights branch 2 times, most recently from 294b791 to bcdc6fb Compare December 9, 2022 16:18
@mongoose-im

This comment was marked as outdated.

@mongoose-im

This comment was marked as outdated.

@mongoose-im

This comment was marked as outdated.

@mongoose-im

This comment was marked as outdated.

@mongoose-im

This comment was marked as outdated.

@mongoose-im

This comment was marked as outdated.

@mongoose-im

This comment was marked as outdated.

@chrzaszcz chrzaszcz force-pushed the circleci-test-insights branch 2 times, most recently from 7ac75c6 to 5ec1fc5 Compare December 12, 2022 08:12
@mongoose-im

This comment was marked as outdated.

@chrzaszcz chrzaszcz changed the title Experiment with CircleCI Test Insights Enable CircleCI Test Insights Dec 15, 2022
@mongoose-im

This comment was marked as outdated.

@mongoose-im

This comment was marked as outdated.

@mongoose-im

This comment was marked as outdated.

@mongoose-im

This comment was marked as outdated.

@mongoose-im

This comment was marked as outdated.

@mongoose-im

This comment was marked as outdated.

@mongoose-im

This comment was marked as outdated.

@mongoose-im
Copy link
Collaborator

mongoose-im commented Dec 21, 2022

small_tests_24 / small_tests / 199f1b4
Reports root / small


small_tests_25 / small_tests / 199f1b4
Reports root / small


dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / 199f1b4
Reports root/ big
OK: 4177 / Failed: 0 / User-skipped: 88 / Auto-skipped: 0


ldap_mnesia_24 / ldap_mnesia / 199f1b4
Reports root/ big
OK: 2223 / Failed: 0 / User-skipped: 823 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / 199f1b4
Reports root/ big
OK: 4177 / Failed: 0 / User-skipped: 88 / Auto-skipped: 0


ldap_mnesia_25 / ldap_mnesia / 199f1b4
Reports root/ big
OK: 2223 / Failed: 0 / User-skipped: 823 / Auto-skipped: 0


dynamic_domains_mysql_redis_25 / mysql_redis / 199f1b4
Reports root/ big
OK: 4151 / Failed: 0 / User-skipped: 114 / Auto-skipped: 0


internal_mnesia_25 / internal_mnesia / 199f1b4
Reports root/ big
OK: 2365 / Failed: 0 / User-skipped: 681 / Auto-skipped: 0


pgsql_mnesia_24 / pgsql_mnesia / 199f1b4
Reports root/ big
OK: 4551 / Failed: 0 / User-skipped: 97 / Auto-skipped: 0


elasticsearch_and_cassandra_25 / elasticsearch_and_cassandra_mnesia / 199f1b4
Reports root/ big
OK: 2723 / Failed: 0 / User-skipped: 662 / Auto-skipped: 0


dynamic_domains_mssql_mnesia_25 / odbc_mssql_mnesia / 199f1b4
Reports root/ big
OK: 4177 / Failed: 0 / User-skipped: 88 / Auto-skipped: 0


riak_mnesia_24 / riak_mnesia / 199f1b4
Reports root/ big
OK: 2561 / Failed: 0 / User-skipped: 654 / Auto-skipped: 0


mysql_redis_25 / mysql_redis / 199f1b4
Reports root/ big
OK: 4537 / Failed: 0 / User-skipped: 111 / Auto-skipped: 0


pgsql_mnesia_25 / pgsql_mnesia / 199f1b4
Reports root/ big
OK: 4551 / Failed: 0 / User-skipped: 97 / Auto-skipped: 0


mssql_mnesia_25 / odbc_mssql_mnesia / 199f1b4
Reports root/ big
OK: 4550 / Failed: 1 / User-skipped: 97 / Auto-skipped: 0

s2s_SUITE:node1_tls_optional_node2_tls_required_trusted_with_cachain:simple_message
{error,
  {timeout_when_waiting_for_stanza,
    [{escalus_client,wait_for_stanza,
       [{client,<<"alice_simple_message_3127@fed1/res1">>,escalus_tcp,
          <0.5214.3>,
          [{event_manager,<0.5089.3>},
           {server,<<"fed1">>},
           {username,<<"alice_simple_message_3127">>},
           {resource,<<"res1">>}],
          [{event_client,
             [{event_manager,<0.5089.3>},
            {server,<<"fed1">>},
            {username,<<"alice_simple_message_3127">>},
            {resource,<<"res1">>}]},
           {resource,<<"res1">>},
           {username,<<"alice_simple_message_3127">>},
           {server,<<"fed1">>},
           {host,<<"localhost">>},
           {port,5242},
           {auth,{escalus_auth,auth_plain}},
           {wspath,undefined},
           {username,<<"alice_simple_message_3127">>},
           {server,<<"fed1">>},
           {host,<<"localhost">>},
           {port,5242},
           {password,<<"makota2">>},
           {stream_id,<<"ce7d29a601539f30">>}]},
        10000],
       [{file,
          "/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
        {line,136}]},
     {s2s_SUITE,'-simple_message/1-fun-0-',2,
       [{file,"/home/circleci/project/big_tests/tests/s2s_SUITE.erl"},
        {line,128}]},
     {escalus_story,story,4,
       [{file,
          "/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
        {line,72}]},
     {test_server,ts_tc,3,[{file...

Report log

@mongoose-im
Copy link
Collaborator

mongoose-im commented Dec 21, 2022

small_tests_24 / small_tests / 046fe28
Reports root / small


small_tests_25 / small_tests / 046fe28
Reports root / small


dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / 046fe28
Reports root/ big
OK: 4177 / Failed: 0 / User-skipped: 88 / Auto-skipped: 0


ldap_mnesia_24 / ldap_mnesia / 046fe28
Reports root/ big
OK: 2223 / Failed: 0 / User-skipped: 823 / Auto-skipped: 0


pgsql_mnesia_24 / pgsql_mnesia / 046fe28
Reports root/ big
OK: 4551 / Failed: 0 / User-skipped: 97 / Auto-skipped: 0


dynamic_domains_mysql_redis_25 / mysql_redis / 046fe28
Reports root/ big
OK: 4151 / Failed: 0 / User-skipped: 114 / Auto-skipped: 0


ldap_mnesia_25 / ldap_mnesia / 046fe28
Reports root/ big
OK: 2223 / Failed: 0 / User-skipped: 823 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / 046fe28
Reports root/ big
OK: 4177 / Failed: 0 / User-skipped: 88 / Auto-skipped: 0


elasticsearch_and_cassandra_25 / elasticsearch_and_cassandra_mnesia / 046fe28
Reports root/ big
OK: 2723 / Failed: 0 / User-skipped: 662 / Auto-skipped: 0


riak_mnesia_24 / riak_mnesia / 046fe28
Reports root/ big
OK: 2561 / Failed: 0 / User-skipped: 654 / Auto-skipped: 0


internal_mnesia_25 / internal_mnesia / 046fe28
Reports root/ big
OK: 2365 / Failed: 0 / User-skipped: 681 / Auto-skipped: 0


dynamic_domains_mssql_mnesia_25 / odbc_mssql_mnesia / 046fe28
Reports root/ big
OK: 4177 / Failed: 0 / User-skipped: 88 / Auto-skipped: 0


pgsql_mnesia_25 / pgsql_mnesia / 046fe28
Reports root/ big
OK: 4562 / Failed: 1 / User-skipped: 97 / Auto-skipped: 0

pep_SUITE:pep_tests:unsubscribe_after_presence_unsubscription
{error,
  {{badmatch,
     [{xmlel,<<"message">>,
        [{<<"from">>,
        <<"alice_unsubscribe_after_presence_unsubscription_2694@localhost">>},
         {<<"to">>,
        <<"bob_unsubscribe_after_presence_unsubscription_2694@localhost/res1">>},
         {<<"type">>,<<"headline">>}],
        [{xmlel,<<"event">>,
           [{<<"xmlns">>,
           <<"http://jabber.org/protocol/pubsub#event">>}],
           [{xmlel,<<"items">>,
            [{<<"node">>,<<"DtHw9RnkY1WhFECpTyhZ5g==">>}],
            [{xmlel,<<"item">>,
               [{<<"id">>,<<"salmon">>}],
               [{xmlel,<<"entry">>,
                  [{<<"xmlns">>,
                  <<"http://www.w3.org/2005/Atom">>}],
                  []}]}]}]},
         {xmlel,<<"headers">>,
           [{<<"xmlns">>,<<"http://jabber.org/protocol/shim">>}],
           []}]}]},
   [{pep_SUITE,'-unsubscribe_after_presence_unsubscription/1-fun-0-',2,
      [{file,"/home/circleci/project/big_tests/tests/pep_SUITE.erl"},
       {line,384}]},
    {escalus_story,story,4,
      [{file,
         "/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
       {line,72}]},
    {test_server,ts_tc,3,[{file,"test_server.erl"},{line,1782}]},
    {test_server,run_test_case_eval1,6,
      [{file,"test_server.erl"},{line,1291}]},
    {test_server,run_test_case_eval,9,
      [{file,"test_server.erl"},{line,1223}]}]}}

Report log


mysql_redis_25 / mysql_redis / 046fe28
Reports root/ big
OK: 4537 / Failed: 0 / User-skipped: 111 / Auto-skipped: 0


mssql_mnesia_25 / odbc_mssql_mnesia / 046fe28
Reports root/ big
OK: 4562 / Failed: 1 / User-skipped: 97 / Auto-skipped: 0

pep_SUITE:pep_tests:unsubscribe_after_presence_unsubscription
{error,
  {{badmatch,
     [{xmlel,<<"message">>,
        [{<<"from">>,
        <<"alice_unsubscribe_after_presence_unsubscription_2656@localhost">>},
         {<<"to">>,
        <<"bob_unsubscribe_after_presence_unsubscription_2656@localhost/res1">>},
         {<<"type">>,<<"headline">>}],
        [{xmlel,<<"event">>,
           [{<<"xmlns">>,
           <<"http://jabber.org/protocol/pubsub#event">>}],
           [{xmlel,<<"items">>,
            [{<<"node">>,<<"rOkgTOpRJ9lXhQwUhgIKjA==">>}],
            [{xmlel,<<"item">>,
               [{<<"id">>,<<"salmon">>}],
               [{xmlel,<<"entry">>,
                  [{<<"xmlns">>,
                  <<"http://www.w3.org/2005/Atom">>}],
                  []}]}]}]},
         {xmlel,<<"headers">>,
           [{<<"xmlns">>,<<"http://jabber.org/protocol/shim">>}],
           []}]}]},
   [{pep_SUITE,'-unsubscribe_after_presence_unsubscription/1-fun-0-',2,
      [{file,"/home/circleci/project/big_tests/tests/pep_SUITE.erl"},
       {line,384}]},
    {escalus_story,story,4,
      [{file,
         "/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
       {line,72}]},
    {test_server,ts_tc,3,[{file,"test_server.erl"},{line,1782}]},
    {test_server,run_test_case_eval1,6,
      [{file,"test_server.erl"},{line,1291}]},
    {test_server,run_test_case_eval,9,
      [{file,"test_server.erl"},{line,1223}]}]}}

Report log

@chrzaszcz chrzaszcz marked this pull request as ready for review December 21, 2022 10:53
Copy link

@kamilwaz kamilwaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍, just one small comment.

big_tests/Makefile Outdated Show resolved Hide resolved
The goal is to add the 'cth_surefire' hook, which will collect test
results for CircleCI Insights.
The Insights need results in the JUnit XML format.
This is achieved by using the 'cth_surefire' hook.
- Support parallel test failures
- Close groups when end_per_suite is skipped or fails
- Include group name in error messages
@mongoose-im
Copy link
Collaborator

mongoose-im commented Dec 21, 2022

small_tests_24 / small_tests / 651bdd5
Reports root / small


small_tests_25 / small_tests / 651bdd5
Reports root / small


ldap_mnesia_24 / ldap_mnesia / 651bdd5
Reports root/ big
OK: 2223 / Failed: 0 / User-skipped: 823 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / 651bdd5
Reports root/ big
OK: 4177 / Failed: 0 / User-skipped: 88 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / 651bdd5
Reports root/ big
OK: 4177 / Failed: 0 / User-skipped: 88 / Auto-skipped: 0


dynamic_domains_mysql_redis_25 / mysql_redis / 651bdd5
Reports root/ big
OK: 4150 / Failed: 1 / User-skipped: 114 / Auto-skipped: 0

muc_SUITE:hibernation:hibernated_room_can_be_queried_for_archive
{error,{{assertion_failed,assert,is_groupchat_message,
              [<<"Restorable message">>],
              undefined,"undefined"},
    [{escalus_new_assert,assert_true,2,
               [{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_new_assert.erl"},
                {line,84}]},
     {muc_SUITE,wait_for_mam_result,3,
          [{file,"/home/circleci/project/big_tests/tests/muc_SUITE.erl"},
           {line,4394}]},
     {muc_SUITE,'-hibernated_room_can_be_queried_for_archive/1-fun-0-',3,
          [{file,"/home/circleci/project/big_tests/tests/muc_SUITE.erl"},
           {line,4130}]},
     {escalus_story,story,4,
            [{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
             {line,72}]},
     {muc_SUITE,hibernated_room_can_be_queried_for_archive,1,
          [{file,"/home/circleci/project/big_tests/tests/muc_SUITE.erl"},
           {line,4126}]},
     {test_server,ts_tc,3,[{file,"test_server.erl"},{line,1782}]},
     {test_server,run_test_case_eval1,6,
            [{file,"test_server.erl"},{line,1291}]},
     {test_server,run_test_case_eval,9,
            [{file,"test_server.erl"},{line,1223}]}]}}

Report log


ldap_mnesia_25 / ldap_mnesia / 651bdd5
Reports root/ big
OK: 2223 / Failed: 0 / User-skipped: 823 / Auto-skipped: 0


pgsql_mnesia_24 / pgsql_mnesia / 651bdd5
Reports root/ big
OK: 4551 / Failed: 0 / User-skipped: 97 / Auto-skipped: 0


dynamic_domains_mssql_mnesia_25 / odbc_mssql_mnesia / 651bdd5
Reports root/ big
OK: 4176 / Failed: 1 / User-skipped: 88 / Auto-skipped: 0

inbox_extensions_SUITE:regular:one_to_one:pagination:max_queries_can_fetch_ahead
{error,
  {timeout_when_waiting_for_stanza,
    [{escalus_client,wait_for_stanza,
       [{client,
          <<"[email protected]/res1">>,
          escalus_tcp,<0.11021.1>,
          [{event_manager,<0.10994.1>},
           {server,<<"domain.example.com">>},
           {username,<<"mike_max_queries_can_fetch_ahead_1538">>},
           {resource,<<"res1">>}],
          [{event_client,
             [{event_manager,<0.10994.1>},
            {server,<<"domain.example.com">>},
            {username,<<"mike_max_queries_can_fetch_ahead_1538">>},
            {resource,<<"res1">>}]},
           {resource,<<"res1">>},
           {username,<<"mike_max_queries_can_fetch_ahead_1538">>},
           {server,<<"domain.example.com">>},
           {host,<<"localhost">>},
           {port,5222},
           {auth,{escalus_auth,auth_plain}},
           {wspath,undefined},
           {username,<<"mike_max_queries_can_fetch_ahead_1538">>},
           {server,<<"domain.example.com">>},
           {host,<<"localhost">>},
           {password,<<"nicniema">>},
           {stream_id,<<"b7b0be8e60d58937">>}]},
        5000],
       [{file,
          "/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
        {line,136}]},
     {inbox_helper,'-given_conversations_between/2-fun-1-',4,
       [{file,"/home/circleci/project/big_tests/tests/inbox_helper.erl"},
        {line,543}]},
     {lists,foldl_1,3,[{file,"lists.erl"},{line,1355}]...

Report log


elasticsearch_and_cassandra_25 / elasticsearch_and_cassandra_mnesia / 651bdd5
Reports root/ big
OK: 2723 / Failed: 0 / User-skipped: 662 / Auto-skipped: 0


internal_mnesia_25 / internal_mnesia / 651bdd5
Reports root/ big
OK: 2365 / Failed: 0 / User-skipped: 681 / Auto-skipped: 0


riak_mnesia_24 / riak_mnesia / 651bdd5
Reports root/ big
OK: 2561 / Failed: 0 / User-skipped: 654 / Auto-skipped: 0


pgsql_mnesia_25 / pgsql_mnesia / 651bdd5
Reports root/ big
OK: 4551 / Failed: 0 / User-skipped: 97 / Auto-skipped: 0


mysql_redis_25 / mysql_redis / 651bdd5
Reports root/ big
OK: 4537 / Failed: 0 / User-skipped: 111 / Auto-skipped: 0


mssql_mnesia_25 / odbc_mssql_mnesia / 651bdd5
Reports root/ big
OK: 4551 / Failed: 0 / User-skipped: 97 / Auto-skipped: 0

@kamilwaz kamilwaz merged commit ca30c6a into master Dec 21, 2022
@kamilwaz kamilwaz deleted the circleci-test-insights branch December 21, 2022 14:05
@jacekwegr jacekwegr added this to the 6.1.0 milestone Apr 26, 2023
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.

4 participants