-
Notifications
You must be signed in to change notification settings - Fork 56
matching test-harness when casc is added #261
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
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,6 +35,7 @@ | |
| import hudson.model.UpdateSite.Plugin; | ||
| import hudson.util.VersionNumber; | ||
| import io.jenkins.lib.versionnumber.JavaSpecificationVersion; | ||
|
|
||
| import java.io.BufferedReader; | ||
| import java.io.File; | ||
| import java.io.FileInputStream; | ||
|
|
@@ -74,6 +75,7 @@ | |
| import javax.xml.transform.TransformerFactory; | ||
| import javax.xml.transform.stream.StreamResult; | ||
| import javax.xml.transform.stream.StreamSource; | ||
|
|
||
| import net.sf.json.JSONArray; | ||
| import net.sf.json.JSONObject; | ||
| import org.apache.commons.io.IOUtils; | ||
|
|
@@ -379,11 +381,11 @@ && new VersionNumber(coreCoordinates.version).compareTo(new VersionNumber("1.485 | |
| } | ||
|
|
||
| if (failed && config.isFailOnError()) { | ||
| throw new AbortException("Execution was aborted due to the failure in a plugin test (-failOnError is set)"); | ||
| throw new AbortException("Execution was aborted due to the failure in a plugin test (-failOnError is set)"); | ||
| } | ||
|
|
||
| return report; | ||
| } | ||
| } | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. unnecessary whitespace change, and adds tabs to a file that uses spaces |
||
|
|
||
| protected void generateHtmlReportFile() throws IOException { | ||
| if (!config.reportFile.exists() || !config.reportFile.isFile()) { | ||
|
|
@@ -432,7 +434,7 @@ private TestExecutionResult testPluginAgainst(MavenCoordinates coreCoordinates, | |
|
|
||
| File pluginCheckoutDir = new File(config.workDirectory.getAbsolutePath() + File.separator + plugin.name + File.separator); | ||
|
|
||
| try { | ||
| try { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. unnecessary whitespace change, and adds tabs to a file that uses spaces |
||
| // Run any precheckout hooks | ||
| Map<String, Object> beforeCheckout = new HashMap<>(); | ||
| beforeCheckout.put("pluginName", plugin.name); | ||
|
|
@@ -652,11 +654,11 @@ private UpdateSite.Data extractUpdateCenterData(Map<String, String> groupIDs){ | |
| } | ||
|
|
||
| private UpdateSite.Data scanBom(HashMap<String, String> pluginGroupIds, String pluginRegExp) throws IOException, PomExecutionException, XmlPullParserException { | ||
|
|
||
| JSONObject top = new JSONObject(); | ||
| top.put("id", DEFAULT_SOURCE_ID); | ||
| JSONObject plugins = new JSONObject(); | ||
|
|
||
| for (File entry : getBomEntries()) { | ||
| String name = entry.getName(); | ||
| Matcher m = Pattern.compile(pluginRegExp).matcher(name); | ||
|
|
@@ -762,9 +764,9 @@ private String solveVersionFromModel(Model model) { | |
| Parent parent = model.getParent(); | ||
| return version != null ? version : parent != null ? parent.getVersion() : StringUtils.EMPTY; | ||
| } | ||
|
|
||
| /** | ||
| * Given a value and a model, it checks if it is an interpolated value. In negative case it returns the same | ||
| * Given a value and a model, it checks if it is an interpolated value. In negative case it returns the same | ||
| * value. In affirmative case, it retrieves its value from the properties of the Maven model. | ||
| * @param model | ||
| * @param version | ||
|
|
@@ -774,11 +776,11 @@ private String getProperty(Model model, String value) { | |
| if (!value.contains("$")) { | ||
| return value; | ||
| } | ||
|
|
||
| String key = value.replaceAll("\\$", "") | ||
| .replaceAll("\\{", "") | ||
| .replaceAll("\\}", ""); | ||
|
|
||
| return getProperty(model, model.getProperties().getProperty(key)); | ||
| } | ||
|
|
||
|
|
@@ -997,6 +999,12 @@ private void addSplitPluginDependencies(String thisPlugin, MavenRunner.Config mc | |
| toAddTest = difference(pluginDeps, toAddTest); | ||
| toAddTest = difference(toAdd, toAddTest); | ||
|
|
||
| if(toReplaceTest.containsKey("configuration-as-code")){ | ||
| VersionNumber versionNumber = toReplaceTest.get("configuration-as-code"); | ||
| pluginGroupIds.put("test-harness", "io.jenkins.configuration-as-code"); | ||
| toReplaceTest.put("test-harness", versionNumber); | ||
| } | ||
|
|
||
| if (!toAdd.isEmpty() || !toReplace.isEmpty() || !toAddTest.isEmpty() || !toReplaceTest.isEmpty()) { | ||
| System.out.println("Adding/replacing plugin dependencies for compatibility: " + toAdd + " " + toReplace + "\nFor test: " + toAddTest + " " + toReplaceTest); | ||
| pom.addDependencies(toAdd, toReplace, toAddTest, toReplaceTest, coreDep, pluginGroupIds, convertFromTestDep); | ||
|
|
||
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.
unnecessary whitespace change, and adds tabs to a file that uses spaces