-
Notifications
You must be signed in to change notification settings - Fork 1
add XUnit and JSON output for run results #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
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]>
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 the ability to return JUnit/XUnit XML or JSON output for run results.
Here's what XUnit output looks like:
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