Skip to content
| Marketplace
Sign in
Visual Studio Code>Testing>JUnit XML Dialect NormalizerNew to Visual Studio Code? Get it now.
JUnit XML Dialect Normalizer

JUnit XML Dialect Normalizer

Japan Public Data

|
18 installs
| (0) | Free
Validate and normalize the active JUnit XML document for a selected CI consumer.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

JUnit XML Dialect Normalizer

JUnit XML has no single current specification, and CI consumers do not accept every producer dialect consistently. This extension provides one local command that validates the active report and rewrites nested suites into a deterministic, flat testsuites document for the selected consumer.

Install and try it in one minute

  1. Install JUnit XML Dialect Normalizer from the Visual Studio Marketplace.
  2. In VS Code, create a new file named sample-junit.xml and paste this harmless synthetic report:
<?xml version="1.0"?>
<testsuites>
  <testsuite name="outer">
    <testcase name="passes" time="0.2" />
    <testsuite name="inner">
      <testcase name="fails" time="0.3">
        <failure message="synthetic failure" />
      </testcase>
    </testsuite>
  </testsuite>
</testsuites>
  1. Press Ctrl+Shift+P (or Cmd+Shift+P on macOS), type JUnit XML: Normalize for CI Consumer, and select that command.
  2. Confirm that VS Code reports Normalized JUnit XML for azure-pipelines. The active document should now contain two top-level suites named outer and outer / inner; the root totals should be tests="2", failures="1", and time="0.5".
  3. Review the edit and save only if you want to keep it. VS Code Undo reverses the change.

The default target is Azure Pipelines. To try GitLab instead, set JUnit XML Dialect Normalizer: Target to gitlab in VS Code Settings before running the same command.

Normal workflow

  1. Open a JUnit XML report in VS Code.
  2. Set junitXmlDialectNormalizer.target to azure-pipelines or gitlab.
  3. Run JUnit XML: Normalize for CI Consumer from the Command Palette.
  4. Review and save the edited document.

The command works entirely in the editor. It makes no network requests and sends no telemetry. It rejects DTD and entity declarations, malformed XML, unsupported roots, excessive input, and empty GitLab-targeted reports. On failure, the document is not changed.

Normalization flattens nested suites, retains testcase content and suite metadata, adds ancestor names to flattened suite names, and recalculates tests, failures, errors, skipped, and time. Keep the original report under source control or regenerate it if you need to reverse the edit.

Local verification

From the materialized project directory, run:

node tests/run-tests.js
node scripts/check-bundle.js --check

Both checks use only Node.js built-in modules. No dependency installation is required.

Extension Development Host (contributors)

Open this folder in VS Code, start an Extension Development Host for the folder, open a JUnit XML fixture, and invoke the command from the Command Palette. The automated fixture test also exercises command registration, document replacement, target configuration, and success messaging with a deterministic VS Code API fixture.

Scope and limitations

This MVP supports the conventional testsuites, testsuite, and testcase structure. It intentionally does not implement XML schemas, arbitrary custom entities, XSLT, automatic file discovery, background processing, uploads, or default-on telemetry. Always review normalized output before supplying it to CI.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft