-
Notifications
You must be signed in to change notification settings - Fork 16
Add spiffy script for testing runtime environments #9
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
Merged
Conversation
This file contains hidden or 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
4d89855
to
c373dbf
Compare
Read the docs. Maybe it is helpful for testing now. Example usage: $ melting-pot.sh net.imagej:imagej-common:0.15.1 \ -r http://maven.imagej.net/content/groups/public \ -c org.scijava:scijava-common:2.44.3-SNAPSHOT \ -i 'org.scijava:*,net.imagej:*,net.imglib2:*,io.scif:*' \ -e net.imglib2:imglib2-roi -v Make sure you 'mvn install' scijava-common 2.44.3-SNAPSHOT first.
This still prepares the melting pot according to the given criteria, but does not actually call "mvn test" at the end. It will be very useful for regression testing with cram.
It's a relatively complex beast, so let's really make sure it works.
This helps clarify the intent of each variable, as well as potentially avoiding certain classes of bugs relating to those variable names used across multiple functions.
Better to change the directory (and back) from within the function.
The default behavior of the melting pot is to create a multi-module build of all project components which match the inclusion criteria (i.e., the includes and excludes), minus any changed components specified by the '--changes' flag. However, when the set of changes is small, and the main interest is in testing breakages relating to those changes, then it is nice to limit the build to only those components which depend on the changed components (either directly or transitively). Hence, the new '--prune' flag does exactly that! Be warned that even if a component does not explicitly depend on a changed component, it might still be affected by changes in that component. One example is components which use dependency injection at runtime, using resources discovered on the classpath (e.g., plugins).
When no project is given, but -h is passed, just show the help, instead of also complaining about a missing project.
It is only used in one function.
For projects like sc.fiji:fiji:2.0.0-SNAPSHOT, there is no tag or branch called 'fiji-2.0.0-SNAPSHOT' because it is a snapshot. The -b option allows to specify the branch to use explicitly; e.g., for the fiji GAV above, it should be master. So now the following invocation is much closer to working: melting-pot.sh sc.fiji:fiji:2.0.0-SNAPSHOT -b master \ -i 'org.scijava:*,net.imagej:*,net.imglib2:*,io.scif:*,sc.fiji:*' \ -r http://maven.imagej.net/content/groups/public -v -f
I like "> 0" aesthetically more than ">= 1".
We will want to extract other information from POMs safely, so let's provide a more general-purpose xpath function using xmllint.
This lets us recursively extract values from POMs specified as GAVs.
We will try again with the parent POM, if possible.
This will make room for an even more verbose '--debug' option.
If the SCM link was a multi-module project, let's cherry-pick the relevant child module to include in the melting pot. This makes some assumptions: * The child module will be named the same as its artifactId. * It will be exactly one directory lower than the repository toplevel. Our main use case, TrakEM2, does conform to these expectations, though.
That way, things won't explode in weird ways.
The order of files returned is dependent on the file system and/or the version of find. Sorting avoids the issue.
This makes regression testing easier.
Unfortunately, this makes the debugging output nondeterministic... so the cram tests might fail the first time they are run. But only the first time. Pragmatically, I am OK with it.
OK, the script is now spiffy enough to support TrakEM2, and works on both OS X and Linux, and with Maven 3.0.5 and 3.3.3 (and hopefully everything in between). So: good enough for the master branch! |
ctrueden
added a commit
that referenced
this pull request
Jul 30, 2015
It's the melting pot! It scans, analyzes, generates, prunes, builds, tests and mops! It's a floor wax, and a dessert topping! It even has automated tests using cram. Boss. For a complete rundown, see the docs added as part of 05edd0c.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
It's the melting pot! It scans, analyzes, generates, prunes, builds, tests and mops! It's a floor wax, and a dessert topping!
It even has automated tests using cram. Boss.
For a complete rundown, see the docs added in the initial commit.
@axtimwalde I hope it helps you. Let me know any comments and suggestions.
@tpietzsch Thanks for your earlier review. This update is pretty similar to what you already saw, with just a couple of improvements. It also uses xmllint now instead of sed as you suggested.
@hinerm Mentioning you too, in case you care to peruse.
If no one sees any horrible problems, I will merge tomorrow some time.