Skip to content

docs: add plugin testing guide - #2122

Open
abdullahjaved06 wants to merge 1 commit into
commitizen-tools:masterfrom
abdullahjaved06:docs/plugin-testing-guide
Open

abdullahjaved06 wants to merge 1 commit into
commitizen-tools:masterfrom
abdullahjaved06:docs/plugin-testing-guide

Conversation

@abdullahjaved06

Copy link
Copy Markdown

Description

Adds a new documentation page (docs/customization/testing_plugins.md) explaining how plugin authors can write automated tests for their Commitizen plugins. It includes a complete example plugin and tests for version bumps, changelog extraction, message creation, and schema validation. Also links to it from python_class.md and adds it to the nav. Closes #937.

Checklist

Was generative AI tooling used to co-author this PR?

  • Yes (please specify the tool below)

Generated-by: Claude following the guidelines

Code Changes

  • Add test cases to all the changes you introduce
  • Run uv run poe all locally to ensure this change passes linter check and tests
  • Manually test the changes:
    • Verify the feature/bug fix works as expected in real-world scenarios
    • Test edge cases and error conditions
    • Ensure backward compatibility is maintained
    • Document any manual testing steps performed
  • Update the documentation for the changes

Documentation Changes

  • Run uv run poe doc locally to ensure the documentation pages renders correctly
  • Check and fix any broken links (internal or external)

Expected Behavior

The new page appears under Advanced Customization → Testing plugins and renders correctly. The example plugin and its tests are copy-pasteable and pass against the current Commitizen release.

Steps to Test This Pull Request

  1. Run uv run poe doc and open the “Testing plugins” page; confirm it renders.
  2. In a clean environment with commitizen and pytest, create the cz_example.py and tests/test_plugin.py files from the guide.
  3. Run python -m pytest tests/test_plugin.py — all tests pass (I verified: 24 passed).

Additional Context

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add guidelines regarding how to test plugins

1 participant