Skip to content

test(cz_customize): add missing YAML configuration file tests #1516

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

AdrianDC
Copy link
Contributor

@AdrianDC AdrianDC commented Jun 8, 2025

Partial rebase of #1207 for tests commits made last summer.

AdrianDC added 3 commits June 8, 2025 15:49
> commitizen.exceptions.InvalidConfigurationError: Failed to parse not_exist.yaml: while scanning a double-quoted scalar
> found unknown escape character 's'

Signed-off-by: Adrian DC <[email protected]>
> test_commit_parser[config2] - AssertionError:
>   assert '(?P<message>.*)' == '^(?P<change_...<message>.*)?'
> test_changelog_pattern[config2] - AssertionError:
>   assert '.*' == '^(feature|bug fix)?(!)?'
> test_change_type_map[config2] - AssertionError:
>   assert None == {'bug fix': 'Fix', 'feature': 'Feat'}

Signed-off-by: Adrian DC <[email protected]>
Copy link

codecov bot commented Jun 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.66%. Comparing base (120d514) to head (daf1680).
Report is 743 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1516      +/-   ##
==========================================
+ Coverage   97.33%   97.66%   +0.32%     
==========================================
  Files          42       57      +15     
  Lines        2104     2653     +549     
==========================================
+ Hits         2048     2591     +543     
- Misses         56       62       +6     
Flag Coverage Δ
unittests 97.66% <ø> (+0.32%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Lee-W Lee-W self-assigned this Jun 8, 2025
Comment on lines +113 to +119
message_template: '{{change_type}}:{% if show_message %} {{message}}{% endif %}'
example: 'feature: this feature enable customize through config file'
schema: "<type>: <body>"
schema_pattern: "(feature|bug fix):(\\s.*)"
bump_pattern: "^(break|new|fix|hotfix)"
commit_parser: "^(?P<change_type>feature|bug fix):\\s(?P<message>.*)?"
changelog_pattern: "^(feature|bug fix)?(!)?"
schema: '<type>: <body>'
schema_pattern: '(feature|bug fix):(\\s.*)'
bump_pattern: '^(break|new|fix|hotfix)'
commit_parser: '^(?P<change_type>feature|bug fix):\\s(?P<message>.*)?'
changelog_pattern: '^(feature|bug fix)?(!)?'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure why we need to change it 🤔

@@ -125,7 +125,7 @@ commitizen:
new: MINOR
fix: PATCH
hotfix: PATCH
change_type_order: ["BREAKING CHANGE", "feat", "fix", "refactor", "perf"]
change_type_order: ['BREAKING CHANGE', 'feat', 'fix', 'refactor', 'perf']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here


commit_mock = mocker.patch("commitizen.git.commit")
commit_mock.return_value = cmd.Command(
'nothing added to commit but untracked files present (use "git add" to track)',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we might encounter issue if the language is not set to en_US. probably worth setting it up for this test

Copy link
Member

@Lee-W Lee-W left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

idea looks good. left some nitpicks

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.

2 participants