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

Hack for io.jenkins.configuration-as-code:test-harness #276

Closed
wants to merge 7 commits into from

Conversation

jglick
Copy link
Member

@jglick jglick commented Mar 11, 2021

Same as #261 but with whitespace cleaned up. Apparently needed for bom though I do not know the details.

If we at least get an incremental deployment from this, #261 and #275 could be closed.

@jglick jglick added the bug label Mar 11, 2021
@jglick
Copy link
Member Author

jglick commented Sep 27, 2021

Need to get this updated, and then #299 verified in bom.

@imonteroperez
Copy link
Contributor

@jetersen
Copy link
Member

https://ci.jenkins.io/blue/organizations/jenkins/jenkinsci-libraries%2Fplugin-compat-tester/detail/PR-276/10/pipeline/167#step-168-log-863

[2021-09-28T10:36:42.697Z] [ERROR] Failed to execute goal on project artifact-manager-s3: Could not resolve dependencies for project io.jenkins.plugins:artifact-manager-s3:hpi:1.6: Could not find artifact io.jenkins.configuration-as-code:test-harness:jar:1.20 in repo.jenkins-ci.org (https://repo.jenkins-ci.org/public/) -> [Help 1]

@jglick
Copy link
Member Author

jglick commented Sep 28, 2021

Still

[ERROR] Failed to execute goal on project artifact-manager-s3: Could not resolve dependencies for project io.jenkins.plugins:artifact-manager-s3:hpi:1.15: Could not find artifact io.jenkins.configuration-as-code:test-harness:jar:1.20 in repo.jenkins-ci.org (https://repo.jenkins-ci.org/public/)

@jglick
Copy link
Member Author

jglick commented Sep 28, 2021

Hmm so artifact-manager-s3 just depends on JCasC in test scope but does not bother with its test harness:

ConfigurationAsCode.get().configure(ConfigAsCodeTest.class.getResource("configuration-as-code.yml").toString());
// assertions about ċonfig…

Apparently this patch breaks that mode.

@timja
Copy link
Member

timja commented Sep 28, 2021

Hmm so artifact-manager-s3 just depends on JCasC in test scope but does not bother with its test harness:

ConfigurationAsCode.get().configure(ConfigAsCodeTest.class.getResource("configuration-as-code.yml").toString());
// assertions about ċonfig…

Apparently this patch breaks that mode.

weird, could either patch that here or just switch it to use the test harness, nothing in bom hits this case at least

@jglick
Copy link
Member Author

jglick commented Sep 28, 2021

Trying to reproduce in a more development-friendly mode than the Docker IT, so far without success (running tests normally):

mvn -f plugins-compat-tester-cli -Dexec.vmArgs= '-Dexec.args=${exec.vmArgs} -classpath %classpath ${exec.mainClass} ${exec.appArgs}' '-Dexec.appArgs=-overridenPlugins io.jenkins:configuration-as-code=1.20 -includePlugins artifact-manager-s3 -reportFile /tmp/pct/report.xml -workDirectory /tmp/pct' -Dexec.mainClass=org.jenkins.tools.test.PluginCompatTesterCli -Dexec.executable=$(which java) exec:exec

This does

     <dependency> 
       <groupId>io.jenkins</groupId>  
       <artifactId>configuration-as-code</artifactId>  
       <scope>test</scope>  
+      <version>1.20</version> 
     </dependency>  

as expected. However it also does this, which is clearly wrong:

+    <dependency> 
+      <groupId>io.jenkins</groupId>  
+      <artifactId>configuration-as-code</artifactId>  
+      <version>1.20</version> 
+    </dependency>  

And this (twice!):

+    <dependency> 
+      <groupId>io.jenkins.configuration-as-code</groupId>  
+      <artifactId>test-harness</artifactId>  
+      <version>1.53</version>  
+      <scope>test</scope> 
+    </dependency>  

PCT is such a train wreck…

@jglick
Copy link
Member Author

jglick commented Sep 28, 2021

Even without my patch, PCT is wrong:

$ mvn dependency:tree|fgrep configuration-as-code
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: io.jenkins:configuration-as-code:jar -> duplicate declaration of version 1.20 @ line 324, column 17
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: io.jenkins:configuration-as-code:jar -> version 1.20 vs 1.53 @ line 413, column 17
[INFO] +- io.jenkins:configuration-as-code:jar:1.53:test

since besides adding the version as expected, it also

+    <dependency> 
+      <groupId>io.jenkins</groupId>  
+      <artifactId>configuration-as-code</artifactId>  
+      <version>1.20</version> 
+    </dependency>  
+    <dependency> 
+      <groupId>io.jenkins</groupId>  
+      <artifactId>configuration-as-code</artifactId>  
+      <version>1.53</version>  
+      <scope>test</scope> 
+    </dependency>  

@jglick
Copy link
Member Author

jglick commented Sep 28, 2021

Will try merging with master to pick up #295 etc.

@timja
Copy link
Member

timja commented Sep 28, 2021

It's already merged

@jglick
Copy link
Member Author

jglick commented Sep 28, 2021

Oh right, I get thrown off guard when other people push to my PRs…

@jglick
Copy link
Member Author

jglick commented Sep 28, 2021

Even without my patch, PCT is wrong

Still true after merging master. Somehow it did not matter fur purposes of this IT.

@jglick jglick marked this pull request as draft September 28, 2021 13:49
@jglick
Copy link
Member Author

jglick commented Sep 28, 2021

@timja do you even remember at this point what fails in bom without this patch?

@timja
Copy link
Member

timja commented Sep 28, 2021

@timja do you even remember at this point what fails in bom without this patch?

no this was a long time ago

@jglick
Copy link
Member Author

jglick commented Jan 27, 2022

Rather than merging in #341, it may be cleaner to file a separate draft PR combining the two just to get an incremental deployment.

@timja
Copy link
Member

timja commented Jan 27, 2022

Rather than merging in #341, it may be cleaner to file a separate draft PR combining the two just to get an incremental deployment.

Possibly, does this version actually work though or is there stuff from master that needs backing out in this PR?

@jglick
Copy link
Member Author

jglick commented Jan 27, 2022

is there stuff from master that needs backing out

Uh…not sure. Should be tracked in jenkinsci/bom#657.

@timja
Copy link
Member

timja commented Jan 27, 2022

I’ll try it out tomorrow unless you happen to have time :)

@timja
Copy link
Member

timja commented Jan 29, 2022

Need to get this updated, and then #299 verified in bom.

causes bom to fail in injected test which we normally ignore failures in

bisect shows that's what is causing the failure atm in jenkinsci/bom#863

@jglick
Copy link
Member Author

jglick commented Jul 28, 2022

Presumed obsolete after jenkinsci/bom#1336.

@jglick jglick closed this Jul 28, 2022
@jglick jglick deleted the configuration-as-code branch July 28, 2022 01:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants