Skip to content

TestResultParser was never a meaningful extension point#109

Merged
abayer merged 2 commits intojenkinsci:masterfrom
jglick:TestResultParser
Apr 12, 2019
Merged

TestResultParser was never a meaningful extension point#109
abayer merged 2 commits intojenkinsci:masterfrom
jglick:TestResultParser

Conversation

@jglick
Copy link
Copy Markdown
Member

@jglick jglick commented Aug 20, 2018

7a6dcfe claimed to be introducing an “extension point” with a particular behavior—that you could register a new one in a plugin and it would be called by the standard publisher task. This does not appear to have ever been true, as you can see here. Similarly here, and in utplsql and mentor-questa-vrm (see index), and ecutest (unindexed). The aggregated commit from Subversion even includes the note that

The all() method is removed after the following discussion:

  • I propose we remove AbstractTestResult.all(). I don't think being able
    to enumerate AbstractTestResult subtypes buy us anything, since those
    can only be instantiated by parsers that intimately know how to
    instantiate them properly. Or did I miss the purpose of this?

I put in the all method because it was suggested by the wiki:
"You also need to define the static "all" method..."
http://wiki.hudson-ci.org/display/HUDSON/Defining+a+new+extension+point
so I don't have a problem with removing it.

yet the all() method remained.

In the interests of removing dead code and reducing confusion I am just deprecating everything that does not seem to actually be used. I am retaining the fact that JUnitParser extends TestResultParser to avoid breaking callers that might be linking against that binary signature, like PipelineRealtimeTestResultAction.parse, and retaining the @Extension to avoid breaking labeled-test-groups-publisher.

Copy link
Copy Markdown
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.

Needs full plugin compatibility review before it can be considered. First plugin I tried in GitHub search was actually relying on the extension point (maybe a bad idea tho).

@jglick
Copy link
Copy Markdown
Member Author

jglick commented Aug 21, 2018

With only 231 installations, and functionality which is completely superseded by a supported feature (junit within Pipeline stages), I would not be sad to break that plugin. Still, this could be reworked to remain compatible while making it clear that this code path is not used in any supported scenario.

* @see DefaultTestResultParserImpl
*/
public abstract class TestResultParser implements ExtensionPoint {
public abstract class TestResultParser {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It won't be compatible in all cases after this change. Not sure what is the need in this change

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

ExtensionPoint has no methods, and is not even treated as a marker interface at runtime. It is used purely for documentation, including this list. Since TestResultParser is not in fact being used as an extension point, and AFAICT never was, this clears up the point of confusion.

@abayer abayer merged commit 8d03260 into jenkinsci:master Apr 12, 2019
@jglick jglick deleted the TestResultParser branch April 12, 2019 14:40
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.

3 participants