-
Notifications
You must be signed in to change notification settings - Fork 33
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
Added detecting cucumber support to pts scripts #948
Merged
+40
−4
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
ddca40d
Added detecting cucumber support to pts scripts
ribafish 26ceade
Refactored method cucumberUsed to check if any dependency is from gro…
ribafish d3f0ed7
Improved code readability around detecting cucumber support.
ribafish 6dc81fb
Further improved code readability around detecting cucumber support.
ribafish File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Is the
testImplementation
always a resolvable dependency? I'm wondering if there are cases where this check would just returnfalse
ortrue
incorrectly if it isn't resolvable.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.
Well, the code will check all configurations. As for if
testImplementation
is always resolvable...I'm not sure, but if it's not resolvable, then how it would work (the project setup itself) without it being resolved?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.
I don't think
testImplementation
is resolvable in the same way thatimplementation
is not resolvable. They just declare a group of dependencies. Can you please check?This is a useful blog post that someone in our slack linked to that covers this topic.
https://dev.to/autonomousapps/configuration-roles-and-the-blogging-industrial-complex-21mn
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.
That's true, however, at the end, in order for a dependency to be used it will need to be resolved in one of the configurations. The implementation I made will check all resolvable implementations for cucumber. Or am I missing something?
Note: I decided not to use the
task.classpath
, as that's a file collection and getting the group id from jars is more complicated than this, as well as not as exact (for example for shaded dependencies).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.
Is this method iterating through the dependencies of
testImplementation
? y/n? You can debug this if needed with some printlines (or tagging).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.
No, for a simple cucumber test project it's checking
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.
I see, I think we only need to check the
test
configurations. For example, if thecompileClasspath
contains cucumber then it isn't necessarily being used in a test (perhaps we're building a cucumber based plugin or framework).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.
Ok since there isn't a good way to detect only the test configuration and we assume that this script will be used with a solutions engineer present this is okay.