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

Create unit tests for providers #493

Closed
eloekset opened this issue Jul 3, 2022 · 2 comments
Closed

Create unit tests for providers #493

eloekset opened this issue Jul 3, 2022 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@eloekset
Copy link

eloekset commented Jul 3, 2022

Is your feature request related to a problem? Please describe.
In #492 I suspected a bug in the implementation of DeleteTxtRecordAsync for the DomeneShopProvider.

Describe the solution you'd like
To verify the bug existed and was fixed, I created a unit test project and implemented tests for all the public methods of DomeneShopProvider. Consider implementing tests for the other existing providers to verify the functionality and better describe the provider for developers without access to that provider's API.

Describe alternatives you've considered

  • Implement changes and deploy a pre-release to test and verify functionality live against the provider's API.
  • Create another test project for integration tests with sample data that verifies functionality all the way from the AcmeBot for each provider. This requires a configuration with credentials that should be gitignored and the tests must be easily modified with sample data that suits a developers own domain.

Additional context
The tests I've implemented will be sent in a separate PR.
image

@eloekset eloekset added the enhancement New feature or request label Jul 3, 2022
@shibayan
Copy link
Owner

I do not plan to support this because we do not see the value in unit tests that do not access the actual DNS Provider API. Mock APIs can verify reads, but cannot verify that Create / Update requests are correct.

It is possible to create a test that runs the DNS Provider's API, but this is not practical due to the additional cost involved.

@shibayan shibayan closed this as not planned Won't fix, can't repro, duplicate, stale Jul 10, 2022
@eloekset
Copy link
Author

eloekset commented Jul 10, 2022

Ok, I'll keep this feature branch hanging around: https://github.com/eloekset/keyvault-acmebot/tree/feature/DomeneShopUnitTests
If anyone else is interested in unit tests at great help developing additional providers, feel free to pull from this branch. I'll use it when implementing a provider for Namecheap soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants