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

Add guidelines regarding how to test plugins #937

Open
ghisvail opened this issue Dec 16, 2023 · 2 comments
Open

Add guidelines regarding how to test plugins #937

ghisvail opened this issue Dec 16, 2023 · 2 comments

Comments

@ghisvail
Copy link

Description

I recently designed and published a Commitizen plugin to recognize the commit style used by part of the PyData stack (NumPy, SciPy, Pandas, ...) and generate a KAC-like change log automatically from relevant commits.

The code for it is there if you're interested.

I found the documentation for designing plugins very good. I followed these steps and was able to test everything with dry runs and on the actual project change log.

That being said, I would like to add a test suite to avoid accidental regressions in the future. That part is not covered by the documentation, and code examples are scattered in the main commitizen repo.

Could you enhance the documentation by providing additional tips and guidelines to write an appropriate test suite for plugin designers?

Cheers,
Ghis

Possible Solution

No response

Additional context

No response

Additional context

No response

@woile
Copy link
Member

woile commented Dec 17, 2023

That's awesome! Could you provide some examples of what kind of regressions you'd like to prevent?

@ghisvail
Copy link
Author

what kind of regressions you'd like to prevent?

For instance, I'd want to make sure that the version bump or the change log extraction rules are always respected.

It took me some time to fiddle with the different regexes, and I am sure they are not perfect. Adding some automated test cases could reveal some corners I have missed. Right now, I am mostly relying on --dry-run to do manual testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants