Skip to content

Conversation

@jaypipes
Copy link
Member

@jaypipes jaypipes commented Dec 9, 2025

Adds the ability to return JUnit/XUnit XML or JSON output for run results.

Here's what XUnit output looks like:

<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
  <testsuite name="api.readiness.yaml" time="3.262611263s" failures="0" errors="0" tests="4" timestamp="2025-12-09T13:21:51.723531002-05:00">
    <properties name="path" value="/tmp/chkk-test3209657959/api.readiness.yaml"></properties>
    <testcases name="Cert Manager API Readiness Checks/cmctl check api" time="48.077997ms" status="ok">
      <system-out><![CDATA[[chkk] [Cert Manager API Readiness Checks/0:cmctl check api] using timeout of 10s [plugin default]
[chkk] [Cert Manager API Readiness Checks/0:cmctl check api] exec: cmctl [check api]
[chkk] [Cert Manager API Readiness Checks/0:cmctl check api] exec: stdout: The cert-manager API is ready
[chkk] [Cert Manager API Readiness Checks/0:cmctl check api] spec/run: single-shot (no retries) ok: true
]]></system-out>
    </testcases>
    <testcases name="Cert Manager API Readiness Checks/get webhook pod name" time="16.125059ms" status="ok">
      <system-out><![CDATA[[chkk] [Cert Manager API Readiness Checks/1:get webhook pod name] using retry (exponential: true) [plugin default]
[chkk] [Cert Manager API Readiness Checks/1:get webhook pod name] using timeout of 5s [plugin default]
[chkk] [Cert Manager API Readiness Checks/1:get webhook pod name] kube.get: pods (labels: app.kubernetes.io/component=webhook) (ns: cert-manager)
[chkk] [Cert Manager API Readiness Checks/1:get webhook pod name] save.vars: WEBHOOK_POD_NAME -> cert-manager-webhook-65ccc474d9-sjrkv
[chkk] [Cert Manager API Readiness Checks/1:get webhook pod name] spec/run: attempt 1 after 1.272µs ok: true
]]></system-out>
    </testcases>
    <testcases name="Cert Manager API Readiness Checks/verify webhook pod ready" time="9.795619ms" status="ok">
      <system-out><![CDATA[[chkk] [Cert Manager API Readiness Checks/2:verify webhook pod ready] using retry (exponential: true) [plugin default]
[chkk] [Cert Manager API Readiness Checks/2:verify webhook pod ready] using timeout of 5s [plugin default]
[chkk] [Cert Manager API Readiness Checks/2:verify webhook pod ready] kube.get: replaced name: $WEBHOOK_POD_NAME -> cert-manager-webhook-65ccc474d9-sjrkv
[chkk] [Cert Manager API Readiness Checks/2:verify webhook pod ready] kube.get: pods/cert-manager-webhook-65ccc474d9-sjrkv (ns: cert-manager)
[chkk] [Cert Manager API Readiness Checks/2:verify webhook pod ready] save.vars: WEBHOOK_POD_IP -> 10.244.0.5
[chkk] [Cert Manager API Readiness Checks/2:verify webhook pod ready] spec/run: attempt 1 after 837ns ok: true
]]></system-out>
    </testcases>
    <testcases name="Cert Manager API Readiness Checks/curl pod from test container" time="3.188612588s" status="ok">
      <system-out><![CDATA[[chkk] [Cert Manager API Readiness Checks/3:curl pod from test container] using timeout of 30s
[chkk] [Cert Manager API Readiness Checks/3:curl pod from test container] exec: replaced arg: http://$WEBHOOK_POD_IP:6080/healthz -> http://10.244.0.5:6080/healthz
[chkk] [Cert Manager API Readiness Checks/3:curl pod from test container] exec: kubectl [run chkk-cert-manager-api-check --image=curlimages/curl --rm -i --restart=Never --quiet --command -- curl -s http://10.244.0.5:6080/healthz]
[chkk] [Cert Manager API Readiness Checks/3:curl pod from test container] spec/run: single-shot (no retries) ok: true
]]></system-out>
    </testcases>
  </testsuite>
</testsuites>

And here's JSON output for the same tests:

{
  "testsuites": [
    {
      "name": "api.readiness.yaml",
      "time": "3.073397807s",
      "failures": 0,
      "errors": 0,
      "tests": 4,
      "timestamp": "2025-12-09T13:22:48.881168933-05:00",
      "properties": [
        {
          "name": "path",
          "value": "/tmp/chkk-test672627902/api.readiness.yaml"
        }
      ],
      "testcases": [
        {
          "name": "Cert Manager API Readiness Checks/cmctl check api",
          "time": "64.779856ms",
          "status": "ok",
          "assertions": 0,
          "system-out": {
            "Text": "[chkk] [Cert Manager API Readiness Checks/0:cmctl check api] using timeout of 10s [plugin default]\n[chkk] [Cert Manager API Readiness Checks/0:cmctl check api] exec: cmctl [check api]\n[chkk] [Cert Manager API Readiness Checks/0:cmctl check api] exec: stdout: The cert-manager API is ready\n[chkk] [Cert Manager API Readiness Checks/0:cmctl check api] spec/run: single-shot (no retries) ok: true\n"
          }
        },
        {
          "name": "Cert Manager API Readiness Checks/get webhook pod name",
          "time": "9.11179ms",
          "status": "ok",
          "assertions": 0,
          "system-out": {
            "Text": "[chkk] [Cert Manager API Readiness Checks/1:get webhook pod name] using retry (exponential: true) [plugin default]\n[chkk] [Cert Manager API Readiness Checks/1:get webhook pod name] using timeout of 5s [plugin default]\n[chkk] [Cert Manager API Readiness Checks/1:get webhook pod name] kube.get: pods (labels: app.kubernetes.io/component=webhook) (ns: cert-manager)\n[chkk] [Cert Manager API Readiness Checks/1:get webhook pod name] save.vars: WEBHOOK_POD_NAME -\u003e cert-manager-webhook-65ccc474d9-sjrkv\n[chkk] [Cert Manager API Readiness Checks/1:get webhook pod name] spec/run: attempt 1 after 1.029µs ok: true\n"
          }
        },
        {
          "name": "Cert Manager API Readiness Checks/verify webhook pod ready",
          "time": "14.839984ms",
          "status": "ok",
          "assertions": 0,
          "system-out": {
            "Text": "[chkk] [Cert Manager API Readiness Checks/2:verify webhook pod ready] using retry (exponential: true) [plugin default]\n[chkk] [Cert Manager API Readiness Checks/2:verify webhook pod ready] using timeout of 5s [plugin default]\n[chkk] [Cert Manager API Readiness Checks/2:verify webhook pod ready] kube.get: replaced name: $WEBHOOK_POD_NAME -\u003e cert-manager-webhook-65ccc474d9-sjrkv\n[chkk] [Cert Manager API Readiness Checks/2:verify webhook pod ready] kube.get: pods/cert-manager-webhook-65ccc474d9-sjrkv (ns: cert-manager)\n[chkk] [Cert Manager API Readiness Checks/2:verify webhook pod ready] save.vars: WEBHOOK_POD_IP -\u003e 10.244.0.5\n[chkk] [Cert Manager API Readiness Checks/2:verify webhook pod ready] spec/run: attempt 1 after 1.146µs ok: true\n"
          }
        },
        {
          "name": "Cert Manager API Readiness Checks/curl pod from test container",
          "time": "2.984666177s",
          "status": "ok",
          "assertions": 0,
          "system-out": {
            "Text": "[chkk] [Cert Manager API Readiness Checks/3:curl pod from test container] using timeout of 30s\n[chkk] [Cert Manager API Readiness Checks/3:curl pod from test container] exec: replaced arg: http://$WEBHOOK_POD_IP:6080/healthz -\u003e http://10.244.0.5:6080/healthz\n[chkk] [Cert Manager API Readiness Checks/3:curl pod from test container] exec: kubectl [run chkk-cert-manager-api-check --image=curlimages/curl --rm -i --restart=Never --quiet --command -- curl -s http://10.244.0.5:6080/healthz]\n[chkk] [Cert Manager API Readiness Checks/3:curl pod from test container] spec/run: single-shot (no retries) ok: true\n"
          }
        }
      ]
    }
  ]
}

Issue gdt-dev/gdt#69

Adds the ability to return JUnit/XUnit XML or JSON output for run
results.

Here's what XUnit output looks like:

```xml
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
  <testsuite name="api.readiness.yaml" time="3.262611263s" failures="0" errors="0" tests="4" timestamp="2025-12-09T13:21:51.723531002-05:00">
    <properties name="path" value="/tmp/chkk-test3209657959/api.readiness.yaml"></properties>
    <testcases name="Cert Manager API Readiness Checks/cmctl check api" time="48.077997ms" status="ok">
      <system-out><![CDATA[[chkk] [Cert Manager API Readiness Checks/0:cmctl check api] using timeout of 10s [plugin default]
[chkk] [Cert Manager API Readiness Checks/0:cmctl check api] exec: cmctl [check api]
[chkk] [Cert Manager API Readiness Checks/0:cmctl check api] exec: stdout: The cert-manager API is ready
[chkk] [Cert Manager API Readiness Checks/0:cmctl check api] spec/run: single-shot (no retries) ok: true
]]></system-out>
    </testcases>
    <testcases name="Cert Manager API Readiness Checks/get webhook pod name" time="16.125059ms" status="ok">
      <system-out><![CDATA[[chkk] [Cert Manager API Readiness Checks/1:get webhook pod name] using retry (exponential: true) [plugin default]
[chkk] [Cert Manager API Readiness Checks/1:get webhook pod name] using timeout of 5s [plugin default]
[chkk] [Cert Manager API Readiness Checks/1:get webhook pod name] kube.get: pods (labels: app.kubernetes.io/component=webhook) (ns: cert-manager)
[chkk] [Cert Manager API Readiness Checks/1:get webhook pod name] save.vars: WEBHOOK_POD_NAME -> cert-manager-webhook-65ccc474d9-sjrkv
[chkk] [Cert Manager API Readiness Checks/1:get webhook pod name] spec/run: attempt 1 after 1.272µs ok: true
]]></system-out>
    </testcases>
    <testcases name="Cert Manager API Readiness Checks/verify webhook pod ready" time="9.795619ms" status="ok">
      <system-out><![CDATA[[chkk] [Cert Manager API Readiness Checks/2:verify webhook pod ready] using retry (exponential: true) [plugin default]
[chkk] [Cert Manager API Readiness Checks/2:verify webhook pod ready] using timeout of 5s [plugin default]
[chkk] [Cert Manager API Readiness Checks/2:verify webhook pod ready] kube.get: replaced name: $WEBHOOK_POD_NAME -> cert-manager-webhook-65ccc474d9-sjrkv
[chkk] [Cert Manager API Readiness Checks/2:verify webhook pod ready] kube.get: pods/cert-manager-webhook-65ccc474d9-sjrkv (ns: cert-manager)
[chkk] [Cert Manager API Readiness Checks/2:verify webhook pod ready] save.vars: WEBHOOK_POD_IP -> 10.244.0.5
[chkk] [Cert Manager API Readiness Checks/2:verify webhook pod ready] spec/run: attempt 1 after 837ns ok: true
]]></system-out>
    </testcases>
    <testcases name="Cert Manager API Readiness Checks/curl pod from test container" time="3.188612588s" status="ok">
      <system-out><![CDATA[[chkk] [Cert Manager API Readiness Checks/3:curl pod from test container] using timeout of 30s
[chkk] [Cert Manager API Readiness Checks/3:curl pod from test container] exec: replaced arg: http://$WEBHOOK_POD_IP:6080/healthz -> http://10.244.0.5:6080/healthz
[chkk] [Cert Manager API Readiness Checks/3:curl pod from test container] exec: kubectl [run chkk-cert-manager-api-check --image=curlimages/curl --rm -i --restart=Never --quiet --command -- curl -s http://10.244.0.5:6080/healthz]
[chkk] [Cert Manager API Readiness Checks/3:curl pod from test container] spec/run: single-shot (no retries) ok: true
]]></system-out>
    </testcases>
  </testsuite>
</testsuites>
```

And here's JSON output for the same tests:

```json
{
  "testsuites": [
    {
      "name": "api.readiness.yaml",
      "time": "3.073397807s",
      "failures": 0,
      "errors": 0,
      "tests": 4,
      "timestamp": "2025-12-09T13:22:48.881168933-05:00",
      "properties": [
        {
          "name": "path",
          "value": "/tmp/chkk-test672627902/api.readiness.yaml"
        }
      ],
      "testcases": [
        {
          "name": "Cert Manager API Readiness Checks/cmctl check api",
          "time": "64.779856ms",
          "status": "ok",
          "assertions": 0,
          "system-out": {
            "Text": "[chkk] [Cert Manager API Readiness Checks/0:cmctl check api] using timeout of 10s [plugin default]\n[chkk] [Cert Manager API Readiness Checks/0:cmctl check api] exec: cmctl [check api]\n[chkk] [Cert Manager API Readiness Checks/0:cmctl check api] exec: stdout: The cert-manager API is ready\n[chkk] [Cert Manager API Readiness Checks/0:cmctl check api] spec/run: single-shot (no retries) ok: true\n"
          }
        },
        {
          "name": "Cert Manager API Readiness Checks/get webhook pod name",
          "time": "9.11179ms",
          "status": "ok",
          "assertions": 0,
          "system-out": {
            "Text": "[chkk] [Cert Manager API Readiness Checks/1:get webhook pod name] using retry (exponential: true) [plugin default]\n[chkk] [Cert Manager API Readiness Checks/1:get webhook pod name] using timeout of 5s [plugin default]\n[chkk] [Cert Manager API Readiness Checks/1:get webhook pod name] kube.get: pods (labels: app.kubernetes.io/component=webhook) (ns: cert-manager)\n[chkk] [Cert Manager API Readiness Checks/1:get webhook pod name] save.vars: WEBHOOK_POD_NAME -\u003e cert-manager-webhook-65ccc474d9-sjrkv\n[chkk] [Cert Manager API Readiness Checks/1:get webhook pod name] spec/run: attempt 1 after 1.029µs ok: true\n"
          }
        },
        {
          "name": "Cert Manager API Readiness Checks/verify webhook pod ready",
          "time": "14.839984ms",
          "status": "ok",
          "assertions": 0,
          "system-out": {
            "Text": "[chkk] [Cert Manager API Readiness Checks/2:verify webhook pod ready] using retry (exponential: true) [plugin default]\n[chkk] [Cert Manager API Readiness Checks/2:verify webhook pod ready] using timeout of 5s [plugin default]\n[chkk] [Cert Manager API Readiness Checks/2:verify webhook pod ready] kube.get: replaced name: $WEBHOOK_POD_NAME -\u003e cert-manager-webhook-65ccc474d9-sjrkv\n[chkk] [Cert Manager API Readiness Checks/2:verify webhook pod ready] kube.get: pods/cert-manager-webhook-65ccc474d9-sjrkv (ns: cert-manager)\n[chkk] [Cert Manager API Readiness Checks/2:verify webhook pod ready] save.vars: WEBHOOK_POD_IP -\u003e 10.244.0.5\n[chkk] [Cert Manager API Readiness Checks/2:verify webhook pod ready] spec/run: attempt 1 after 1.146µs ok: true\n"
          }
        },
        {
          "name": "Cert Manager API Readiness Checks/curl pod from test container",
          "time": "2.984666177s",
          "status": "ok",
          "assertions": 0,
          "system-out": {
            "Text": "[chkk] [Cert Manager API Readiness Checks/3:curl pod from test container] using timeout of 30s\n[chkk] [Cert Manager API Readiness Checks/3:curl pod from test container] exec: replaced arg: http://$WEBHOOK_POD_IP:6080/healthz -\u003e http://10.244.0.5:6080/healthz\n[chkk] [Cert Manager API Readiness Checks/3:curl pod from test container] exec: kubectl [run chkk-cert-manager-api-check --image=curlimages/curl --rm -i --restart=Never --quiet --command -- curl -s http://10.244.0.5:6080/healthz]\n[chkk] [Cert Manager API Readiness Checks/3:curl pod from test container] spec/run: single-shot (no retries) ok: true\n"
          }
        }
      ]
    }
  ]
}
```

Issue gdt-dev/gdt#69

Signed-off-by: Jay Pipes <[email protected]>
@jaypipes jaypipes merged commit d0f1d21 into gdt-dev:main Dec 9, 2025
11 checks passed
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.

1 participant