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

GraphQL - Move some big tests to small tests #3474

Merged
merged 8 commits into from
Dec 27, 2021

Conversation

Premwoik
Copy link
Contributor

@Premwoik Premwoik commented Dec 22, 2021

This PR addresses MIM-1576 and moves tests that were using mocked schema to small tests.

Changes

  • Move listener tests to small tests.
  • Extract some useful functions to the graphql helper module.
  • Introduce a new checkAuth field in the admin and the user schemas. This field allows users to ensure that they are authorized correctly.
  • Add tests that check if GraphQL works correctly on the default MongooseIM configuration.
  • Adapt mongooseimctl tests to use generic admin schema.

Fixed

  • Removed default auth header from GraphiQL. It was useless for the user listener and its presence resulted in a wrong_creds error when loading documentation.

@Premwoik Premwoik changed the base branch from master to feature/graphql December 22, 2021 12:54
@codecov
Copy link

codecov bot commented Dec 22, 2021

Codecov Report

Merging #3474 (1ec7a69) into feature/graphql (6d971fe) will decrease coverage by 0.01%.
The diff coverage is 83.33%.

Impacted file tree graph

@@                 Coverage Diff                 @@
##           feature/graphql    #3474      +/-   ##
===================================================
- Coverage            80.83%   80.82%   -0.02%     
===================================================
  Files                  424      427       +3     
  Lines                32566    32578      +12     
===================================================
+ Hits                 26324    26330       +6     
- Misses                6242     6248       +6     
Impacted Files Coverage Δ
src/mongoose_graphql.erl 91.11% <ø> (ø)
src/mongoose_graphql/mongoose_graphql_enum.erl 33.33% <33.33%> (ø)
...ose_graphql/admin/mongoose_graphql_admin_query.erl 33.33% <100.00%> (+33.33%) ⬆️
...e_graphql/user/mongoose_graphql_user_auth_info.erl 100.00% <100.00%> (ø)
...goose_graphql/user/mongoose_graphql_user_query.erl 100.00% <100.00%> (ø)
src/mongoose_graphql/mongoose_graphql_default.erl 0.00% <0.00%> (-100.00%) ⬇️
src/mod_roster_riak.erl 81.53% <0.00%> (-15.39%) ⬇️
...goose_graphql/mongoose_graphql_cowboy_response.erl 72.72% <0.00%> (-9.10%) ⬇️
src/elasticsearch/mongoose_elasticsearch.erl 76.92% <0.00%> (-7.70%) ⬇️
src/mongoose_graphql/mongoose_graphql_errors.erl 87.50% <0.00%> (-3.13%) ⬇️
... and 14 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 9887260...1ec7a69. Read the comment docs.

@mongoose-im

This comment has been minimized.

@Premwoik Premwoik force-pushed the graphql/big-tests-to-small-tests branch from e15d788 to a6605f4 Compare December 23, 2021 09:39
@mongoose-im

This comment has been minimized.

This will be useful in big tests to check if authorization works correctly.
Also, users can easily check their own authorization this way.
These tests ensure that GraphQL works correctly on the default MongooseIM configuration
@mongoose-im

This comment has been minimized.

@Premwoik Premwoik force-pushed the graphql/big-tests-to-small-tests branch from 8bcd645 to 1ec7a69 Compare December 23, 2021 14:58
@mongoose-im
Copy link
Collaborator

mongoose-im commented Dec 23, 2021

small_tests_24 / small_tests / 1ec7a69
Reports root / small


small_tests_23 / small_tests / 1ec7a69
Reports root / small


dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / 1ec7a69
Reports root/ big
OK: 2737 / Failed: 0 / User-skipped: 186 / Auto-skipped: 0


dynamic_domains_mssql_mnesia_24 / odbc_mssql_mnesia / 1ec7a69
Reports root/ big
OK: 2737 / Failed: 0 / User-skipped: 186 / Auto-skipped: 0


dynamic_domains_mysql_redis_24 / mysql_redis / 1ec7a69
Reports root/ big
OK: 2720 / Failed: 0 / User-skipped: 203 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_23 / pgsql_mnesia / 1ec7a69
Reports root/ big
OK: 2737 / Failed: 0 / User-skipped: 186 / Auto-skipped: 0


ldap_mnesia_23 / ldap_mnesia / 1ec7a69
Reports root/ big
OK: 1513 / Failed: 0 / User-skipped: 386 / Auto-skipped: 0


internal_mnesia_24 / internal_mnesia / 1ec7a69
Reports root/ big
OK: 1598 / Failed: 0 / User-skipped: 301 / Auto-skipped: 0


ldap_mnesia_24 / ldap_mnesia / 1ec7a69
Reports root/ big
OK: 1513 / Failed: 0 / User-skipped: 386 / Auto-skipped: 0


pgsql_mnesia_24 / pgsql_mnesia / 1ec7a69
Reports root/ big
OK: 3124 / Failed: 0 / User-skipped: 195 / Auto-skipped: 0


mysql_redis_24 / mysql_redis / 1ec7a69
Reports root/ big
OK: 3119 / Failed: 0 / User-skipped: 200 / Auto-skipped: 0


elasticsearch_and_cassandra_24 / elasticsearch_and_cassandra_mnesia / 1ec7a69
Reports root/ big
OK: 1891 / Failed: 0 / User-skipped: 313 / Auto-skipped: 0


mssql_mnesia_24 / odbc_mssql_mnesia / 1ec7a69
Reports root/ big
OK: 3124 / Failed: 0 / User-skipped: 195 / Auto-skipped: 0


riak_mnesia_24 / riak_mnesia / 1ec7a69
Reports root/ big
OK: 1737 / Failed: 0 / User-skipped: 314 / Auto-skipped: 0

@Premwoik Premwoik marked this pull request as ready for review December 23, 2021 15:21
@arcusfelis arcusfelis merged commit ab4ddf1 into feature/graphql Dec 27, 2021
@arcusfelis arcusfelis deleted the graphql/big-tests-to-small-tests branch December 27, 2021 13:44
@chrzaszcz chrzaszcz added this to the 6.0.0 milestone Dec 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants