-
Notifications
You must be signed in to change notification settings - Fork 429
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
Merge GraphQL CLI to master #3714
Conversation
- Use introspection to gather all possible commands - Generate query docs and store them in a persistent term
GraphQL Admin CLI PoC
This is easier to understand: code 0 means no errors.
Reuse the existing test code for the HTTP API - now there is a 'protocol' option per test group, that can be 'http' or 'cli'. The query documents are generated for the HTTP API. There is an option to avoid this, but it would complicate the tests.
This way it is easier to control the error messages, and to print out additional hints. There is a plan to add more usage information in a new PR.
Test GraphQL CLI for accounts
Unions are returned for metrics and vCards. Also: limit type recursion to 2 levels, because vCards contain an 'agent' field that may contain a vCard. Withotu such limit query building would loop infinitely.
- Fix command argument format - Add a utility for skipping nested null values
- User groups have no suffixes - Admin groups have the http/cli suffixes - mongooseimctl shouldn't be run in parallel - it would fail sometimes
User tests remain unchanged
Support unions in GraphQL CLI
- Support queries and mutations without arguments, e.g. 'unregister' - Export build_specs/1 for use in big tests
The goal is to auto-generate the queries instead of having to manually code them in the big tests. Specs are generated once per test group and stored in a persistent term. Using Config would make test printouts huge.
Generate user queries in GraphQL tests
In this case CLI returns 1 as the exit status.
Also fix the test for old messages - it was actually working, because the previous test did not clean up the messages, and the new messages were not old enough. Now the cases are correct and more complete.
small_tests_24 / small_tests / c8d1e9d small_tests_25 / small_tests / c8d1e9d dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / c8d1e9d mongooseimctl_SUITE:stats:stats_global{error,{{badmatch,{"Unknown command 'uptimeseconds'. Available commands in category 'stats':\n domainStats\n globalStats\n",
1}},
[{mongooseimctl_SUITE,'-stats_global/1-fun-0-',3,
[{file,"/home/circleci/project/big_tests/tests/mongooseimctl_SUITE.erl"},
{line,1103}]},
{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,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_24 / ldap_mnesia / c8d1e9d dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / c8d1e9d mongooseimctl_SUITE:stats:stats_global{error,{{badmatch,{"Unknown command 'uptimeseconds'. Available commands in category 'stats':\n domainStats\n globalStats\n",
1}},
[{mongooseimctl_SUITE,'-stats_global/1-fun-0-',3,
[{file,"/home/circleci/project/big_tests/tests/mongooseimctl_SUITE.erl"},
{line,1103}]},
{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}]}]}} dynamic_domains_mysql_redis_25 / mysql_redis / c8d1e9d mam_SUITE:rdbms_async_cache_prefs_cases:end_per_group{error,
{{badrpc,
{'EXIT',
{{start_child_failed,
{error,
{{shutdown,
{failed_to_start_child,'pm_mam_async_pool_test type',
{shutdown,
{failed_to_start_child,
'wpool_pool-pm_mam_async_pool_test type-process-sup',
{shutdown,
{failed_to_start_child,
'wpool_pool-pm_mam_async_pool_test type-16',
{already_started,<9141.8949.1>}}}}}}},
{child,undefined,'pm_mam_sup_async_pool_test type',
{mongoose_async_pools,start_link,
[<<"test type">>,pm_mam,
#{batch_name => insert_mam_messages30,batch_size => 30,
enabled => true,
flush_callback => fun mod_mam_rdbms_arch_async:flush/2,
flush_extra =>
#{batch_name => insert_mam_messages30,batch_size => 30,
enabled => true,flush_interval => 2000,pool_size => 16},
flush_interval => 2000,pool_size => 16,pool_type => batch}]},
transient,false,infinity,supervisor,
[mongoose_async_pools]}}},
#{id => 'pm_mam_sup_async_pool_test type',restart => transient,
start =>
{mongoose_async_pools,start_link,
[<<"test type">>,pm_mam,
#{batch_name => insert_mam_messages30,batch_size => 30,
enabled => true,
flush_callback => fun mod_mam_rdbms_arch_async:flush/2,
flush_extra =>
#{batch_name => insert_mam_messages30,batch_size => 30,
enabled => true,flush_interval => 2000,pool_size => 16},
flush_interval => 2000,pool_size => 16,pool_type => batch}]},
type =... mam_SUITE:rdbms_async_cache_disabled_retraction:mam06:retract_message{error,{{archive_size,1,[{times,200,0}]},
[{mongoose_helper,do_wait_until,2,
[{file,"/home/circleci/project/big_tests/tests/mongoose_helper.erl"},
{line,371}]},
{mam_SUITE,'-test_retract_message/1-fun-0-',4,
[{file,"/home/circleci/project/big_tests/tests/mam_SUITE.erl"},
{line,1717}]},
{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}]}]}} mongooseimctl_SUITE:stats:stats_global{error,{{badmatch,{"Unknown command 'uptimeseconds'. Available commands in category 'stats':\n domainStats\n globalStats\n",
1}},
[{mongooseimctl_SUITE,'-stats_global/1-fun-0-',3,
[{file,"/home/circleci/project/big_tests/tests/mongooseimctl_SUITE.erl"},
{line,1103}]},
{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}]}]}} ldap_mnesia_25 / ldap_mnesia / c8d1e9d pgsql_mnesia_24 / pgsql_mnesia / c8d1e9d mongooseimctl_SUITE:stats:stats_global{error,{{badmatch,{"Unknown command 'uptimeseconds'. Available commands in category 'stats':\n domainStats\n globalStats\n",
1}},
[{mongooseimctl_SUITE,'-stats_global/1-fun-0-',3,
[{file,"/home/circleci/project/big_tests/tests/mongooseimctl_SUITE.erl"},
{line,1103}]},
{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,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}]}]}} internal_mnesia_25 / internal_mnesia / c8d1e9d mongooseimctl_SUITE:stats:stats_global{error,{{badmatch,{"Unknown command 'uptimeseconds'. Available commands in category 'stats':\n domainStats\n globalStats\n",
1}},
[{mongooseimctl_SUITE,'-stats_global/1-fun-0-',3,
[{file,"/home/circleci/project/big_tests/tests/mongooseimctl_SUITE.erl"},
{line,1103}]},
{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}]}]}} dynamic_domains_mssql_mnesia_25 / odbc_mssql_mnesia / c8d1e9d mongooseimctl_SUITE:stats:stats_global{error,{{badmatch,{"Unknown command 'uptimeseconds'. Available commands in category 'stats':\n domainStats\n globalStats\n",
1}},
[{mongooseimctl_SUITE,'-stats_global/1-fun-0-',3,
[{file,"/home/circleci/project/big_tests/tests/mongooseimctl_SUITE.erl"},
{line,1103}]},
{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}]}]}} elasticsearch_and_cassandra_25 / elasticsearch_and_cassandra_mnesia / c8d1e9d mongooseimctl_SUITE:stats:stats_global{error,{{badmatch,{"Unknown command 'uptimeseconds'. Available commands in category 'stats':\n domainStats\n globalStats\n",
1}},
[{mongooseimctl_SUITE,'-stats_global/1-fun-0-',3,
[{file,"/home/circleci/project/big_tests/tests/mongooseimctl_SUITE.erl"},
{line,1103}]},
{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}]}]}} pgsql_mnesia_25 / pgsql_mnesia / c8d1e9d mongooseimctl_SUITE:stats:stats_global{error,{{badmatch,{"Unknown command 'uptimeseconds'. Available commands in category 'stats':\n domainStats\n globalStats\n",
1}},
[{mongooseimctl_SUITE,'-stats_global/1-fun-0-',3,
[{file,"/home/circleci/project/big_tests/tests/mongooseimctl_SUITE.erl"},
{line,1103}]},
{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}]}]}} mysql_redis_25 / mysql_redis / c8d1e9d mongooseimctl_SUITE:stats:stats_global{error,{{badmatch,{"Unknown command 'uptimeseconds'. Available commands in category 'stats':\n domainStats\n globalStats\n",
1}},
[{mongooseimctl_SUITE,'-stats_global/1-fun-0-',3,
[{file,"/home/circleci/project/big_tests/tests/mongooseimctl_SUITE.erl"},
{line,1103}]},
{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}]}]}} 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}]}]}} mssql_mnesia_25 / odbc_mssql_mnesia / c8d1e9d mongooseimctl_SUITE:stats:stats_global{error,{{badmatch,{"Unknown command 'uptimeseconds'. Available commands in category 'stats':\n domainStats\n globalStats\n",
1}},
[{mongooseimctl_SUITE,'-stats_global/1-fun-0-',3,
[{file,"/home/circleci/project/big_tests/tests/mongooseimctl_SUITE.erl"},
{line,1103}]},
{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}]}]}} riak_mnesia_24 / riak_mnesia / c8d1e9d mongooseimctl_SUITE:stats:stats_global{error,{{badmatch,{"Unknown command 'uptimeseconds'. Available commands in category 'stats':\n domainStats\n globalStats\n",
1}},
[{mongooseimctl_SUITE,'-stats_global/1-fun-0-',3,
[{file,"/home/circleci/project/big_tests/tests/mongooseimctl_SUITE.erl"},
{line,1103}]},
{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,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}]}]}} |
Codecov Report
@@ Coverage Diff @@
## master #3714 +/- ##
==========================================
+ Coverage 82.15% 82.20% +0.05%
==========================================
Files 519 520 +1
Lines 33659 33769 +110
==========================================
+ Hits 27652 27760 +108
- Misses 6007 6009 +2
Continue to review full report at Codecov.
|
Motivation: - Conflict of 'stats' with the old 'stats' command. - Consistency - there is 'metric', 'vcard', 'stanza' etc.
Also: rename 'stats' to 'stat'
Update stat and domain categories
small_tests_24 / small_tests / 49d3984 small_tests_25 / small_tests / 49d3984 dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / 49d3984 ldap_mnesia_24 / ldap_mnesia / 49d3984 dynamic_domains_mysql_redis_25 / mysql_redis / 49d3984 dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / 49d3984 ldap_mnesia_25 / ldap_mnesia / 49d3984 dynamic_domains_mssql_mnesia_25 / odbc_mssql_mnesia / 49d3984 pgsql_mnesia_24 / pgsql_mnesia / 49d3984 internal_mnesia_25 / internal_mnesia / 49d3984 elasticsearch_and_cassandra_25 / elasticsearch_and_cassandra_mnesia / 49d3984 pgsql_mnesia_25 / pgsql_mnesia / 49d3984 mysql_redis_25 / mysql_redis / 49d3984 mam_SUITE:rdbms_async_cache_prefs_cases:init_per_group{'EXIT',
{{badrpc,
{'EXIT',
{{start_child_failed,
{error,
{{shutdown,
{failed_to_start_child,pm_mam_async_pool_localhost,
{shutdown,
{failed_to_start_child,
'wpool_pool-pm_mam_async_pool_localhost-process-sup',
{shutdown,
{failed_to_start_child,
'wpool_pool-pm_mam_async_pool_localhost-8',
{already_started,<9153.12655.1>}}}}}}},
{child,undefined,pm_mam_sup_async_pool_localhost,
{mongoose_async_pools,start_link,
[<<"localhost">>,pm_mam,
#{batch_name => insert_mam_messages30,batch_size => 30,
enabled => true,
flush_callback => fun mod_mam_rdbms_arch_async:flush/2,
flush_extra =>
#{batch_name => insert_mam_messages30,batch_size => 30,
enabled => true,flush_interval => 1,pool_size => 16},
flush_interval => 1,pool_size => 16,pool_type => batch}]},
transient,false,infinity,supervisor,
[mongoose_async_pools]}}},
#{id => pm_mam_sup_async_pool_localhost,restart => transient,
start =>
{mongoose_async_pools,start_link,
[<<"localhost">>,pm_mam,
#{batch_name => insert_mam_messages30,batch_size => 30,
enabled => true,
flush_callback => fun mod_mam_rdbms_arch_async:flush/2,
flush_extra =>
#{batch_name => insert_mam_messages30,batch_size => 30,
enabled => true,flush_interval => 1,pool_size => 16},
flush_interval => 1,pool_size => 16,pool_type => batch}]},
type => supervisor}},
... mssql_mnesia_25 / odbc_mssql_mnesia / 49d3984 pubsub_SUITE:dag+node_config:send_last_published_item_test{error,{{badmatch,false},
[{pubsub_tools,check_response,2,
[{file,"/home/circleci/project/big_tests/tests/pubsub_tools.erl"},
{line,491}]},
{pubsub_tools,receive_response,3,
[{file,"/home/circleci/project/big_tests/tests/pubsub_tools.erl"},
{line,481}]},
{pubsub_tools,receive_subscribe_response,3,
[{file,"/home/circleci/project/big_tests/tests/pubsub_tools.erl"},
{line,334}]},
{pubsub_SUITE,'-send_last_published_item_test/1-fun-0-',2,
[{file,"/home/circleci/project/big_tests/tests/pubsub_SUITE.erl"},
{line,937}]},
{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}]}]}} riak_mnesia_24 / riak_mnesia / 49d3984 mysql_redis_25 / mysql_redis / 49d3984 service_domain_db_SUITE:db:db_keeps_syncing_after_cluster_join{error,{test_case_failed,{[<<"example1.com">>,<<"example2.com">>,
<<"example3.com">>],
[<<"example1.com">>,<<"example2.com">>,
<<"example3.com">>,<<"example4.com">>]}}} mysql_redis_25 / mysql_redis / 49d3984 |
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
Merge the feature branch to
master
, as the CLI functionality is now covered with tests.