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

build of zulip-plugin fails because of deprecated method getTestResultAction #15

Closed
nestie opened this issue Feb 5, 2019 · 3 comments
Closed
Assignees

Comments

@nestie
Copy link

nestie commented Feb 5, 2019

A build of zulip-plugin failed with error
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.1:compile (default-compile) on project humbug: Compilation failure
[ERROR] /var/lib/jenkins/zulip-plugin/src/main/java/hudson/plugins/humbug/HumbugNotifier.java:[104,38] cannot find symbol
[ERROR] symbol: method getTestResultAction()
[ERROR] location: variable build of type hudson.model.Run

According to https://javadoc.jenkins-ci.org/hudson/model/AbstractBuild.html the method is deprecated:
@deprecated
public Action getTestResultAction()
Deprecated. Use Actionable.getAction(Class) on AbstractTestResultAction.

To fix this I've added the following to pom.xml:

org.jenkins-ci.plugins
junit
1.7

and changed src/main/java/hudson/plugins/humbug/HumbugNotifier.java by adding the import
import hudson.tasks.test.AbstractTestResultAction;
and changing
int failCount = build.getTestResultAction().getFailCount();
to
int failCount = build.getAction(AbstractTestResultAction.class).getFailCount();

@butchyyyy butchyyyy self-assigned this Feb 5, 2019
@butchyyyy
Copy link
Collaborator

Thanks for reporting. This is a result of falsely merged PR that was made against the old version of the plugin that did not support pipelines (used AbstractBuild instead of Run in the notification processing).
It will befixed today.

@butchyyyy
Copy link
Collaborator

Fixed via 8a616e8

@nestie
Copy link
Author

nestie commented Feb 5, 2019

Great. Thanks

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

No branches or pull requests

2 participants