-
-
Notifications
You must be signed in to change notification settings - Fork 77
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
use a more simple Jenkinsfile and build on windows #508
Conversation
olamy
commented
Feb 23, 2022
- Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
- Ensure that the pull request title represents the desired changelog entry
- Please describe what you did
- Link to relevant issues in GitHub or Jira
- Link to relevant pull requests, esp. upstream and downstream changes
- Ensure you have provided tests - that demonstrates feature works or fixes 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.
This is archiving bogus test results like https://ci.jenkins.io/job/Tools/job/plugin-pom/job/PR-508/5/testReport/io.jenkins.plugins/RandomClassTest/linux_8___Build__linux_8____whatever/. (Whereas ITs are not tracked.) Can we at least suppress junit
collecting TEST-*.xml
from IT subdirs?
ansiColor('xterm') { | ||
withEnv(['MAVEN_OPTS=-Djansi.force=true']) { | ||
sh 'mvn -B -Dstyle.color=always -ntp clean verify' |
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.
Results in much less readable IT logs unfortunately.
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.
Results in much less readable IT logs unfortunately.
do you mean in Jenkins?
because before it looks a bit strange to me and full of weird characters (from https://ci.jenkins.io/job/Tools/job/plugin-pom/job/master/601/console )
whereas with this change (https://ci.jenkins.io/job/Tools/job/plugin-pom/job/PR-508/5/console)
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 am afraid the ansicolor
plugin is buggy when it comes to partial logs. https://ci.jenkins.io/job/Tools/job/plugin-pom/job/master/601/consoleFull looks nice.
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.
Co-authored-by: Tim Jacomb <21194782+timja@users.noreply.github.com>
Signed-off-by: Olivier Lamy <olamy@apache.org>
94bbbd5
to
1ca45c0
Compare
weird pipeline cannot find invoker junit results whereas https://github.com/jenkins-infra/pipeline-library/blob/4688c7b4d73ea5450863c99ea56df544a904928b/vars/buildPlugin.groovy#L118 |
Signed-off-by: Olivier Lamy <olamy@apache.org>
arff need the boolean. and need this as well jenkins-infra/pipeline-library#307 |
I suspect jenkins-infra/pipeline-library#307 is missing the point. We want for example |
In general, I am not really a fan of using the |
please note this commit 1ca45c0 which prevents maven IT tests to generate some surefire reports |
Right. Artificially changing the behavior of a plugin build just so that we do not accidentally pick up files which we should not have been looking for to begin with does not seem ideal, though. |
Sorry I don't understand which files you are referring too? Can you please explain? thanks |
… streaming logs only on failure might be a more interesting option to avoid noise Signed-off-by: Olivier Lamy <olamy@apache.org>
Signed-off-by: Olivier Lamy <olamy@apache.org>
Signed-off-by: Olivier Lamy <olamy@apache.org>
…rded Signed-off-by: Olivier Lamy <olamy@apache.org>
ok I figure out. now build logs from ITs are recorded separately and easier to find than looking at the full console output. |
|
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 test results are now being recorded by junit
, which seems to work well. (Do not have an example of a failing test but I suppose this would include the mvn
subcommand output in the test stdio.)
Another problem caused by inappropriately using a script intended for a plugin build on something that runs ITs of plugins: https://ci.jenkins.io/job/Tools/job/plugin-pom/job/PR-508/12/artifact/target/its/ archiving lots of junk.
Still -0 on this I guess. Works, but more awkwardly than directly writing a Jenkinsfile
tailored to the details of the repository.
<streamLogs>true</streamLogs> | ||
<writeJunitReport>true</writeJunitReport> | ||
<junitPackageName>io.jenkins.plugins.pom.its</junitPackageName> | ||
<!-- <streamLogs>true</streamLogs>--> |
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.
<!-- <streamLogs>true</streamLogs>--> |
@@ -1 +1 @@ | |||
invoker.goals=-P jmh-benchmark -Dstyle.color=always -ntp clean test | |||
invoker.goals=-P jmh-benchmark -ntp clean test |
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.
invoker.goals=-P jmh-benchmark -ntp clean test | |
invoker.goals=-P jmh-benchmark -ntp clean test |
@@ -1 +1 @@ | |||
invoker.goals=-Dstyle.color=always -ntp clean install | |||
invoker.goals= -ntp clean install |
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.
invoker.goals= -ntp clean install | |
invoker.goals=-ntp clean install |
@@ -1,3 +1,3 @@ | |||
invoker.goals.1=-Dstyle.color=always -ntp clean install | |||
invoker.goals.1= -ntp clean install |
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.
invoker.goals.1= -ntp clean install | |
invoker.goals.1=-ntp clean install |
# real extension will not work here due to its not being at the root of a repository, so fake it: | ||
invoker.goals.2=-Dstyle.color=always -ntp -Dset.changelist -Dchangelist=-rc1234.deadbeef5678 clean install | ||
invoker.goals.2= -ntp -Dset.changelist -Dchangelist=-rc1234.deadbeef5678 clean install |
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.
invoker.goals.2= -ntp -Dset.changelist -Dchangelist=-rc1234.deadbeef5678 clean install | |
invoker.goals.2=-ntp -Dset.changelist -Dchangelist=-rc1234.deadbeef5678 clean install |
@@ -1,2 +1,2 @@ | |||
# release.skipTests normally set in jenkins-release profile since release:perform would do the tests | |||
invoker.goals=-Dstyle.color=always -ntp -Pjenkins-release -Drelease.skipTests=false clean verify | |||
invoker.goals= -ntp -Pjenkins-release -Drelease.skipTests=false clean verify |
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.
invoker.goals= -ntp -Pjenkins-release -Drelease.skipTests=false clean verify | |
invoker.goals=-ntp -Pjenkins-release -Drelease.skipTests=false clean verify |
@@ -1,3 +1,3 @@ | |||
# install, not verify, because we want to check the artifact as we would be about to deploy it | |||
# release.skipTests normally set in jenkins-release profile since release:perform would do the tests | |||
invoker.goals=-Dstyle.color=always -ntp -Pjenkins-release -Drelease.skipTests=false clean install | |||
invoker.goals= -ntp -Pjenkins-release -Drelease.skipTests=false clean install |
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.
invoker.goals= -ntp -Pjenkins-release -Drelease.skipTests=false clean install | |
invoker.goals=-ntp -Pjenkins-release -Drelease.skipTests=false clean install |
@@ -36,6 +36,9 @@ under the License. | |||
<activation> | |||
<activeByDefault>true</activeByDefault> | |||
</activation> | |||
<properties> | |||
<disableXmlReport>true</disableXmlReport> |
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 is the part that makes me somewhat uncomfortable.
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 you wanted to avoid noise (#508 (review)) from those files which should not be scanned by buildPlugin
so I tried to address this in 2 ways: this and this one jenkins-infra/pipeline-library#307
and this would have impact only if we have an IT test running mvn site
and making some assertions on having the surefire-report html file correctly generated.
surefire does not use those files to detect error there are only here to build reports by other plugins.
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.
surefire does not use those files to detect error there are only here to build reports by other plugins.
Yes, I know.
@@ -1,2 +1,2 @@ | |||
invoker.goals=-Dstyle.color=always -ntp clean install | |||
invoker.goals= -ntp clean install |
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.
invoker.goals= -ntp clean install | |
invoker.goals=-ntp clean install |
<writeJunitReport>true</writeJunitReport> | ||
<junitPackageName>io.jenkins.plugins.pom.its</junitPackageName> | ||
<!-- <streamLogs>true</streamLogs>--> | ||
<streamLogsOnFailures>true</streamLogsOnFailures> |
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 think you do not actually want this. If a test fails, junit
should record the failure with details right?
<streamLogsOnFailures>true</streamLogsOnFailures> |
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.
just to have the failure directly in the build output in case of IT failure which may be a bit more convenient when running test locally.
see output here https://ci.jenkins.io/job/Tools/job/plugin-pom/job/PR-508/11/console
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 running test locally
OK. Or you can use the profile trick I developed in jenkinsci/maven-hpi-plugin#301.
if you are -0 that's fine we can forget this. |
Yeah it is hard to say. |