Skip to content

Integration test password grant #100

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

Merged
merged 8 commits into from
Dec 19, 2021

Conversation

jorenvandeweyer
Copy link
Member

I'm trying to write some actual integration tests for the library and want some feedback before I cover all the other grants.

  • Is this how we want to test it?
  • What should it cover more or not?
  • Do you have any feedback on the memory database?
  • ...

Summary

Password grant integration test.

Linked issue(s)

#42

Involved parts of the project

  • Password grant

Added tests?

  • Integration test proposal

@jankapunkt
Copy link
Member

@jorenvandeweyer I think this is a very good approach. What I'd like to see, since this is a good chance at least, is to stronger bind these tests to paragraphs in the standard. For example we could use the phrasing from the standard(s) when writing the (un)its or refer to the sections, if possible.

@jankapunkt
Copy link
Member

@jorenvandeweyer I have a question - do you propose these tests, because the current password grant tests are incomplete or do you want to test more towards standard compliance?

If second - I would propose to refactor the paths from /integration to /compliance so it's clear these tests are not only simply testing integration

Then another thing on the DB I think it would be good to reuse the DB across other tests, so maybe exporting some factory function would be good so every test flow would start with a clean-state DB instance?

@jorenvandeweyer
Copy link
Member Author

The current "integration" tests are currently testing the grant flows step by step. I think the real integration tests that test the complete flow from start to end are missing.

It think it's an opportunity to test the compliance in these tests too.

I'll finish this pull request this weekend, and include a factory for the db.

@jorenvandeweyer jorenvandeweyer marked this pull request as ready for review December 11, 2021 13:09
@Uzlopak
Copy link
Collaborator

Uzlopak commented Dec 18, 2021

I read quickly over it. It seems about right. Also it does not touch any old code, so there is no risk, that we break something. I personally dont like the should notation, but hey... the other unit tests are also in should notation, so for having the same principle over the whole project, I will not demand a change. :D

Uzlopak
Uzlopak previously approved these changes Dec 18, 2021
Copy link
Member

@jankapunkt jankapunkt left a comment

Choose a reason for hiding this comment

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

Just two minor things but overall a very welcomed addition

@jorenvandeweyer
Copy link
Member Author

I think I implemented all feedback. Can this be merged? I want to write some compliance tests for the other grant types in a different pull request.

@Uzlopak Uzlopak dismissed jankapunkt’s stale review December 19, 2021 10:44

Dismissing as it is done

@Uzlopak Uzlopak merged commit 92bea82 into node-oauth:development Dec 19, 2021
@Uzlopak Uzlopak mentioned this pull request Dec 20, 2021
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