Skip to content

TestNG

Buildnote CLI can collect TestNG XML test results and submit them to the buildnote service. TestNG is commonly used by Java frameworks and applications.

Configuration

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

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

Metadata

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

json
{
  "collect": {
    ...
    "testng": {
      "enabled": true,
      "include": [
        "**/*testng-results.xml"
      ],
      "metadata": {
        "test-user": "{{ env.USER }}",
        "build-environment": "{{ env.BUILD_ENV }}"
      }
    }
    ...
  }
}

Excluding paths

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

json
{
  "collect": {
    ...
    "testng": {
      "exclude": [
        "**/*excluded.xml",
        "/any/excluded/glob/**/"
      ]
    }
    ...
  }
}