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

Fix read preference for aggregate #6585

Conversation

mtrezza
Copy link
Member

@mtrezza mtrezza commented Apr 9, 2020

added failing test cases

@mtrezza
Copy link
Member Author

mtrezza commented Apr 10, 2020

The fix in parse-community/Parse-SDK-JS#1143 seems to work looking at the mongodb logs.

But I am stuck verifying the read preference in the test case. I don't know what to spyOn.

  • spyOn(databaseAdapter.database.serverConfig, 'command').and.callThrough(); doesn't work because command is not called when executing the aggregate query.

  • spyOn(databaseAdapter.database.serverConfig, 'cursor').and.callThrough(); doesn't work because cursor is only called 1 time for the schema when executing the aggregate query.

@dplewis Can you help me out on this?

@dplewis
Copy link
Member

dplewis commented Apr 10, 2020

@davimacedo Is the expert on readPreferences and wrote most of the tests.

@mtrezza
Copy link
Member Author

mtrezza commented Apr 12, 2020

Alright, got the test case fixed for aggregate.

@mtrezza
Copy link
Member Author

mtrezza commented Apr 12, 2020

All parse server tests pass locally with the parse SDK merged with fix parse-community/Parse-SDK-JS#1143.

So before merging this PR the new parse SDK has to be released.

@mtrezza
Copy link
Member Author

mtrezza commented Apr 28, 2020

@acinader ready for review

@codecov
Copy link

codecov bot commented Apr 28, 2020

Codecov Report

Merging #6585 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #6585   +/-   ##
=======================================
  Coverage   93.92%   93.92%           
=======================================
  Files         169      169           
  Lines       11991    11994    +3     
=======================================
+ Hits        11262    11265    +3     
  Misses        729      729           
Impacted Files Coverage Δ
src/Routers/AggregateRouter.js 100.00% <100.00%> (ø)
src/RestWrite.js 93.64% <0.00%> (-0.17%) ⬇️
src/triggers.js 93.18% <0.00%> (+0.37%) ⬆️

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 61546aa...509b0ee. Read the comment docs.

Copy link
Contributor

@acinader acinader left a comment

Choose a reason for hiding this comment

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

lgtm

@acinader acinader merged commit e78c07e into parse-community:master Apr 28, 2020
@mtrezza
Copy link
Member Author

mtrezza commented Apr 28, 2020

Thanks!

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.

3 participants