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

[JENKINS-34217] add option to disable historical statistics gathering for test results #42

Closed

Conversation

jcarrothers-sap
Copy link

This change adds a new job configuration property that, when enabled, disables
the display of the test trend chart and prevents the plugin from even calculating
how long a test has been failing for, thus saving the work of digging up historical
records.

@jcarrothers-sap
Copy link
Author

I'm afraid I don't understand why the test that is failing is failing. I can't find where its data is coming from and I've been over my own changes a dozen times and I cannot see where the side-effect is coming from. Some help would be appreciated.

@jenkinsadmin
Copy link
Member

Thank you for this pull request! Please check this document for how the Jenkins project handles pull requests.

… for test results

This change adds a new job configuration property that, when enabled, disables
the display of the test trend chart and prevents the plugin from even calculating
how long a test has been failing for, thus saving the work of digging up historical
records.
My original code was incorrectly exiting a loop inside getPreviousResult()
when it shouldn't have been.
Copy link
Member

@oleg-nenashev oleg-nenashev left a comment

Choose a reason for hiding this comment

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

The PR looks good to me excepting the formatting and missing tests

*
*/
public class JobTestResultDisplayProperty extends JobProperty<Job<?, ?>> {
private final boolean disableHistoricalResults;
Copy link
Member

Choose a reason for hiding this comment

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

Ideally there should be space-based indenting instead of tabs

}

@Extension
public static class DescriptorImpl extends JobPropertyDescriptor {
Copy link
Member

Choose a reason for hiding this comment

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

Add @Symbol - Useful for Pipeline and JobDSL

}

@Override
public JobTestResultDisplayProperty newInstance(StaplerRequest req, JSONObject formData) {
Copy link
Member

Choose a reason for hiding this comment

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

Why not just DataBoundConstructor?


// abort if the job is configured to not do this
AbstractTestResultAction tra = b.getAction(getParentAction().getClass());
if ( tra != null && !tra.shouldCalculatePreviousResults()) return null;
Copy link
Member

Choose a reason for hiding this comment

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

brackets

@erik-brangs
Copy link

Is anyone interested in doing the work to merge this? The functionality sounds like it would be very useful for our setup.

@deusnuno
Copy link

deusnuno commented Jul 8, 2019

Hello! Has this feature been discarded?

@timja
Copy link
Member

timja commented Jul 30, 2020

Closing in favour of #133

@timja timja closed this Jul 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants