Skip to content

JUnit

Buildnote CLI can collect JUnit XML test results and submit them to the buildnote service. JUnit XML is used by JVM ecosystems, JavaScript testing frameworks (Mocha, Jest), and many other testing tools.

Configuration

To enable collection of JUnit test results add the following section to buildnote.json config file

json
{
  "collect": {
    ...
    "junit": {
      "enabled": true,
      "include": [
        "**/TEST-*.xml"
      ]
    }
    ...
  }
}

Metadata

You can attach metadata to JUnit test results by configuring the metadata section:

json
{
  "collect": {
    ...
    "junit": {
      "enabled": true,
      "include": [
        "**/TEST-*.xml"
      ],
      "metadata": {
        "test-user": "{{ env.USER }}"
      }
    }
    ...
  }
}

Excluding paths

To exclude any paths from collection configure exclude section with required globs.

json
{
  "collect": {
    ...
    "junit": {
      "exclude": [
        "/any/excluded/glob/**/"
      ]
    }
    ...
  }
}