Playwright
The JUnit check type runs a new kubernetes pod with the specified image, in this example we are running a playwright test suite
apiVersion: canaries.flanksource.com/v1
kind: Canary
metadata:
  name: playwright-junit
spec:
  interval: 120
  severity: high
  junit:
    - testResults: "/tmp/"
      name: playwright-junit
      display:
        template: |
          ✅ {{.results.passed}} ❌ {{.results.failed}} in 🕑 {{.results.duration}}
          {{  range $r := .results.suites}}
          {{- if gt (conv.ToInt $r.failed)  0 }}
            {{$r.name}} ✅ {{$r.passed}} ❌ {{$r.failed}} in 🕑 {{$r.duration}}
          {{- end }}
          {{- end }}
      spec:
        containers:
          - name: playwright
            image: ghcr.io/flanksource/canary-playwright:latest
            command: ["/start.sh"]
By configuring playwright to export JUnit to the testResults folder, canary-checker picks up the results and make then available display formatting and health evaluation.
start.shmkdir -p /tmp/junit-results
PLAYWRIGHT_JUNIT_OUTPUT_NAME=/tmp/junit-results/results.xml npx playwright test --project=chromium --reporter=junit
touch /tmp/junit-results/done
For a complete working example, see canary-checker-examples/playwright
| Field | Description | Scheme | 
|---|---|---|
name* | Name of the check, must be unique within the canary  | string  | 
spec* | Pod specification  | |
testResults* | Path to JUnit test results  | string  | 
artifacts | Specify what files/folders created in the pod need to be archived  | |
timeout | Timeout in minutes to wait for specified container to finish its job. Defaults to   | int  | 
description | Description for the check  | string  | 
display | Expression to change the formatting of the display  | |
icon | Icon for overwriting default icon on the dashboard  | |
labels | Labels for check  | map[string]string  | 
metrics | Metrics to export from  | |
test | Evaluate whether a check is healthy  | |
transform | Transform data from a check into multiple individual checks  | 
Test Result Variables
See JUnit Test Results for the schema that is ingested and can be used for evaluating health or formatting the display.