-
Notifications
You must be signed in to change notification settings - Fork 428
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
CETS support for components #4047
Conversation
small_tests_24 / small_tests / fabb9a9 small_tests_25 / small_tests / fabb9a9 small_tests_25_arm64 / small_tests / fabb9a9 ldap_mnesia_24 / ldap_mnesia / fabb9a9 dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / fabb9a9 ldap_mnesia_25 / ldap_mnesia / fabb9a9 dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / fabb9a9 dynamic_domains_mysql_redis_25 / mysql_redis / fabb9a9 pgsql_mnesia_24 / pgsql_mnesia / fabb9a9 dynamic_domains_mssql_mnesia_25 / odbc_mssql_mnesia / fabb9a9 pgsql_mnesia_25 / pgsql_mnesia / fabb9a9 internal_mnesia_25 / internal_mnesia / fabb9a9 elasticsearch_and_cassandra_25 / elasticsearch_and_cassandra_mnesia / fabb9a9 pgsql_cets_25 / pgsql_cets / fabb9a9 mysql_redis_25 / mysql_redis / fabb9a9 mssql_mnesia_25 / odbc_mssql_mnesia / fabb9a9 |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## feature/cets #4047 +/- ##
================================================
- Coverage 82.22% 82.18% -0.05%
================================================
Files 542 546 +4
Lines 34023 34052 +29
================================================
+ Hits 27976 27985 +9
- Misses 6047 6067 +20
☔ View full report in Codecov by Sentry. |
small_tests_25_arm64 / small_tests / d74ee8b small_tests_24 / small_tests / d74ee8b small_tests_25 / small_tests / d74ee8b dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / d74ee8b ldap_mnesia_24 / ldap_mnesia / d74ee8b dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / d74ee8b pgsql_mnesia_24 / pgsql_mnesia / d74ee8b ldap_mnesia_25 / ldap_mnesia / d74ee8b dynamic_domains_mysql_redis_25 / mysql_redis / d74ee8b dynamic_domains_mssql_mnesia_25 / odbc_mssql_mnesia / d74ee8b internal_mnesia_25 / internal_mnesia / d74ee8b elasticsearch_and_cassandra_25 / elasticsearch_and_cassandra_mnesia / d74ee8b mssql_mnesia_25 / odbc_mssql_mnesia / d74ee8b mysql_redis_25 / mysql_redis / d74ee8b pgsql_mnesia_25 / pgsql_mnesia / d74ee8b pgsql_cets_25 / pgsql_cets / d74ee8b |
small_tests_24 / small_tests / d22d39f small_tests_25 / small_tests / d22d39f small_tests_25_arm64 / small_tests / d22d39f ldap_mnesia_24 / ldap_mnesia / d22d39f dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / d22d39f ldap_mnesia_25 / ldap_mnesia / d22d39f dynamic_domains_mysql_redis_25 / mysql_redis / d22d39f dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / d22d39f pgsql_mnesia_24 / pgsql_mnesia / d22d39f dynamic_domains_mssql_mnesia_25 / odbc_mssql_mnesia / d22d39f internal_mnesia_25 / internal_mnesia / d22d39f elasticsearch_and_cassandra_25 / elasticsearch_and_cassandra_mnesia / d22d39f pgsql_cets_25 / pgsql_cets / d22d39f mysql_redis_25 / mysql_redis / d22d39f jingle_SUITE:all:jingle_session_is_established_and_terminated_by_initiator{error,
{{assertion_failed,assert,is_iq_result,
{xmlel,<<"iq">>,
[{<<"from">>,
<<"bob_jingle_session_is_established_and_terminated_by_initiator_1556@localhost">>},
{<<"to">>,
<<"alice_jingle_session_is_established_and_terminated_by_initiator_1556@localhost/res1">>},
{<<"id">>,<<"c5adc44f-3fa3-434f-9ffb-795141e2e757">>},
{<<"type">>,<<"set">>}],
[{xmlel,<<"jingle">>,
[{<<"xmlns">>,<<"urn:xmpp:jingle:1">>},
{<<"action">>,<<"session-info">>},
{<<"sid">>,<<"e8b1f23f-972c-4839-bf9e-0d436234196b">>}],
[{xmlel,<<"ringing">>,
[{<<"xmlns">>,<<"urn:xmpp:jingle:apps:rtp:info:1">>}],
[]}]}]},
"<iq from='bob_jingle_session_is_established_and_terminated_by_initiator_1556@localhost' to='alice_jingle_session_is_established_and_terminated_by_initiator_1556@localhost/res1' id='c5adc44f-3fa3-434f-9ffb-795141e2e757' type='set'><jingle xmlns='urn:xmpp:jingle:1' action='session-info' sid='e8b1f23f-972c-4839-bf9e-0d436234196b'><ringing xmlns='urn:xmpp:jingle:apps:rtp:info:1'/></jingle></iq>"},
[{escalus_new_assert,assert_true,2,
[{file,
"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_new_assert.erl"},
{line,84}]},
{jingle_SUITE,send_initiate_and_wait_for_first_iq_set,2,
[{file,"/home/circleci/project/big_tests/tests/jingle_SUITE.erl"},
{line,389}]},
{jingle_SUITE,initiate_jingle_session,2,
... jingle_SUITE:all:jingle_session_is_established_for_full_jids_on_different_nodes{error,
{{assertion_failed,assert,is_iq_result,
{xmlel,<<"iq">>,
[{<<"from">>,
<<"clusterguy_jingle_session_is_established_for_full_jids_on_different_nodes_1554@localhost">>},
{<<"to">>,
<<"alice_jingle_session_is_established_for_full_jids_on_different_nodes_1554@localhost/res1">>},
{<<"id">>,<<"b9634bd5-55fc-4ded-93a1-94d5abe921c4">>},
{<<"type">>,<<"set">>}],
[{xmlel,<<"jingle">>,
[{<<"xmlns">>,<<"urn:xmpp:jingle:1">>},
{<<"action">>,<<"session-info">>},
{<<"sid">>,<<"c1af7162-4f25-4586-ad46-63e3036dd1cf">>}],
[{xmlel,<<"ringing">>,
[{<<"xmlns">>,<<"urn:xmpp:jingle:apps:rtp:info:1">>}],
[]}]}]},
"<iq from='clusterguy_jingle_session_is_established_for_full_jids_on_different_nodes_1554@localhost' to='alice_jingle_session_is_established_for_full_jids_on_different_nodes_1554@localhost/res1' id='b9634bd5-55fc-4ded-93a1-94d5abe921c4' type='set'><jingle xmlns='urn:xmpp:jingle:1' action='session-info' sid='c1af7162-4f25-4586-ad46-63e3036dd1cf'><ringing xmlns='urn:xmpp:jingle:apps:rtp:info:1'/></jingle></iq>"},
[{escalus_new_assert,assert_true,2,
[{file,
"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_new_assert.erl"},
{line,84}]},
{jingle_SUITE,send_initiate_and_wait_for_first_iq_set,2,
[{file,"/home/circleci/project/big_tests/tests/jingle_SUITE.erl"},
{line,389}]},
{jingle_SUIT... jingle_SUITE:all:jingle_session_initiate_is_resent_on_demand{error,
{{assertion_failed,assert,is_iq_result,
{xmlel,<<"iq">>,
[{<<"from">>,
<<"bob_jingle_session_initiate_is_resent_on_demand_1562@localhost">>},
{<<"to">>,
<<"alice_jingle_session_initiate_is_resent_on_demand_1562@localhost/res1">>},
{<<"id">>,<<"e7c2f2f8-81d4-4dc5-bdd8-d9e67c8bd298">>},
{<<"type">>,<<"set">>}],
[{xmlel,<<"jingle">>,
[{<<"xmlns">>,<<"urn:xmpp:jingle:1">>},
{<<"action">>,<<"session-info">>},
{<<"sid">>,<<"fe2e9d2a-9ecf-4563-8e02-e21e7b808371">>}],
[{xmlel,<<"ringing">>,
[{<<"xmlns">>,<<"urn:xmpp:jingle:apps:rtp:info:1">>}],
[]}]}]},
"<iq from='bob_jingle_session_initiate_is_resent_on_demand_1562@localhost' to='alice_jingle_session_initiate_is_resent_on_demand_1562@localhost/res1' id='e7c2f2f8-81d4-4dc5-bdd8-d9e67c8bd298' type='set'><jingle xmlns='urn:xmpp:jingle:1' action='session-info' sid='fe2e9d2a-9ecf-4563-8e02-e21e7b808371'><ringing xmlns='urn:xmpp:jingle:apps:rtp:info:1'/></jingle></iq>"},
[{escalus_new_assert,assert_true,2,
[{file,
"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_new_assert.erl"},
{line,84}]},
{jingle_SUITE,send_initiate_and_wait_for_first_iq_set,2,
[{file,"/home/circleci/project/big_tests/tests/jingle_SUITE.erl"},
{line,389}]},
{jingle_SUITE,initiate_jingle_session,2,
[{file,"/home/circleci/project/big_tests/tests/jingle_S... jingle_SUITE:all:resp_4xx_from_sip_proxy_results_in_session_terminate{error,
{{assertion_failed,assert,is_iq_result,
{xmlel,<<"iq">>,
[{<<"from">>,<<"error.480@localhost">>},
{<<"to">>,
<<"alice_resp_4xx_from_sip_proxy_results_in_session_terminate_1572@localhost/res1">>},
{<<"id">>,<<"ed3b3bfa-ed77-4326-8ff4-9208ff9c6659">>},
{<<"type">>,<<"set">>}],
[{xmlel,<<"jingle">>,
[{<<"xmlns">>,<<"urn:xmpp:jingle:1">>},
{<<"action">>,<<"session-terminate">>},
{<<"sid">>,<<"cdd6019c-e823-437e-b1dd-50926af573c9">>}],
[{xmlel,<<"reason">>,[],
[{xmlel,<<"general-error">>,[],[]},
{xmlel,<<"sip-error">>,
[{<<"code">>,<<"480">>}],
[{xmlcdata,<<"Temporarily Unavailable">>}]}]}]}]},
"<iq from='error.480@localhost' to='alice_resp_4xx_from_sip_proxy_results_in_session_terminate_1572@localhost/res1' id='ed3b3bfa-ed77-4326-8ff4-9208ff9c6659' type='set'><jingle xmlns='urn:xmpp:jingle:1' action='session-terminate' sid='cdd6019c-e823-437e-b1dd-50926af573c9'><reason><general-error/><sip-error code='480'>Temporarily Unavailable</sip-error></reason></jingle></iq>"},
[{escalus_new_assert,assert_true,2,
[{file,
"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_new_assert.erl"},
{line,84}]},
{jingle_SUITE,send_initiate_and_wait_for_first_iq_set,2,
[{file,"/home/circleci/project/big_tests/tests/jingle_SUITE.erl"},
{line,389}]},
{jingle_SUITE,
'-resp_... mssql_mnesia_25 / odbc_mssql_mnesia / d22d39f pgsql_mnesia_25 / pgsql_mnesia / d22d39f |
small_tests_24 / small_tests / eaef9da small_tests_25_arm64 / small_tests / eaef9da small_tests_25 / small_tests / eaef9da ldap_mnesia_24 / ldap_mnesia / eaef9da dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / eaef9da ldap_mnesia_25 / ldap_mnesia / eaef9da dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / eaef9da dynamic_domains_mssql_mnesia_25 / odbc_mssql_mnesia / eaef9da rest_client_SUITE:roster:add_and_remove_some_contacts_with_nonexisting{error,
{{badmatch,
{error,
{connection_step_failed,
{{escalus_session,authenticate},
{client,
<<"mike_add_and_remove_some_contacts_with_nonexisting_2643@domain.example.com/res1">>,
escalus_tcp,<0.24695.2>,undefined,
[{event_client,
[{event_manager,<0.24619.2>},
{server,<<"domain.example.com">>},
{username,
<<"mike_add_and_remove_some_contacts_with_nonexisting_2643">>},
{resource,<<"res1">>}]},
{resource,<<"res1">>},
{username,
<<"mike_add_and_remove_some_contacts_with_nonexisting_2643">>},
{server,<<"domain.example.com">>},
{host,<<"localhost">>},
{port,5222},
{auth,{escalus_auth,auth_plain}},
{wspath,undefined},
{username,
<<"mike_add_and_remove_some_contacts_with_nonexisting_2643">>},
{server,<<"domain.example.com">>},
{host,<<"localhost">>},
{password,<<"nicniema">>},
{stream_id,<<"89cd734222177268">>}]},
[{compression,false},
{starttls,true},
{stream_management,true},
{advanced_message_processing,true},
{client_state_indication,false},
{sasl_mechanisms,[<<"SCRAM-SHA-256">>,<<"PLAIN">>]},
{caps,undefined}]},
{timeout,auth_reply}}}},
[{escalus_story,'-start_ready_c... rest_client_SUITE:roster:add_contact_and_be_invited{error,{{assertion_failed,assert_many,false,
[is_roster_set,is_iq_result],
[],[]},
[{escalus_new_assert,assert_true,2,
[{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_new_assert.erl"},
{line,84}]},
{rest_client_SUITE,'-add_contact_and_be_invited/1-fun-1-',2,
[{file,"/home/circleci/project/big_tests/tests/rest_client_SUITE.erl"},
{line,1249}]},
{escalus_story,story,4,
[{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,72}]},
{rest_client_SUITE,add_contact_and_be_invited,1,
[{file,"/home/circleci/project/big_tests/tests/rest_client_SUITE.erl"},
{line,1227}]},
{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}]}]}} rest_client_SUITE:roster:add_and_remove{error,{{badmatch,{{<<"500">>,<<"Internal Server Error">>},<<>>}},
[{rest_client_SUITE,add_contact_check_roster_push,2,
[{file,"/home/circleci/project/big_tests/tests/rest_client_SUITE.erl"},
{line,1390}]},
{rest_client_SUITE,'-add_and_remove/1-fun-0-',2,
[{file,"/home/circleci/project/big_tests/tests/rest_client_SUITE.erl"},
{line,1301}]},
{escalus_story,story,4,
[{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,72}]},
{rest_client_SUITE,add_and_remove,1,
[{file,"/home/circleci/project/big_tests/tests/rest_client_SUITE.erl"},
{line,1294}]},
{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}]}]}} dynamic_domains_mysql_redis_25 / mysql_redis / eaef9da internal_mnesia_25 / internal_mnesia / eaef9da pgsql_cets_25 / pgsql_cets / eaef9da elasticsearch_and_cassandra_25 / elasticsearch_and_cassandra_mnesia / eaef9da pgsql_mnesia_25 / pgsql_mnesia / eaef9da mysql_redis_25 / mysql_redis / eaef9da mssql_mnesia_25 / odbc_mssql_mnesia / eaef9da dynamic_domains_mssql_mnesia_25 / odbc_mssql_mnesia / eaef9da |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work 👍 I like that along with the new backend there is a separation of responsibilities with the new mongoose_component
module. I left my few thoughts in the comments. Also, codecov is complaining that the node cleanup part is not covered by tests. Do you think there is a simple way of doing it? If it is not too complex then I think it is worth effort.
src/component/mongoose_component.erl
Outdated
Checks = lists:map(fun is_already_registered/1, Components), | ||
Zip = lists:zip(Components, Checks), | ||
ConfictDomains = | ||
[LDomain || {#external_component{domain = LDomain}, true} <- Zip], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I though of an alternative way of writing this which is more straightforward in my opinion:
ConflictComponents = lists:filter(fun is_already_registered/1, Components),
ConflictDomains = [LDomain || #external_component{domain = LDomain} <- ConflictComponents]
Use it if you also like it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks good in general. Could you add some description to the PR (or details in commit messages) about how you replaced the two ETS tables with one of type bag
and link to the PR for cets
introducing the support for bag
?
src/component/mongoose_component.erl
Outdated
assert_can_register_components(Components) -> | ||
Checks = lists:map(fun is_already_registered/1, Components), | ||
Zip = lists:zip(Components, Checks), | ||
ConfictDomains = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ConfictDomains = | |
ConflictDomains = |
Make mongoose_component_backend
eaef9da
to
8cda94d
Compare
small_tests_24 / small_tests / 8cda94d small_tests_25_arm64 / small_tests / 8cda94d small_tests_25 / small_tests / 8cda94d dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / 8cda94d ldap_mnesia_24 / ldap_mnesia / 8cda94d mod_global_distrib_SUITE:hosts_refresher:test_host_refreshing{error,
{{trees_for_connections_present,true,[{times,50,false}],ok},
[{mongoose_helper,do_wait_until,2,
[{file,"/home/circleci/project/big_tests/tests/mongoose_helper.erl"},
{line,371}]},
{mod_global_distrib_SUITE,test_host_refreshing,1,
[{file,
"/home/circleci/project/big_tests/tests/mod_global_distrib_SUITE.erl"},
{line,384}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1783}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1292}]},
{test_server,run_test_case_eval,9,
[{file,"test_server.erl"},{line,1224}]}]}} ldap_mnesia_25 / ldap_mnesia / 8cda94d dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / 8cda94d pgsql_mnesia_24 / pgsql_mnesia / 8cda94d mod_global_distrib_SUITE:hosts_refresher:test_host_refreshing{error,
{{trees_for_connections_present,true,[{times,50,false}],ok},
[{mongoose_helper,do_wait_until,2,
[{file,"/home/circleci/project/big_tests/tests/mongoose_helper.erl"},
{line,371}]},
{mod_global_distrib_SUITE,test_host_refreshing,1,
[{file,
"/home/circleci/project/big_tests/tests/mod_global_distrib_SUITE.erl"},
{line,384}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1783}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1292}]},
{test_server,run_test_case_eval,9,
[{file,"test_server.erl"},{line,1224}]}]}} dynamic_domains_mssql_mnesia_25 / odbc_mssql_mnesia / 8cda94d pgsql_cets_25 / pgsql_cets / 8cda94d dynamic_domains_mysql_redis_25 / mysql_redis / 8cda94d elasticsearch_and_cassandra_25 / elasticsearch_and_cassandra_mnesia / 8cda94d internal_mnesia_25 / internal_mnesia / 8cda94d pgsql_mnesia_25 / pgsql_mnesia / 8cda94d mssql_mnesia_25 / odbc_mssql_mnesia / 8cda94d mysql_redis_25 / mysql_redis / 8cda94d service_domain_db_SUITE:db:db_keeps_syncing_after_cluster_join{error,{test_case_failed,{[<<"example1.com">>],
[<<"example1.com">>,<<"example2.com">>]}}} ldap_mnesia_24 / ldap_mnesia / 8cda94d mysql_redis_25 / mysql_redis / 8cda94d pgsql_mnesia_24 / pgsql_mnesia / 8cda94d |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌
This PR addresses MIM-1929.
Proposed changes include:
Bag support in CETS esl/cets#3