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

magento/magento2#: GraphQl. RevokeCustomerToken. Test coverage. #26464

Conversation

atwixfirster
Copy link
Contributor

Description (*)

Pull request adds a unit test for \Magento\CustomerGraphQl\Model\Resolver\RevokeCustomerToken class.

Fixed Issues (if relevant)

  1. magento/magento2#<issue_number>: Issue title

Manual testing scenarios (*)

  1. ...
  2. ...

Questions or comments

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

Thank you!

@m2-assistant
Copy link

m2-assistant bot commented Jan 20, 2020

Hi @atwixfirster. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Guide documentation.

@atwixfirster atwixfirster added Partner: Atwix Pull Request is created by partner Atwix partners-contribution Pull Request is created by Magento Partner Award: test coverage labels Jan 20, 2020
@dmytro-ch dmytro-ch self-assigned this Jan 21, 2020
@dmytro-ch dmytro-ch added Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Award: test coverage and removed Award: test coverage labels Jan 21, 2020
@engcom-Delta engcom-Delta self-assigned this Jan 21, 2020
@engcom-Delta
Copy link
Contributor

Notice: QA not applicable

@magento-engcom-team
Copy link
Contributor

Hi @dmytro-ch, thank you for the review.
ENGCOM-6637 has been created to process this Pull Request

@lenaorobei
Copy link
Contributor

This mutation is already covered by \Magento\GraphQl\Customer\RevokeCustomerTokenTest. If some cases are not covered please consider adding it to the api-functional test.
Thanks.

@atwixfirster
Copy link
Contributor Author

atwixfirster commented Jan 22, 2020

This mutation is already covered by \Magento\GraphQl\Customer\RevokeCustomerTokenTest

@lenaorobei , could you please clarify. For which GraphQl modules unit tests are applicable?

Thank you!

@dmytro-ch
Copy link
Contributor

dmytro-ch commented Jan 22, 2020

@atwixfirster I guess, @lenaorobei meant that the unit tests are useless for GraphQl in general. It's better to add an API-functional test if you wish to cover some logic. :)
Thank you!

@atwixfirster
Copy link
Contributor Author

atwixfirster commented Jan 22, 2020

@atwixfirster I guess, @lenaorobei meant that the unit tests are useless for GraphQl in general. It's better to add an API-functional test if you wish to cover some logic. :)
Thank you!

Thank you, @dmytro-ch , for the explanation.

However, I would like to know an official Magento position about Unit Tests. Because some GraphQl modules already covered by Unit and API-functional tests.

For example, Magento\WishlistGraphQl\Model\Resolver\CustomerWishlistResolver covered by

So, I want to understand why Unit tests are good for some GraphQl classes and what is the difference between \Magento\WishlistGraphQl\Test\Unit\CustomerWishlistResolverTest and my one - \Magento\CustomerGraphQl\Model\Resolver\RevokeCustomerToken.

Also good to know for which GraphQl classes we can create Unit Tests.

@lenaorobei , could you please clarify?

Thank you so much!

@lenaorobei
Copy link
Contributor

Hi @atwixfirster,

Yes, @dmytro-ch is correct about the value of unit tests. They make sense only in the development phase.

I left the same comment in PRs with unit tests you've mentioned #26125 (comment) and asked @lbajsarowicz to not contribute more in this.

Also good to know for which GraphQl classes we can create Unit Tests.

There are no such classes. Positive and negative scenarios for queries and mutations should be covered with API functional tests. For more information please refer to the Magento definition of done.

@atwixfirster
Copy link
Contributor Author

Understood

Thank you very much, @lenaorobei !

@magento-engcom-team magento-engcom-team merged commit 1067926 into magento:2.4-develop Jan 29, 2020
@m2-assistant
Copy link

m2-assistant bot commented Jan 29, 2020

Hi @atwixfirster, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Award: test coverage Component: CustomerGraphQl Partner: Atwix Pull Request is created by partner Atwix partners-contribution Pull Request is created by Magento Partner Progress: accept Release Line: 2.4
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants