-
Notifications
You must be signed in to change notification settings - Fork 129
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
[JENKINS-57653] Introduce JMH benchmarks to Jenkins Test Harness #135
Conversation
@@ -85,8 +85,7 @@ THE SOFTWARE. | |||
<dependency> | |||
<groupId>org.jenkins-ci.main</groupId> | |||
<artifactId>jenkins-war</artifactId> | |||
<!--to have access to User.getById--> | |||
<version>1.651.2</version> | |||
<version>2.60.3</version> |
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.
As discussed in Gitter, I am about submitting a wider thread about dropping Java 7 support in our devtools
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 can confirm the same test failure happens by upgrading Jenkins core on the latest master. |
My bad about the matrix auth suggestion. Let's stick to 2.60.3 if possible. If you already spent some time on Matrix Auth benchmarks, we can definitely suggest them in Matrix Auth plugin later |
Since Role Strategy and Matrix auth both have some issues, what plugin should I go with here just to verify that Configuration as Code is working? |
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.
The code looks good to me, just few minor comments.
I think we could proceed with documentation for the change:
- Benchmarking documentation could be put directly into the repository (e.g. under
docs/
), no specific need to keep it elsewhere. JUnit was outside due to historical reasons - Polish Javadoc a bit so that new classes have some documentation and annotations (maybe with a link to documentation in the repo)
.gitignore
Outdated
@@ -13,3 +13,6 @@ out | |||
.classpath | |||
.project | |||
build | |||
|
|||
# reports produced from benchmarks | |||
jmh-benchmark-report.json |
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 might be better to move the default output to target/jmh-reports/*
or so so that it follows the convention used in the Maven Surefire Plugin
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.
Done though I had to create the directory from the test method itself.
Incrementals do not seem to work anymore, I will try to figure out the reason.
|
check this ^^^ |
Unrelated failure:
|
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.
Looks good to me overall, but we need a decision w.r.t inclusion JCasC code here: https://groups.google.com/d/msg/jenkinsci-dev/cgbYEB3c_Vc/dmV6x0oQAgAJ
Retriggerring the build |
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.
see discussion on dev list
Sorry, I missed it while doing a cleanup of Configuration as code from this pull request. |
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.
Thanks @AbhyudayaSharma ! I discovered one binary compatibility breakage which should be restored imho.
Maybe it also worth moving new static methods from JenkinsRule
to a new static class like JenkinsTestHelper
, but this is an implementation detail. I do not require changing it
@@ -434,7 +428,15 @@ public void before() throws Throwable { | |||
* Configures the update center setting for the test. | |||
* By default, we load updates from local proxy to avoid network traffic as much as possible. | |||
*/ | |||
protected void configureUpdateCenter() throws Exception { |
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.
Protected methods can be overridden in other libraries. This change breaks binary compatibility from what I see
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.
This method did exist but was not doing anything. Thanks for letting me know!
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.
AFAICT it was not fixed, right?
Usage:
configureUpdateCenter(); |
@oleg-nenashev The method was there but it wasn't being used anywhere so overriding would have made no difference. Thanks a lot for letting me know! |
Force pushed to rebase and enable incrementals |
@jenkinsci/jenkins-test-harness-developers I would like to merge it if nobody is against |
And CC @jenkinsci/core, because the group above is empty |
My plan is to merge it by EoD if there is no negative feedback. I checked with @jglick offline, he is fine if I do so (it is a development tool at the end of the day, and its versions can be easily pinned if something goes wrong) |
My general preference is for things like this to live in their own components. Is there a particular reason this needs to be part of |
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 do not care much about code quality of the benchmark stuff (it is experimental new code after all); focusing on code that was changed in normal JenkinsRule
usage.
|
||
jenkins.setCrumbIssuer(new TestCrumbIssuer()); // TODO: Move to _configureJenkinsForTest after JENKINS-55240 |
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 asked for information in JIRA and got none. What is the issue?
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.
When we use configuration as code to setup the Jenkins instance with TestCrumbIssuer
, it was refused to be marshaled. This was happening when the code was in the Role Strategy Plugin.
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.
use configuration as code to setup the Jenkins instance
So, TestCrumbIssuer
not being loaded from the usual location I suppose? Normally it works because of this clause.
@jglick I have used jenkins-test-harness/src/main/java/org/jvnet/hudson/test/JenkinsRule.java Lines 486 to 499 in 5e8843a
Thanks for the review! I hope I have answered your comments. |
I don't know what is happening here. Lines 762 and 763 from the latest commit don't even contain the jenkins-test-harness/src/main/java/org/jvnet/hudson/test/JenkinsRule.java Lines 760 to 765 in 998d75d
|
It's a merge conflict with #132 |
It allows adding features to plugin POM and Pipeline library, see downstream PRs (will add them to the description). Basically the intention here is to make it easily accessible to plugin developers. We could have created a new "jenkins-performance-test-harness" library ofc, but it would be just another component which would be hard to discover. JMH is built on the top of JUnit, so for me it looks better to just keep the functionality as a part of JTH. Side Note: There is a PR to JCasC: jenkinsci/configuration-as-code-plugin#921. If the request is to split this code, we will likely need to discuss splitting code there as well. JCasC test automation will be in all major plugins soon, so splitting framework here and keeping it single on the JCasC side would defeat the purpose of splitting. |
Missed that, sorry. A lot of times when code gets moved around I wind up commenting on things that were actually years old! |
Thanks @jglick ! |
Introduces Java Microbenchmark Harness benchmarks to the test harness to allow JMH benchmarks to be run from everywhere with Jenkins instance available in JMH forks.
This was first implemented in the Role Strategy Plugin. Demo from the May 31st meeting: https://www.youtube.com/watch?v=sr28UADG1AE
Part of Google Summer of Code 2019.
Downstream PRs:
benchmark
property is set plugin-pom#206@jenkinsci/gsoc2019-role-strategy