enable support for JUnit/XUnit and JSON output#71
Merged
jaypipes merged 1 commit intogdt-dev:mainfrom Dec 10, 2025
Merged
Conversation
Adds a `-o|--output` CLI option to the `gdt` CLI tool that triggers
output in either JUnit/XUnit:
```xml
$ gdt run --debug ../../chkk-io/readiness-checks/guided/addons/cert-manager/api.readiness-after14.yaml -oxunit
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuite name="api.readiness-after14.yaml" time="2.885919111s" failures="0" errors="0" tests="6" timestamp="2025-12-09T14:39:15.621382231-05:00">
<properties name="path" value="../../chkk-io/readiness-checks/guided/addons/cert-manager/api.readiness-after14.yaml"></properties>
<testcases name="Cert Manager API Readiness Checks/ensure certificaterequest CRD installed" time="12.454946ms" status="ok">
<system-out><![CDATA[[gdt] [Cert Manager API Readiness Checks/0:ensure certificaterequest CRD installed] using retry (exponential: true) [plugin default]
[gdt] [Cert Manager API Readiness Checks/0:ensure certificaterequest CRD installed] using timeout of 5s [plugin default]
[gdt] [Cert Manager API Readiness Checks/0:ensure certificaterequest CRD installed] kube.get: customresourcedefinitions/certificaterequests.cert-manager.io (non-namespaced resource)
[gdt] [Cert Manager API Readiness Checks/0:ensure certificaterequest CRD installed] spec/run: attempt 1 after 952ns ok: true
]]></system-out>
</testcases>
<testcases name="Cert Manager API Readiness Checks/ensure issuers CRD installed" time="9.552465ms" status="ok">
<system-out><![CDATA[[gdt] [Cert Manager API Readiness Checks/1:ensure issuers CRD installed] using retry (exponential: true) [plugin default]
[gdt] [Cert Manager API Readiness Checks/1:ensure issuers CRD installed] using timeout of 5s [plugin default]
[gdt] [Cert Manager API Readiness Checks/1:ensure issuers CRD installed] kube.get: customresourcedefinitions/issuers.cert-manager.io (non-namespaced resource)
[gdt] [Cert Manager API Readiness Checks/1:ensure issuers CRD installed] spec/run: attempt 1 after 1.178µs ok: true
]]></system-out>
</testcases>
<testcases name="Cert Manager API Readiness Checks/cmctl check api" time="42.481764ms" status="ok">
<system-out><![CDATA[[gdt] [Cert Manager API Readiness Checks/2:cmctl check api] using timeout of 10s [plugin default]
[gdt] [Cert Manager API Readiness Checks/2:cmctl check api] exec: cmctl [check api]
[gdt] [Cert Manager API Readiness Checks/2:cmctl check api] exec: stdout: The cert-manager API is ready
[gdt] [Cert Manager API Readiness Checks/2: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="6.448293ms" status="ok">
<system-out><![CDATA[[gdt] [Cert Manager API Readiness Checks/3:get webhook pod name] using retry (exponential: true) [plugin default]
[gdt] [Cert Manager API Readiness Checks/3:get webhook pod name] using timeout of 5s [plugin default]
[gdt] [Cert Manager API Readiness Checks/3:get webhook pod name] kube.get: pods (labels: app.kubernetes.io/component=webhook) (ns: cert-manager)
[gdt] [Cert Manager API Readiness Checks/3:get webhook pod name] save.vars: WEBHOOK_POD_NAME -> cert-manager-webhook-65ccc474d9-sjrkv
[gdt] [Cert Manager API Readiness Checks/3:get webhook pod name] spec/run: attempt 1 after 509ns ok: true
]]></system-out>
</testcases>
<testcases name="Cert Manager API Readiness Checks/verify webhook pod ready" time="7.535129ms" status="ok">
<system-out><![CDATA[[gdt] [Cert Manager API Readiness Checks/4:verify webhook pod ready] using retry (exponential: true) [plugin default]
[gdt] [Cert Manager API Readiness Checks/4:verify webhook pod ready] using timeout of 5s [plugin default]
[gdt] [Cert Manager API Readiness Checks/4:verify webhook pod ready] kube.get: replaced name: $WEBHOOK_POD_NAME -> cert-manager-webhook-65ccc474d9-sjrkv
[gdt] [Cert Manager API Readiness Checks/4:verify webhook pod ready] kube.get: pods/cert-manager-webhook-65ccc474d9-sjrkv (ns: cert-manager)
[gdt] [Cert Manager API Readiness Checks/4:verify webhook pod ready] save.vars: WEBHOOK_POD_IP -> 10.244.0.5
[gdt] [Cert Manager API Readiness Checks/4:verify webhook pod ready] spec/run: attempt 1 after 798ns ok: true
]]></system-out>
</testcases>
<testcases name="Cert Manager API Readiness Checks/curl pod from test container" time="2.807446514s" status="ok">
<system-out><![CDATA[[gdt] [Cert Manager API Readiness Checks/5:curl pod from test container] using timeout of 300s
[gdt] [Cert Manager API Readiness Checks/5:curl pod from test container] exec: replaced arg: http://$WEBHOOK_POD_IP:6080/healthz -> http://10.244.0.5:6080/healthz
[gdt] [Cert Manager API Readiness Checks/5: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]
[gdt] [Cert Manager API Readiness Checks/5:curl pod from test container] spec/run: single-shot (no retries) ok: true
]]></system-out>
</testcases>
</testsuite>
</testsuites>
```
or JSON output format:
```json
$ gdt run ../../chkk-io/readiness-checks/guided/addons/cert-manager/api.readiness-after14.yaml -ojson
{
"testsuites": [
{
"name": "api.readiness-after14.yaml",
"time": "2.635655869s",
"failures": 0,
"errors": 0,
"tests": 6,
"timestamp": "2025-12-09T14:39:36.708906197-05:00",
"properties": [
{
"name": "path",
"value": "../../chkk-io/readiness-checks/guided/addons/cert-manager/api.readiness-after14.yaml"
}
],
"testcases": [
{
"name": "Cert Manager API Readiness Checks/ensure certificaterequest CRD installed",
"time": "24.768068ms",
"status": "ok",
"assertions": 0,
"system-out": {
"Text": "[gdt] [Cert Manager API Readiness Checks/0:ensure certificaterequest CRD installed] using retry (exponential: true) [plugin default]\n[gdt] [Cert Manager API Readiness Checks/0:ensure certificaterequest CRD installed] using timeout of 5s [plugin default]\n[gdt] [Cert Manager API Readiness Checks/0:ensure certificaterequest CRD installed] kube.get: customresourcedefinitions/certificaterequests.cert-manager.io (non-namespaced resource)\n[gdt] [Cert Manager API Readiness Checks/0:ensure certificaterequest CRD installed] spec/run: attempt 1 after 831ns ok: true\n"
}
},
{
"name": "Cert Manager API Readiness Checks/ensure issuers CRD installed",
"time": "35.025181ms",
"status": "ok",
"assertions": 0,
"system-out": {
"Text": "[gdt] [Cert Manager API Readiness Checks/1:ensure issuers CRD installed] using retry (exponential: true) [plugin default]\n[gdt] [Cert Manager API Readiness Checks/1:ensure issuers CRD installed] using timeout of 5s [plugin default]\n[gdt] [Cert Manager API Readiness Checks/1:ensure issuers CRD installed] kube.get: customresourcedefinitions/issuers.cert-manager.io (non-namespaced resource)\n[gdt] [Cert Manager API Readiness Checks/1:ensure issuers CRD installed] spec/run: attempt 1 after 1.202µs ok: true\n"
}
},
{
"name": "Cert Manager API Readiness Checks/cmctl check api",
"time": "45.083687ms",
"status": "ok",
"assertions": 0,
"system-out": {
"Text": "[gdt] [Cert Manager API Readiness Checks/2:cmctl check api] using timeout of 10s [plugin default]\n[gdt] [Cert Manager API Readiness Checks/2:cmctl check api] exec: cmctl [check api]\n[gdt] [Cert Manager API Readiness Checks/2:cmctl check api] exec: stdout: The cert-manager API is ready\n[gdt] [Cert Manager API Readiness Checks/2:cmctl check api] spec/run: single-shot (no retries) ok: true\n"
}
},
{
"name": "Cert Manager API Readiness Checks/get webhook pod name",
"time": "7.492367ms",
"status": "ok",
"assertions": 0,
"system-out": {
"Text": "[gdt] [Cert Manager API Readiness Checks/3:get webhook pod name] using retry (exponential: true) [plugin default]\n[gdt] [Cert Manager API Readiness Checks/3:get webhook pod name] using timeout of 5s [plugin default]\n[gdt] [Cert Manager API Readiness Checks/3:get webhook pod name] kube.get: pods (labels: app.kubernetes.io/component=webhook) (ns: cert-manager)\n[gdt] [Cert Manager API Readiness Checks/3:get webhook pod name] save.vars: WEBHOOK_POD_NAME -\u003e cert-manager-webhook-65ccc474d9-sjrkv\n[gdt] [Cert Manager API Readiness Checks/3:get webhook pod name] spec/run: attempt 1 after 685ns ok: true\n"
}
},
{
"name": "Cert Manager API Readiness Checks/verify webhook pod ready",
"time": "10.682972ms",
"status": "ok",
"assertions": 0,
"system-out": {
"Text": "[gdt] [Cert Manager API Readiness Checks/4:verify webhook pod ready] using retry (exponential: true) [plugin default]\n[gdt] [Cert Manager API Readiness Checks/4:verify webhook pod ready] using timeout of 5s [plugin default]\n[gdt] [Cert Manager API Readiness Checks/4:verify webhook pod ready] kube.get: replaced name: $WEBHOOK_POD_NAME -\u003e cert-manager-webhook-65ccc474d9-sjrkv\n[gdt] [Cert Manager API Readiness Checks/4:verify webhook pod ready] kube.get: pods/cert-manager-webhook-65ccc474d9-sjrkv (ns: cert-manager)\n[gdt] [Cert Manager API Readiness Checks/4:verify webhook pod ready] save.vars: WEBHOOK_POD_IP -\u003e 10.244.0.5\n[gdt] [Cert Manager API Readiness Checks/4:verify webhook pod ready] spec/run: attempt 1 after 522ns ok: true\n"
}
},
{
"name": "Cert Manager API Readiness Checks/curl pod from test container",
"time": "2.512603594s",
"status": "ok",
"assertions": 0,
"system-out": {
"Text": "[gdt] [Cert Manager API Readiness Checks/5:curl pod from test container] using timeout of 300s\n[gdt] [Cert Manager API Readiness Checks/5:curl pod from test container] exec: replaced arg: http://$WEBHOOK_POD_IP:6080/healthz -\u003e http://10.244.0.5:6080/healthz\n[gdt] [Cert Manager API Readiness Checks/5: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[gdt] [Cert Manager API Readiness Checks/5:curl pod from test container] spec/run: single-shot (no retries) ok: true\n"
}
}
]
}
]
}
```
Issue gdt-dev#69
Signed-off-by: Jay Pipes <jaypipes@gmail.com>
a-hilaly
approved these changes
Dec 9, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a
-o|--outputCLI option to thegdtCLI tool that triggers output in either JUnit/XUnit:or JSON output format:
Issue #69