-
Notifications
You must be signed in to change notification settings - Fork 170
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
WIP Implement SfTest and sinceVersion #1583
base: master
Are you sure you want to change the base?
Conversation
|
||
@Retention(RetentionPolicy.RUNTIME) | ||
@Target({ElementType.METHOD, ElementType.TYPE}) | ||
public @interface SfTest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
annotation could be put on class, not only method - is this class aware of it?
are we able to handle different version on both levels? e.g. class declares availability since 3.14.5 whereas method declares availability for version 3.14.6
another question is that during implemntation we are not sure which version will be released so the given version should be last version that does not have the tested feature
@Override | ||
public Statement apply(Statement statement, FrameworkMethod frameworkMethod, Object o) { | ||
SfTest sfTest = frameworkMethod.getAnnotation(SfTest.class); | ||
if (sfTest == null || sfTest.sinceVersion() == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
version parameter should be mandatory - if not why don't use normal test paramter?
this.patch = patch; | ||
} | ||
|
||
private static Version parse(String str) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it could be secondary constructor
return statement; | ||
} | ||
Version testSinceVersion = Version.parse(sfTest.sinceVersion()); | ||
if (currentVersion.compareTo(testSinceVersion) >= 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
current version is last released version so it should not be equal to 0
SonarQube Quality Gate |
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
Overview
SNOW-XXXXX
External contributors - please answer these questions before submitting a pull request. Thanks!
Please answer these questions before submitting your pull requests. Thanks!
What GitHub issue is this PR addressing? Make sure that there is an accompanying issue to your PR.
Fixes #NNNN
Fill out the following pre-review checklist:
Please describe how your code solves the related issue.
Please write a short description of how your code change solves the related issue.
Pre-review checklist