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

Add BuildWatcher support to RealJenkinsRule #519

Closed
wants to merge 1 commit into from

Conversation

Vlatombe
Copy link
Member

Calling rjr.watchBuilds() will register BuildWatcher and print build logs.

Result can be observed by running mvn test -Dtest=RealJenkinsRuleTest#agentBuild

  • 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

Calling rjr.watchBuilds() will register BuildWatcher and print build
logs.
Comment on lines +878 to +880
if (buildWatcher != null) {
buildWatcher.after();
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not strictly necessary since the jvm will shutdown just after.

@Vlatombe Vlatombe changed the title Add BuildWatcher support to RealJenkinsRule Add BuildWatcher support to RealJenkinsRule Nov 18, 2022
Copy link
Member

@jglick jglick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK but there is actually a better way which does not require anything to run inside the controller JVM and is more flexible. BuildWatcher as currently designed does not handle the case that the build is already running when the controller starts (or, in this case, when the Surefire JVM connects to it). That means it does not support @LocalData, and it only supports watching builds across JenkinsSessionRule restarts insofar as the JVM does not exit. I have a plan to write this up properly and support RJR. Not sure if this patch would conflict with that.

@Vlatombe
Copy link
Member Author

Vlatombe commented Dec 5, 2022

Superceded by #532

@Vlatombe Vlatombe closed this Dec 5, 2022
@Vlatombe Vlatombe deleted the rjr-buildwatcher branch December 5, 2022 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants