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

MongoosePush API v3 mock #2549

Merged
merged 7 commits into from
Dec 5, 2019
Merged

MongoosePush API v3 mock #2549

merged 7 commits into from
Dec 5, 2019

Conversation

michalwski
Copy link
Contributor

Proposed changes include:

  • allow to specify what HTTP status and body is returned to MongooseIM from MongoosePushMock
  • extend MongoosePushMock to accept requests to API v3

@mongoose-im
Copy link
Collaborator

mongoose-im commented Dec 3, 2019

7513.1 / Erlang 22.0 / small_tests / 815d86b
Reports root / small


7513.2 / Erlang 22.0 / internal_mnesia / 815d86b
Reports root/ big
OK: 1276 / Failed: 0 / User-skipped: 138 / Auto-skipped: 0


7513.3 / Erlang 22.0 / odbc_mssql_mnesia / 815d86b
Reports root/ big
OK: 2495 / Failed: 0 / User-skipped: 199 / Auto-skipped: 0


7513.4 / Erlang 22.0 / mysql_redis / 815d86b
Reports root/ big
OK: 2490 / Failed: 0 / User-skipped: 204 / Auto-skipped: 0


7513.7 / Erlang 22.0 / elasticsearch_and_cassandra_mnesia / 815d86b
Reports root/ big
OK: 328 / Failed: 0 / User-skipped: 28 / Auto-skipped: 0


7513.5 / Erlang 22.0 / riak_mnesia / 815d86b
Reports root/ big
OK: 1409 / Failed: 0 / User-skipped: 145 / Auto-skipped: 0


7513.6 / Erlang 22.0 / ldap_mnesia / 815d86b
Reports root/ big
OK: 1241 / Failed: 0 / User-skipped: 173 / Auto-skipped: 0


7513.9 / Erlang 21.3 / pgsql_mnesia / 815d86b
Reports root/ big / small
OK: 2508 / Failed: 0 / User-skipped: 186 / Auto-skipped: 0

@codecov
Copy link

codecov bot commented Dec 3, 2019

Codecov Report

Merging #2549 into master will increase coverage by 0.36%.
The diff coverage is 77.77%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2549      +/-   ##
==========================================
+ Coverage   78.68%   79.05%   +0.36%     
==========================================
  Files         343      343              
  Lines       29457    29463       +6     
==========================================
+ Hits        23179    23291     +112     
+ Misses       6278     6172     -106
Impacted Files Coverage Δ
src/mod_push_service_mongoosepush.erl 86.84% <77.77%> (+5.59%) ⬆️
...c/global_distrib/mod_global_distrib_server_mgr.erl 79.14% <0%> (-2.46%) ⬇️
src/mod_bosh_socket.erl 81.18% <0%> (-0.34%) ⬇️
src/mod_muc_log.erl 77.69% <0%> (ø) ⬆️
src/mod_muc_room.erl 77.79% <0%> (+0.29%) ⬆️
src/pubsub/mod_pubsub_db_mnesia.erl 94.42% <0%> (+0.42%) ⬆️
src/config/mongoose_config_parser.erl 74.41% <0%> (+0.46%) ⬆️
src/rdbms/mongoose_rdbms.erl 71.79% <0%> (+0.51%) ⬆️
src/inbox/mod_inbox_rdbms.erl 88.37% <0%> (+1.16%) ⬆️
src/metrics/mongoose_metrics.erl 92.99% <0%> (+1.27%) ⬆️
... and 10 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 4af5b77...b28c3db. Read the comment docs.

@mongoose-im
Copy link
Collaborator

mongoose-im commented Dec 4, 2019

7518.1 / Erlang 22.0 / small_tests / b476e8d
Reports root / small


7518.2 / Erlang 22.0 / internal_mnesia / b476e8d
Reports root/ big
OK: 1278 / Failed: 0 / User-skipped: 138 / Auto-skipped: 0


7518.3 / Erlang 22.0 / odbc_mssql_mnesia / b476e8d
Reports root/ big
OK: 2497 / Failed: 0 / User-skipped: 199 / Auto-skipped: 0


7518.4 / Erlang 22.0 / mysql_redis / b476e8d
Reports root/ big
OK: 2492 / Failed: 0 / User-skipped: 204 / Auto-skipped: 0


7518.7 / Erlang 22.0 / elasticsearch_and_cassandra_mnesia / b476e8d
Reports root/ big
OK: 328 / Failed: 0 / User-skipped: 28 / Auto-skipped: 0


7518.6 / Erlang 22.0 / ldap_mnesia / b476e8d
Reports root/ big
OK: 1243 / Failed: 0 / User-skipped: 173 / Auto-skipped: 0


7518.5 / Erlang 22.0 / riak_mnesia / b476e8d
Reports root/ big
OK: 1411 / Failed: 0 / User-skipped: 145 / Auto-skipped: 0


7518.9 / Erlang 21.3 / pgsql_mnesia / b476e8d
Reports root/ big / small
OK: 2510 / Failed: 0 / User-skipped: 186 / Auto-skipped: 0

@mongoose-im
Copy link
Collaborator

mongoose-im commented Dec 4, 2019

7520.1 / Erlang 22.0 / small_tests / 8abd2f1
Reports root / small


7520.2 / Erlang 22.0 / internal_mnesia / 8abd2f1
Reports root/ big
OK: 1278 / Failed: 0 / User-skipped: 138 / Auto-skipped: 0


7520.3 / Erlang 22.0 / odbc_mssql_mnesia / 8abd2f1
Reports root/ big
OK: 2497 / Failed: 0 / User-skipped: 199 / Auto-skipped: 0


7520.4 / Erlang 22.0 / mysql_redis / 8abd2f1
Reports root/ big
OK: 2492 / Failed: 0 / User-skipped: 204 / Auto-skipped: 0


7520.5 / Erlang 22.0 / riak_mnesia / 8abd2f1
Reports root/ big
OK: 1411 / Failed: 0 / User-skipped: 145 / Auto-skipped: 0


7520.7 / Erlang 22.0 / elasticsearch_and_cassandra_mnesia / 8abd2f1
Reports root/ big
OK: 328 / Failed: 0 / User-skipped: 28 / Auto-skipped: 0


7520.6 / Erlang 22.0 / ldap_mnesia / 8abd2f1
Reports root/ big
OK: 1243 / Failed: 0 / User-skipped: 173 / Auto-skipped: 0


7520.9 / Erlang 21.3 / pgsql_mnesia / 8abd2f1
Reports root/ big / small
OK: 2510 / Failed: 0 / User-skipped: 186 / Auto-skipped: 0

Copy link
Contributor

@aleklisi aleklisi left a comment

Choose a reason for hiding this comment

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

Thanks for PR, I fund no issues there.

Copy link
Member

@fenek fenek left a comment

Choose a reason for hiding this comment

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

Requires some update to migration guide about new default API version.

{ok, <<"v2">>, v2};
parse_api_version(_) ->
{error, not_supported}.

%% Create notification for API v2
Copy link
Member

Choose a reason for hiding this comment

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

%% Create notification for API v2 and v3 :)

%% Create notification for API v2
make_notification(v2, Notification, Options = #{<<"silent">> := <<"true">>}) ->
make_notification(API, Notification, Options = #{<<"silent">> := <<"true">>})
when API =:= v2; API =:= v3 ->
Copy link
Member

Choose a reason for hiding this comment

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

I think this check is overzealous because we can't really have anything other than v2 and v3, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently that's true, the code will fail earlier. Previously we needed to check the version because the atom was created from the config option.

@mongoose-im
Copy link
Collaborator

mongoose-im commented Dec 5, 2019

7523.1 / Erlang 22.0 / small_tests / 20b953e
Reports root / small


7523.2 / Erlang 22.0 / internal_mnesia / 20b953e
Reports root/ big
OK: 1278 / Failed: 0 / User-skipped: 138 / Auto-skipped: 0


7523.3 / Erlang 22.0 / odbc_mssql_mnesia / 20b953e
Reports root/ big
OK: 2497 / Failed: 0 / User-skipped: 199 / Auto-skipped: 0


7523.4 / Erlang 22.0 / mysql_redis / 20b953e
Reports root/ big
OK: 2492 / Failed: 0 / User-skipped: 204 / Auto-skipped: 0


7523.7 / Erlang 22.0 / elasticsearch_and_cassandra_mnesia / 20b953e
Reports root/ big
OK: 328 / Failed: 0 / User-skipped: 28 / Auto-skipped: 0


7523.6 / Erlang 22.0 / ldap_mnesia / 20b953e
Reports root/ big
OK: 1243 / Failed: 0 / User-skipped: 173 / Auto-skipped: 0


7523.5 / Erlang 22.0 / riak_mnesia / 20b953e
Reports root/ big
OK: 1411 / Failed: 0 / User-skipped: 145 / Auto-skipped: 0


7523.9 / Erlang 21.3 / pgsql_mnesia / 20b953e
Reports root/ big / small
OK: 2510 / Failed: 0 / User-skipped: 186 / Auto-skipped: 0

Copy link
Member

@fenek fenek left a comment

Choose a reason for hiding this comment

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

Waiting for language check.

doc/migrations/3.5.0_3.5.0plus.md Outdated Show resolved Hide resolved
doc/user-guide/Push-notifications.md Outdated Show resolved Hide resolved
@fenek fenek merged commit ed73be0 into master Dec 5, 2019
@fenek fenek deleted the mongoose-push-api-v3-mock branch December 5, 2019 18:14
@michalwski michalwski mentioned this pull request Dec 5, 2019
@michalwski michalwski added this to the 3.6.0 milestone Jan 22, 2020
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.

5 participants