Skip to content

Add hostname field support to JUnit plugin output #725

@sareelpt

Description

@sareelpt

Problem
The JUnit plugin currently does not expose the hostname field from JUnit XML results, making it impossible to track which host/agent executed specific tests. This limitation affects downstream integrations that rely on the JUnit plugin for test data parsing.

Impact

  • Cannot identify test execution environment in distributed builds
  • Downstream plugins (splunk-devops-plugin, logstash) that depend on junit-plugin cannot access hostname information
  • Reduces traceability and debugging capabilities in multi-agent environments

Expected Behavior
The hostname field from JUnit XML should be available in the plugin's parsed objects and accessible to other plugins that consume JUnit test data.

Current Behavior
Despite the hostname being present in the source JUnit XML files, it is not exposed in the plugin's data model.

Environment
JUnit plugin version: 1300.v03d9d8a_cf1fb_
Affected downstream plugins: splunk-devops-plugin, logstash

Investigation
Based on previous work, this should have been resolved:

PR #129: github.com
PR #541: github.com
Related issue: issues.jenkins.io
However, the hostname field is still not available in the parsed objects despite being present in the source XML.

Steps to Reproduce

  1. Execute tests that generate JUnit XML with hostname attributes
  2. Verify hostname is present in the raw XML
  3. Check if hostname is accessible through JUnit plugin objects
  4. Observe that hostname field is missing from parsed data

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions