Getting promptfoo JUnit XML and HTML reports into the CI tools reviewers already use
A platform team running promptfoo evals in CI often finds that the failures sit in a raw log that nobody reads, so the results never reach the people who must act on them. promptfoo eval can write several output formats in a single run. The documented pattern is promptfoo eval -o results.json -o report.html -o results.junit.xml, which produces a machine-readable JSON file, a human-readable HTML report and a JUnit XML file from the same evaluation. Because all three come from one run, reviewers and scripts see the same pass and fail results, and no one has to re-run paid model calls to produce a second view.
Each format has a different reader. JUnit XML is the format most CI systems understand natively, so it can populate the test tab that reviewers already open on a merge request or build, with each test case showing as passed or failed. HTML is for people who need to read the prompt, the model output and the grader's reasoning side by side, which is usually what a reviewer needs when a case fails. JSON is for scripts, dashboards and downstream checks, such as a step that reads the pass rate and applies a threshold. Decide which reader each file serves before wiring the pipeline, and confirm with your CI vendor how it displays JUnit files, since rendering and retention limits differ between systems.
Before you publish these files, confirm where they will be stored and who can open them. The HTML and JSON outputs can contain the test prompts, model responses, retrieved documents and, for red team runs, attack payloads that may include sensitive content. Check your CI artifact retention settings and access rules, and restrict artifacts to the teams that are cleared to see that data. Also confirm the exact output flags and file handling for your installed promptfoo version in the promptfoo CI/CD integration guide before you copy the example into production pipelines.
Which output format fits which reviewer
JUnit XML is the format that CI systems understand natively. Most pipeline tools can parse a JUnit file and show each eval case as a passed or failed test, with failure messages attached, inside the test or merge request view that developers already use. This is the right output when the question is whether a change broke a case.
- Native parsing: Most CI systems ingest JUnit XML without custom code, so the results appear in test summaries and failure lists.
- Per-case status: Each test case maps to one eval case, so a reviewer sees which prompts or inputs failed without opening another file.
- Merge request context: Failed cases can appear next to the change that caused them, which shortens the review loop.
- Limited detail: The format carries pass or fail status and short messages, so long model outputs and grader reasoning do not fit well.
- Trend views: Test history features work with the case names, so keep names stable between runs.
Before relying on this view, confirm with your CI vendor how it displays long failure messages and whether it keeps history across pipelines.
The HTML report is written for people who read results by hand. It shows prompts, outputs, assertions and grading results in one page that a reviewer can scroll, filter and share. Use it when a failure needs judgment, such as whether a model answer is acceptable in context, rather than a simple pass or fail.
- Full context: Reviewers see the input, the model output and each assertion result together, which is hard to reconstruct from a test tab.
- Shareable artifact: The file can be attached to a pipeline as a downloadable artifact and opened by people without access to the CLI.
- Side-by-side comparison: Reports from different prompt or model variants make differences visible during review.
- Size: Large suites produce large files, so check artifact storage limits and retention settings in your CI system.
- Sensitive content: The report contains prompts, model outputs and possibly customer data from test cases, so restrict who can download it.
Before publishing, confirm the report's contents against your data handling policy, and ask your CI administrator who can open archived artifacts.
JSON output is the machine-readable form of the run. Scripts can read it to compute pass rates, post comments, send summaries to chat tools, or feed results into a data store for trend analysis. It is the format to choose when a downstream process needs to make a decision or store structured history.
- Structured fields: Scripts can read pass counts, case results and assertion details without parsing text.
- Custom gates: A pipeline step can apply its own threshold logic, such as failing only on specific categories.
- Downstream tooling: Dashboards and data warehouses can ingest the file directly.
- No built-in display: Most CI systems do not render JSON as a readable report, so a script or artifact link is needed for people to see it.
- Schema changes: Field names can change between tool versions, so pin the version in your pipeline and test parsers after upgrades.
Before building on the file, check the field names against the version you run and confirm how long your team will keep archived copies.
A single evaluation run can write all three formats at once, so the choice is not exclusive. The eval command accepts several output flags in one run, for example writing a JSON file, an HTML report and a JUnit XML file from the same results. This avoids running paid model calls three times for three audiences.
- One execution: The model calls happen once, and each output is generated from the same results.
- Consistent numbers: Test tabs, the HTML report and scripts agree because they share one source.
- Clear artifact list: Name each file by its audience so reviewers know which one to open.
- Storage cost: Keeping three copies of each run multiplies artifact storage, so set retention for each file type.
- Failure handling: Confirm that the pipeline still publishes the reports when the eval step exits with a failure code.
Before finalizing the pipeline, run it once with all three outputs and confirm each file appears where the reviewer expects it.
How one promptfoo eval run writes several reports
A single promptfoo eval invocation accepts several -o outputs, so the pass and fail results are computed once and then written in each format you request. In practice that means one command such as promptfoo eval -c promptfooconfig.yaml -o results.json -o report.html -o results.junit.xml produces a JSON file for scripts, an HTML file for human review and a JUnit XML file for the test tab in your CI system, all from the same run. Because every file comes from one set of model calls, the HTML report and the JUnit results will never disagree about which test failed. Confirm the exact flag syntax, supported output extensions and file naming against the version you install, since the CI/CD guide is the reference for the example shown here.
Writing every format on every run is the simplest choice and keeps artifacts consistent for reviewers who open whichever file is handy. The cost is storage and a small amount of extra write time, and the HTML file can grow large on suites with many test cases and long model responses. The alternative is to request only the outputs a given job consumes, for example JUnit XML alone in a merge request job and HTML only in a nightly job. That keeps artifacts lean but means each job's output must be regenerated if a reviewer later asks for a different view. A reasonable default is to write JSON and JUnit XML on every pipeline run and add HTML where a person reviews results, then measure artifact size on your largest suite before you decide.
Treat the file set as data you are storing, not just display output. The JSON and HTML files typically contain the prompts, model responses, grader reasoning and any variables that were injected into test cases, so anything sensitive in your test data ends up in CI artifacts. Ask who can download artifacts from your CI system, how long they are retained and whether they are visible on public or forked pipelines. Your data handling review should cover these files alongside the provider keys, which should never be written into the reports.
How eval results flow from the runner to reviewers
The flow starts with the CI job, which runs promptfoo eval once with several -o flags so one run writes results.json, report.html and results.junit.xml. The JUnit file feeds the CI test tab, the HTML file is archived as a build artifact for human review, and the JSON file is read by scripts that apply gates. The trust boundary sits where the files leave the runner for shared CI storage, so check what each file contains, including prompts, responses and any sensitive data your test cases carry, before you grant wider access.
One eval run writes three files that reach different reviewers and scripts.
Output options and when each one fits
This table compares the three main promptfoo output formats by who reads them, which CI feature they feed and what they cost in readability or size. Pass one -o flag per file when a run needs more than one format, since promptfoo eval accepts several outputs in a single run.
| Output | Main consumer | Typical CI feature | Main trade-off |
|---|---|---|---|
JUnit XML (results.junit.xml) | CI test reporting tools | Test tabs and pass or fail counts on a build or merge request | Pass or fail per test case only, so scores, judge reasoning and model outputs are not shown in a readable form |
HTML (report.html) | Reviewers who read results by hand | Downloadable or archived artifact opened in a browser | Easy to scan for prompt changes, but not parsed by CI tools, and it can carry full model responses |
JSON (results.json) | Scripts and downstream tooling | Custom gates, dashboards and comparisons between runs | Most complete record, but large and needs a script to read, so it is not a review format |
| Several outputs in one run | Both a CI tab and a human reviewer | JUnit for the tab, HTML as an artifact, JSON for a gate script | Each file is written from the same run, so keep them as build artifacts with the same retention |
| Single output only | One consumer | Whichever tool the team already opens | Simplest pipeline, but a later question about the same run may require a rerun |
| Results containing prompts and responses | Anyone who opens the file | Artifact access controls in the CI system | Confirm who can download artifacts before publishing outputs from runs that use production-like data |
Setting up report output in a CI job
This sequence takes a CI job from a bare promptfoo eval to one that writes JUnit XML, HTML and JSON reports, publishes the JUnit file to the CI test tab and keeps the other reports as downloadable artifacts. Each step ends with a check so you know the reporting path works before reviewers depend on it.
Pin the Node.js version in the job
Choose a CI image or runtime that provides Node.js 22.22.0 or newer, because the promptfoo 0.124.1 release on npm requires that version or later. Pin the version in the job definition rather than accepting whatever the runner image ships, so the build behaves the same on every run. Check the result by printing the Node.js and npm versions in the first job step and confirming both appear in the log before any promptfoo command runs.
Install a pinned promptfoo version
Install promptfoo as a fixed npm version in the job, so the report format and CLI flags do not change between pipeline runs without a review. Confirm the version you install against the promptfoo releases page on GitHub before you commit it. Check the result by running the promptfoo version command in the job and comparing the output with the version in your lockfile or job file.
Add one -o flag per report format
Edit the eval command so it writes each format you need, for example a JSON file for scripts, an HTML file for human review and a JUnit XML file for the CI test tab. promptfoo eval accepts several -o outputs in one run, so a single command can produce all three files. Store the output files in a known directory such as an artifacts folder so later steps can find them. Check the result by listing that directory after the eval finishes and confirming all three files exist and are not empty.
Publish the JUnit file to the test tab
Configure the CI system's native test report feature to read the JUnit XML file from the artifacts directory. Each CI system uses its own keyword or setting for this, so confirm the exact syntax in your CI vendor's documentation. Make sure the publish step runs even when the eval step fails, otherwise the failing cases will not appear in the test tab. Check the result by opening the job's test view after a run and confirming the individual promptfoo test cases are listed.
Archive the HTML and JSON reports
Add an artifact rule that keeps the HTML report for human review and the JSON file for scripts or later comparison. Set the artifact step to run on failure as well as success, so reviewers can open the report for a failed run. Consider how long the artifacts are retained, since the HTML and JSON files can contain prompts, model outputs and test data, and confirm the retention setting with your security team. Check the result by downloading the artifacts from a completed job and opening the HTML file in a browser.
Verify with a deliberately failing test
Add a test case with an assertion you know will fail, run the pipeline and confirm the job is marked failed, the failing case appears in the CI test tab and the HTML report shows the same failure. This proves the reports reflect real results and that the publish and archive steps run on failure. Remove the deliberate failure once the check passes and rerun the job to confirm a passing run produces the same set of files. Check the result by comparing the failing case in the test tab with the HTML report entry.
What the report files can contain
Every output format carries some of what the run saw and produced. Before a JUnit XML, HTML or JSON file lands in a CI artifact store or test tab, decide who can open it, how long it lives, and which fields it holds.
Prompts and model outputs
Eval reports usually record the rendered prompt and the model's response for each test case, so a failing row can be understood without rerunning it. In CI, those responses can contain text generated from confidential context or system instructions. Check whether your installed version writes full prompts and outputs into each format, and whether the HTML view shows them by default. Restrict who can download pipeline artifacts to match the sensitivity of the prompts.
Customer and regulated test inputs
Test cases are often built from real support tickets, claims, patient notes or account records. Those values are copied into each result row as the input, so a report can carry personal or regulated data even though the pipeline never meant to store it. Replace or mask identifiers in test datasets before they enter CI, and confirm that your retention settings for artifacts meet the rules that govern the source data.
Provider and grader details
Result files can name the provider, model version and grader used for each assertion, along with token counts and cost estimates. These details show which vendor received your data, which is a question your privacy and procurement teams will ask. Confirm which provider and grader fields appear in each output format, and make sure none of them includes an API key, endpoint with embedded credentials or account identifier.
Red team attack payloads
Red team runs generate adversarial prompts that can include jailbreak text, injected instructions and harmful examples. A JUnit or HTML report that lists each failed attack gives a reader a ready-made playbook for the application under test. Treat red team reports as security-sensitive, limit who can view them, and decide whether attack payloads belong in a shared test tab or only in restricted storage.
Internal system names in metadata
Config metadata, test descriptions, variable values and error messages can reveal internal hostnames, project codenames, database names or tool names. These strings often end up in a public-facing test tab or a shared dashboard. Review the config for values that were written for the team, and confirm in your own environment which metadata keys each output includes before you publish reports beyond the security team.
Questions teams ask before publishing promptfoo reports
Can our team set up promptfoo JUnit and HTML reports without outside help?
Yes, if an engineer who knows your CI system and has access to the repository can run promptfoo locally first. The work is mostly configuration: adding several output flags to the eval command, making the report files available as build artifacts, and connecting the JUnit file to your CI test tab. The harder parts are usually the ones around the job, including secret handling for provider keys, Node.js version alignment and deciding who may see the stored outputs. Teams without a CI engineer or a reviewer who owns data policy often find those decisions take longer than the file generation itself.
How long does a basic promptfoo reporting setup take?
The duration depends on the CI system, how many pipelines already run tests, and how large the suite is. A single eval job with one JUnit file and one HTML file is a small change, while a suite that runs across several models, prompt variants or red team scans needs more review of output sizes and retention. Ask any partner or internal team to break the estimate into three parts: the pipeline change, the review of what the files contain, and the first run against your real suite. No duration is set here, so confirm it against your own pipeline and test data before committing a date.
What drives the cost of publishing promptfoo results in CI?
There are three main components. Runner time is the compute your CI system charges for while the eval runs, and it grows with suite size and concurrency. Artifact storage covers the JUnit, HTML and JSON files you keep, and it recurs for as long as your retention policy holds them. Model API spend is usually the largest item: every test case that calls a model or a grader model is billed by that provider, and generating the reports does not reduce it. Ask for each component to be estimated separately, and check whether the team already pays for the same runner and storage capacity.
Do the JUnit, HTML and JSON files contain sensitive data?
They can. Promptfoo results usually include the prompts, the test inputs, the model outputs and the grader's reasoning, and red team outputs can include attack payloads and responses that touch sensitive content. Treat each output file as a copy of the evaluation data, not as a summary. Before publishing, decide which fields may appear in artifacts that many people can open, how long files are kept, and who can download them. Confirm the exact contents of each output format against the version you run, since the fields can change between releases.
What do we need to provide before the work starts?
Three things are needed. First, access to the CI system and the repository, with permission to edit pipeline definitions and to manage secret variables. Second, a sample promptfoo configuration and a representative suite, so the reports can be checked against real results rather than a demo. Third, a named reviewer who can approve what the reports may contain and who may open them, since the data policy decision cannot be left to the pipeline author. If the setup is part of a fixed-scope engagement, these inputs should be listed in the written scope so both sides know when the work can start.
Which output format should we use for each audience?
Use JUnit XML for the test tab that engineers already open on a merge request or build, because that tab shows pass and fail status per test case. Use HTML for a reviewer who needs to read prompts and outputs side by side, and keep it out of wide-access locations if it holds sensitive data. Use JSON when a script needs to compute pass rates or post a summary. Promptfoo accepts several -o outputs in one run, so one eval can produce all three files. Confirm how your CI system displays JUnit files before relying on the test tab.
When is it worth bringing in a partner for promptfoo reporting?
A partner is worth considering when the reports must meet an internal review, when several pipelines on different CI systems need the same outputs, or when the team lacks time to handle data policy and retention. DeployOpen implements and hardens self-hosted open-source platforms in infrastructure you control, and it can plan a promptfoo reporting setup as part of a fixed-scope engagement with written deliverables. If you run promptfoo as a shared server, the self-hosted app has single-instance limits and no built-in authentication or SSO, so that architecture should be scoped separately. Ask for a written scope and quote before work starts.
How DeployOpen scopes and delivers CI report publishing
DeployOpen plans, builds and hands over the CI wiring that turns promptfoo JUnit XML, HTML and JSON output into reports your reviewers already open. The work runs inside your own pipelines and infrastructure, with the output paths, secret handling and retention rules agreed in writing before the first job changes.
How we scope
- We confirm which CI system, runners and promptfoo version your pipelines use before writing any job changes.
- The written scope lists each output file, its consumer (test tab, human reviewer or script) and where it is stored.
- We agree in writing how provider keys, prompts and model responses in the reports are handled, retained and access-controlled.
How we build
- We configure promptfoo eval runs with several -o outputs so JUnit XML, HTML and JSON are produced from one run.
- We wire the JUnit file into your CI test tab and check that failed cases show with the expected names and messages.
- We test that the HTML and JSON artifacts are archived, scoped to the right users and not written to public logs.
How we hand over
- You receive the pipeline configuration, output paths and a short runbook describing what each report contains.
- The documentation records which report fields may include prompts, outputs and sensitive test data, so reviewers know what they see.
- We walk through the retest results with your platform and security owners before the scope closes.
How we support
- Fixed-scope engagements have written deliverables and timelines agreed before work starts.
- Ongoing support, upgrades of promptfoo and CI tooling, and continuous testing are available as a retainer.
- Retainer scope, response expectations and fees are confirmed in writing as part of the quote.

