Next: , Previous: , Up: API  


1.14 (veritas reporter)

1.14.1 Macros

Macro: log x

Print msg on a line of its own.

(log "Hello World")
;; Outputs: \nHello World
Macro: log-assert x

Announce an assertion that is about to be checked, by name.

Macro: log-benchmark x

Report benchmark results, given a benchmark-result record.

Macro: log-debug x

Log a message for debugging.

Macro: log-error x

Report a runtime error.

Macro: log-fail x

Report a failing check.

Macro: log-flaky x

Report a test that passed only after a retry.

Macro: log-info x

Log an informational message.

Macro: log-pass x

Report a passing check.

Macro: log-suite x

Announce a suite by name.

Macro: log-test x

Announce a test by name.

1.14.2 Parameters

Parameter: veritas-clock

Default value:

#<procedure 7f3d7fab8190 at veritas/reporter.scm:331:18 ()>
Parameter: veritas-current-location

Default value:

#f

1.14.3 Procedures

Procedure: append-github-summary-row counts KEY: #:name #:summary-path

Append one row of counts to the GitHub Actions step summary.

The table header is written the first time, and every test file of the run adds a row, so the summary shows a file beside its numbers and still says something when the run is failing. Returns summary-path, or #f when there is no summary to append to.

Procedure: dispatch-log vc log-type msg

Send msg to the reporter chosen in vc.

The client names one under the key 'reporter; anything else falls back to emoji-reporter. log-type picks the entry to call ('log-pass, 'log-fail, and so on).

Procedure: ensure-parent-directories path

Create every directory in front of path, ignoring ones that exist.

Procedure: github-actions?

Return #t when the run is inside a GitHub Actions workflow.

Procedure: junit-report-data all-results KEY: #:seconds

Return the JUnit report of all-results as data rather than a file.

The result is an alist holding the numbers a testsuites element needs - tests, failures, errors and skipped - and xml, the testsuite elements themselves as a string. Writing the file is write-junit-document’s job; a separate process can be handed this alist and its run joined to others with merge-junit-data, which is how one document is made out of the parallel runs of --jobs.

Procedure: merge-junit-data datas

Combine the JUnit data of several runs into one.

The counts are summed and the testsuite elements are concatenated in the order given, so the merged document keeps the order the runs were scheduled in.

Procedure: now

Undocumented procedure.

Procedure: read-junit-data path

Return the JUnit data recorded at path, or #f.

#f means there is nothing to merge: the file is missing, unreadable or not the alist write-junit-data writes.

Procedure: write-github-annotations all-results KEY: #:limit

Print workflow-command annotations for the failures in all-results.

GitHub keeps ten error annotations per step, so only the first limit are written and a notice says how many were left out; the JUnit document carries every one of them. Returns how many annotations were written.

Procedure: write-junit-data data KEY: #:path

Write JUnit data to path so another process can read it back.

An alist is plain Scheme data, so read restores it exactly: this is how a worker process hands its report to the process that merges them. Returns path.

Procedure: write-junit-document data KEY: #:seconds #:path

Write JUnit data, as made by junit-report-data, to path.

seconds is the wall clock of the run and becomes the document’s total time; for a run split over worker processes it is the wall clock of the whole parallel run, not the sum of the workers. Returns path.

Every testcase carries the file it came from, the suite path it sat in and its own duration; each testsuite sums the durations of its cases.

Procedure: write-junit-report all-results KEY: #:seconds #:path

Write all-results to path as one JUnit XML document.

seconds is the wall clock of the run and becomes the document’s total time. Every test becomes a testcase inside a testsuite named after the suites it sits in; loose tests land in a suite called veritas. A benchmark is reported as skipped, because it measures instead of asserting, and a task that raised is reported as an error rather than a failure. Returns path.

Every testcase carries the file it came from, the suite path it sat in and its own duration; each testsuite sums the durations of its cases.

1.14.4 Variables

Variable: ansi-color-escapes
((yellow . "\x1b[0;33m") (magenta . "\x1b[0;35m") (green . "\x1b[0;32m") (default . "\x1b[0;39m") (bold . "\x1b[1m") (red . "\x1b[0;31m") (blue . "\x1b[0;34m") (cyan . "\x1b[0;36m") (reset . "\x1b[0m"))
Variable: emoji-reporter
((reporter-name . emoji-reporter) (log-flaky . #<procedure 7f3d7fab8000 at veritas/reporter.scm:145:13 (msg)>) (log-pass . #<procedure 7f3d7fab8010 at veritas/reporter.scm:149:47 (msg)>) (log-fail . #<procedure 7f3d7fab8020 at veritas/reporter.scm:159:14 (msg)>) (log-debug . #<procedure 7f3d7fab8030 at veritas/reporter.scm:166:15 (msg)>) (log-info . #<procedure 7f3d7fab8040 at veritas/reporter.scm:173:14 (msg)>) (log-error . #<procedure 7f3d7fab8050 at veritas/reporter.scm:180:15 (msg)>) (log-test . #<procedure 7f3d7fab8060 at veritas/reporter.scm:187:14 (msg)>) (log-benchmark . #<procedure 7f3d7fab8070 at veritas/reporter.scm:200:19 (msg)>) (log-suite . #<procedure 7f3d7fab8080 at veritas/reporter.scm:234:15 (msg)>) (log-assert . #<procedure 7f3d7fab8090 at veritas/reporter.scm:248:16 (msg)>))
Variable: github-reporter
((reporter-name . github-reporter) (log-flaky . #<procedure junit-quiet (msg)>) (log-pass . #<procedure junit-quiet (msg)>) (log-assert . #<procedure junit-quiet (msg)>) (log-test . #<procedure junit-quiet (msg)>) (log-suite . #<procedure junit-quiet (msg)>) (log-debug . #<procedure junit-quiet (msg)>) (log-benchmark . #<procedure junit-quiet (msg)>) (log-fail . #<procedure 7f3d7fab8620 at veritas/reporter.scm:955:14 (msg)>) (log-error . #<procedure 7f3d7fab8630 at veritas/reporter.scm:958:15 (msg)>) (log-info . #<procedure 7f3d7fab8640 at veritas/reporter.scm:961:14 (msg)>))
Variable: json-reporter
((reporter-name . json-reporter) (log-flaky . #<procedure 7f3d7f6da9c0 at veritas/reporter.scm:343:14 (msg)>) (log-pass . #<procedure 7f3d7f6da9a0 at veritas/reporter.scm:347:46 (msg)>) (log-fail . #<procedure 7f3d7f6da980 at veritas/reporter.scm:356:14 (msg)>) (log-error . #<procedure 7f3d7f6da960 at veritas/reporter.scm:362:15 (msg)>) (log-test . #<procedure 7f3d7f6da940 at veritas/reporter.scm:368:14 (msg)>) (log-benchmark . #<procedure 7f3d7f6da920 at veritas/reporter.scm:374:19 (msg)>) (log-debug . #<procedure 7f3d7f6da900 at veritas/reporter.scm:401:15 (msg)>) (log-info . #<procedure 7f3d7f6da8e0 at veritas/reporter.scm:407:14 (msg)>) (log-suite . #<procedure 7f3d7f6da8c0 at veritas/reporter.scm:413:15 (msg)>) (log-assert . #<procedure 7f3d7f6da8a0 at veritas/reporter.scm:419:16 (msg)>))
Variable: junit-reporter
((reporter-name . junit-reporter) (log-flaky . #<procedure junit-quiet (msg)>) (log-pass . #<procedure junit-quiet (msg)>) (log-assert . #<procedure junit-quiet (msg)>) (log-test . #<procedure junit-quiet (msg)>) (log-suite . #<procedure junit-quiet (msg)>) (log-debug . #<procedure junit-quiet (msg)>) (log-benchmark . #<procedure junit-quiet (msg)>) (log-fail . #<procedure 7f3d7fab8518 at veritas/reporter.scm:828:14 (msg)>) (log-error . #<procedure 7f3d7fab8528 at veritas/reporter.scm:831:15 (msg)>) (log-info . #<procedure 7f3d7fab8538 at veritas/reporter.scm:834:14 (msg)>))
Variable: monotone-reporter
((reporter-name . monotone-reporter) (log-flaky . #<procedure 7f3d7fab80d8 at veritas/reporter.scm:263:14 (msg)>) (log-pass . #<procedure 7f3d7fab80e8 at veritas/reporter.scm:265:50 (msg)>) (log-fail . #<procedure 7f3d7fab80f8 at veritas/reporter.scm:269:14 (msg)>) (log-error . #<procedure 7f3d7fab8108 at veritas/reporter.scm:274:15 (msg)>) (log-test . #<procedure 7f3d7fab8118 at veritas/reporter.scm:279:14 (msg)>) (log-benchmark . #<procedure 7f3d7fab8128 at veritas/reporter.scm:284:19 (msg)>) (log-debug . #<procedure 7f3d7fab8138 at veritas/reporter.scm:304:15 (msg)>) (log-info . #<procedure 7f3d7fab8148 at veritas/reporter.scm:309:14 (msg)>) (log-suite . #<procedure 7f3d7fab8158 at veritas/reporter.scm:314:15 (msg)>) (log-assert . #<procedure 7f3d7fab8168 at veritas/reporter.scm:320:16 (msg)>))

Next: (veritas runner), Previous: (veritas property), Up: API