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

Test config parsing with post-processing #3507

Merged
merged 1 commit into from
Jan 19, 2022

Conversation

chrzaszcz
Copy link
Member

@chrzaszcz chrzaszcz commented Jan 18, 2022

Call process instead of parse in config_parser_SUITE

This makes it possible to test config post-processing, i.e.

  • Repeating global options for each host (type)
  • Module dependencies (no tests yet, but they can be easily added now)
  • Aggregation of acl's and access rules (planned in my next PR)

Related changes:

  • Module options are checked selectively because deps are now present (only one module is checked instead of all).
  • New function compare_nodes/3 is used for more organized comparison of config tree nodes
  • HOST_TYPE is changed to HOST because some modules don't support dynamic domains yet. Before it was working only because it referred to an undefined host type and thus it managed to circumvent the check.

Note:

  • The host_key helper will be simplified in the upcoming PR, removing the HostType argument as it is only required for shaper/acl/access now - only these options have this host-or-global resulting format, others are stored only per host type.

@mongoose-im
Copy link
Collaborator

mongoose-im commented Jan 18, 2022

small_tests_24 / small_tests / 981e082
Reports root / small


small_tests_23 / small_tests / 981e082
Reports root / small


dynamic_domains_mysql_redis_24 / mysql_redis / 981e082
Reports root/ big
OK: 2674 / Failed: 0 / User-skipped: 255 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_23 / pgsql_mnesia / 981e082
Reports root/ big
OK: 2691 / Failed: 0 / User-skipped: 238 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / 981e082
Reports root/ big
OK: 2691 / Failed: 0 / User-skipped: 238 / Auto-skipped: 0


dynamic_domains_mssql_mnesia_24 / odbc_mssql_mnesia / 981e082
Reports root/ big
OK: 2691 / Failed: 0 / User-skipped: 238 / Auto-skipped: 0


ldap_mnesia_23 / ldap_mnesia / 981e082
Reports root/ big
OK: 1500 / Failed: 0 / User-skipped: 390 / Auto-skipped: 0


ldap_mnesia_24 / ldap_mnesia / 981e082
Reports root/ big
OK: 1500 / Failed: 0 / User-skipped: 390 / Auto-skipped: 0


internal_mnesia_24 / internal_mnesia / 981e082
Reports root/ big
OK: 1541 / Failed: 0 / User-skipped: 349 / Auto-skipped: 0


elasticsearch_and_cassandra_24 / elasticsearch_and_cassandra_mnesia / 981e082
Reports root/ big
OK: 1834 / Failed: 0 / User-skipped: 363 / Auto-skipped: 0


pgsql_mnesia_24 / pgsql_mnesia / 981e082
Reports root/ big
OK: 3078 / Failed: 0 / User-skipped: 247 / Auto-skipped: 0


mysql_redis_24 / mysql_redis / 981e082
Reports root/ big
OK: 3073 / Failed: 0 / User-skipped: 252 / Auto-skipped: 0


riak_mnesia_24 / riak_mnesia / 981e082
Reports root/ big
OK: 1680 / Failed: 0 / User-skipped: 363 / Auto-skipped: 0


mssql_mnesia_24 / odbc_mssql_mnesia / 981e082
Reports root/ big
OK: 3078 / Failed: 0 / User-skipped: 247 / Auto-skipped: 0

@codecov
Copy link

codecov bot commented Jan 18, 2022

Codecov Report

Merging #3507 (80f1e25) into master (a5e9d8e) will increase coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3507      +/-   ##
==========================================
+ Coverage   80.96%   80.97%   +0.01%     
==========================================
  Files         418      418              
  Lines       32329    32329              
==========================================
+ Hits        26174    26179       +5     
+ Misses       6155     6150       -5     
Impacted Files Coverage Δ
src/config/mongoose_config_parser_toml.erl 99.27% <ø> (+1.45%) ⬆️
src/elasticsearch/mongoose_elasticsearch.erl 76.92% <0.00%> (-7.70%) ⬇️
src/mam/mod_mam_elasticsearch_arch.erl 85.08% <0.00%> (-1.76%) ⬇️
src/domain/mongoose_domain_loader.erl 89.28% <0.00%> (-0.90%) ⬇️
src/rdbms/mongoose_rdbms.erl 63.29% <0.00%> (-0.75%) ⬇️
src/mod_muc_log.erl 78.11% <0.00%> (ø)
src/mod_muc_room.erl 77.26% <0.00%> (+0.05%) ⬆️
src/pubsub/mod_pubsub.erl 73.31% <0.00%> (+0.11%) ⬆️
src/pubsub/mod_pubsub_db_mnesia.erl 92.85% <0.00%> (+0.42%) ⬆️
src/global_distrib/mod_global_distrib.erl 86.73% <0.00%> (+1.02%) ⬆️
... and 4 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 a5e9d8e...80f1e25. Read the comment docs.

@chrzaszcz chrzaszcz marked this pull request as ready for review January 18, 2022 14:33
This change makes it possible to test config post-processing, i.e.
- Repeating global options for each host (type)
- Module dependencies
- Aggregation of acl's and access rules (in the future)

Related changes:
- Module options are checked selectively because deps are now present
  (only the checked module instead of all)
- New function 'compare_nodes/3' is used for more organized comparison
  of config tree nodes
- HOST_TYPE is changed to HOST because some modules don't support
  dynamic domains yet. Before it was working only because it referred to an
  undefined host type and thus it managed to circumvent the check.
@chrzaszcz chrzaszcz force-pushed the test-full-config-processing branch from 981e082 to 80f1e25 Compare January 19, 2022 11:53
@mongoose-im
Copy link
Collaborator

mongoose-im commented Jan 19, 2022

small_tests_24 / small_tests / 80f1e25
Reports root / small


small_tests_23 / small_tests / 80f1e25
Reports root / small


dynamic_domains_mysql_redis_24 / mysql_redis / 80f1e25
Reports root/ big
OK: 2674 / Failed: 0 / User-skipped: 255 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / 80f1e25
Reports root/ big
OK: 2691 / Failed: 0 / User-skipped: 238 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_23 / pgsql_mnesia / 80f1e25
Reports root/ big
OK: 2691 / Failed: 0 / User-skipped: 238 / Auto-skipped: 0


dynamic_domains_mssql_mnesia_24 / odbc_mssql_mnesia / 80f1e25
Reports root/ big
OK: 2691 / Failed: 0 / User-skipped: 238 / Auto-skipped: 0


ldap_mnesia_23 / ldap_mnesia / 80f1e25
Reports root/ big
OK: 1500 / Failed: 0 / User-skipped: 390 / Auto-skipped: 0


ldap_mnesia_24 / ldap_mnesia / 80f1e25
Reports root/ big
OK: 1500 / Failed: 0 / User-skipped: 390 / Auto-skipped: 0


internal_mnesia_24 / internal_mnesia / 80f1e25
Reports root/ big
OK: 1541 / Failed: 0 / User-skipped: 349 / Auto-skipped: 0


pgsql_mnesia_23 / pgsql_mnesia / 80f1e25
Reports root/ big
OK: 3078 / Failed: 0 / User-skipped: 247 / Auto-skipped: 0


elasticsearch_and_cassandra_24 / elasticsearch_and_cassandra_mnesia / 80f1e25
Reports root/ big
OK: 1834 / Failed: 0 / User-skipped: 363 / Auto-skipped: 0


pgsql_mnesia_24 / pgsql_mnesia / 80f1e25
Reports root/ big
OK: 3078 / Failed: 0 / User-skipped: 247 / Auto-skipped: 0


mssql_mnesia_24 / odbc_mssql_mnesia / 80f1e25
Reports root/ big
OK: 3078 / Failed: 0 / User-skipped: 247 / Auto-skipped: 0


mysql_redis_24 / mysql_redis / 80f1e25
Reports root/ big
OK: 3073 / Failed: 0 / User-skipped: 252 / Auto-skipped: 0


riak_mnesia_24 / riak_mnesia / 80f1e25
Reports root/ big
OK: 1680 / Failed: 0 / User-skipped: 363 / Auto-skipped: 0

Copy link
Contributor

@arcusfelis arcusfelis left a comment

Choose a reason for hiding this comment

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

ok

@arcusfelis arcusfelis merged commit bb0ae51 into master Jan 19, 2022
@arcusfelis arcusfelis deleted the test-full-config-processing branch January 19, 2022 12:27
@Premwoik Premwoik added this to the 5.1.0 milestone May 25, 2022
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