Skip to content

Generate JUnit xml reports from Mill's test output.

License

Notifications You must be signed in to change notification settings

vic/mill-test-junit-report

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Generate JUnit XML reports from Mill's test output.

Many CI/CD servers already support reading JUnit XML reports and integrate well with code-review and merge-requests. However Mill is still more of a Scala niche tool.

This repo contains a tiny Scala utility that can transform Mill test json reports into JUnit XML reports.

Usage

ammonite generate-junit-report.sc --help

ammonite generate-junit-report.sc TEST_ID TEST_NAME TARGET_JUNIT_XML_FILE SOURCE_MILL_JSON_FILE...

TEST_ID and TEST_NAME have no special meaning and are for you to decide. You can provide many json files as input and they will be aggreated into a single target xml file.

Example

Suppose you have a build.sc file like:

// build.sc
import mill._, scalalib._

object foo extends ScalaModule {
  def scalaVersion = "2.13.1"

  object test extends Tests {
    def ivyDeps = Agg(ivy"com.lihaoyi::utest:0.7.1")
    def testFramework = "utest.runner.Framework"
  }
}

After running mill foo.test you will find mill's json report at out/foo/test/test/dest/out.json.

To convert it into JUnit XML format, execute the following ammonite script:

> ammonite generate-junit-report.sc "foo.test" "Foo tests" "foo-junit.xml" "out/foo/test/test/dest/out.json"

that will generate foo-junit.xml.

Releases

No releases published

Packages

No packages published

Languages