commitizen icon indicating copy to clipboard operation
commitizen copied to clipboard

Add guidelines regarding how to test plugins

Open ghisvail opened this issue 2 years ago • 2 comments

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

ghisvail avatar Dec 16 '23 19:12 ghisvail

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

woile avatar Dec 17 '23 07:12 woile

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.

ghisvail avatar Dec 17 '23 09:12 ghisvail