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

test(utils): Add additional tests for version helper functions #562

Merged
merged 2 commits into from
Nov 11, 2024

Conversation

Lms24
Copy link
Member

@Lms24 Lms24 commented Nov 11, 2024

This PR adds some tests for version helper functions used in multiple craft targets.

This came up after investigating getsentry/sentry-docs#11716 where I found out that we have a specific list of pre-release suffix identifiers that we consider a pre-release, instead of considering every -x string after the patch number a pre-release.

Specifically, as mentioned in #561 (comment), we don't consider the (shorthand) python post release pattern (TIL) a pre-release, although parseVersion actually puts it into the returned .pre property.

Tests added:

  • parseVersion parses Python post release values
  • isValidVersion returns true for Python post releases
  • isPreviewVersion returns false for Python post releases
  • More tests for isPreviewVersion returning true for allowed identifiers

I don't have strong feelings on getting this merged, so feel free to reject it but I figured I might as well open a PR after having added these tests locally.

@Lms24 Lms24 self-assigned this Nov 11, 2024
Copy link
Member

@asottile-sentry asottile-sentry left a comment

Choose a reason for hiding this comment

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

fixnship

major: 1,
minor: 2,
patch: 3,
pre: '1',
Copy link
Member

Choose a reason for hiding this comment

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

might be worth a comment that it misinterprets this -- but it's ok as long as we don't utilize this function for python in the same way

@Lms24 Lms24 enabled auto-merge (squash) November 11, 2024 17:25
@Lms24 Lms24 merged commit 2fa5479 into master Nov 11, 2024
10 checks passed
@Lms24 Lms24 deleted the lms/test-python-post-release branch November 11, 2024 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants