-
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
Missing domain admin tests #3745
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
Codecov ReportBase: 82.73% // Head: 82.69% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #3745 +/- ##
==========================================
- Coverage 82.73% 82.69% -0.04%
==========================================
Files 529 529
Lines 33957 33957
==========================================
- Hits 28094 28081 -13
- Misses 5863 5876 +13
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. |
c4082d9
to
c96b005
Compare
This comment was marked as outdated.
This comment was marked as outdated.
c96b005
to
687cd1e
Compare
This comment was marked as outdated.
This comment was marked as outdated.
687cd1e
to
d31c2cc
Compare
This comment was marked as outdated.
This comment was marked as outdated.
d31c2cc
to
fe0defa
Compare
This comment was marked as outdated.
This comment was marked as outdated.
fe0defa
to
d88944b
Compare
This comment was marked as outdated.
This comment was marked as outdated.
d88944b
to
e3494a7
Compare
This comment was marked as outdated.
This comment was marked as outdated.
e3494a7
to
ab5748e
Compare
This comment was marked as outdated.
This comment was marked as outdated.
@@ -68,6 +77,16 @@ admin_gdpr_no_user_test(Config) -> | |||
Res = admin_retrieve_personal_data(<<"AAAA">>, domain(), <<"AAA">>, Config), | |||
?assertEqual(<<"user_does_not_exist_error">>, get_err_code(Res)). | |||
|
|||
domain_admin_retrive_user_data_no_permission(Config) -> | |||
escalus:fresh_story_with_config(Config, [{alice_bis, 1}], |
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.
escalus:fresh_story_with_config(Config, [{alice_bis, 1}], | |
escalus:fresh_story_with_config(Config, [{alice_bis, 1}], |
domain_admin_flush_global_bin_no_permission(Config, Alice, AliceBis, Kate) -> | ||
SecHostType = domain_helper:host_type(), | ||
create_room_and_make_users_leave(Alice, AliceBis, Kate), | ||
get_unauthorized(flush_global_bin(SecHostType, null, Config)). % check 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.
I suggest deleting this comment.
get_unauthorized(admin_remove_old_users(<<"external">>, now_dt_with_offset(0), Config)). | ||
|
||
domain_admin_list_old_users_global(Config) -> | ||
jids_with_config(Config, [alice, alice_bis, bob], |
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.
jids_with_config(Config, [alice, alice_bis, bob], | |
jids_with_config(Config, [alice, alice_bis, bob], |
get_unauthorized(admin_list_old_users(null, now_dt_with_offset(150), Config)). | ||
|
||
domain_admin_remove_old_users_global(Config) -> | ||
jids_with_config(Config, [alice, alice_bis, bob], |
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.
jids_with_config(Config, [alice, alice_bis, bob], | |
jids_with_config(Config, [alice, alice_bis, bob], |
case Config1 of | ||
{skip, require_rdbms} -> | ||
Config1; | ||
_ -> |
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.
_ -> | |
_ -> |
init_per_group(domain_admin_session, Config) -> | ||
Config1 = graphql_helper:init_domain_admin_handler(Config), | ||
case Config1 of | ||
{skip, require_rdbms} -> |
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.
{skip, require_rdbms} -> | |
{skip, require_rdbms} -> |
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, I've added some minor stylistic comments
ab5748e
to
f84b41b
Compare
This comment was marked as outdated.
This comment was marked as outdated.
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.
It is going in the right direction in general. However, I think that in many cases the tests are not in line with the main goal - to check that the domain admin can't access a different (existing) domain - which is the main purpose of the domain permission level.
So, on one hand I see that we are repeating all tests for non-existent domains (which is good, but I don't think it's necessary), but on the other hand sometimes we miss the most important test: for the secondary domain - either with domain_helper:secondary_domain()
, or with a user like AliceBis. I didn't mark all such places, because some tests (e.g. muc
and muc_light
) are missing such tests entirely.
This comment was marked as outdated.
This comment was marked as outdated.
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.
A lot of good tests here. I added some comments, mostly minor ones.
cc3202f
to
8f3ea9a
Compare
This comment was marked as outdated.
This comment was marked as outdated.
8f3ea9a
to
82aa71f
Compare
small_tests_24 / small_tests / 82aa71f small_tests_25 / small_tests / 82aa71f ldap_mnesia_24 / ldap_mnesia / 82aa71f dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / 82aa71f dynamic_domains_pgsql_mnesia_25 / pgsql_mnesia / 82aa71f ldap_mnesia_25 / ldap_mnesia / 82aa71f dynamic_domains_mysql_redis_25 / mysql_redis / 82aa71f internal_mnesia_25 / internal_mnesia / 82aa71f dynamic_domains_mssql_mnesia_25 / odbc_mssql_mnesia / 82aa71f elasticsearch_and_cassandra_25 / elasticsearch_and_cassandra_mnesia / 82aa71f pgsql_mnesia_24 / pgsql_mnesia / 82aa71f mysql_redis_25 / mysql_redis / 82aa71f pgsql_mnesia_25 / pgsql_mnesia / 82aa71f mssql_mnesia_25 / odbc_mssql_mnesia / 82aa71f riak_mnesia_24 / riak_mnesia / 82aa71f |
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.
All looks good now 👌
This PR adds missing domain admin tests for GraphQL api