{"id":29097384,"url":"https://github.com/lambdaisland/kaocha-junit-xml","last_synced_at":"2025-06-28T13:42:08.572Z","repository":{"id":40486470,"uuid":"155597283","full_name":"lambdaisland/kaocha-junit-xml","owner":"lambdaisland","description":"JUnit XML output for Kaocha","archived":false,"fork":false,"pushed_at":"2025-03-28T09:25:39.000Z","size":102,"stargazers_count":14,"open_issues_count":1,"forks_count":11,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-08T21:35:38.254Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lambdaisland.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-10-31T17:24:34.000Z","updated_at":"2025-05-01T13:54:00.000Z","dependencies_parsed_at":"2024-04-17T14:20:30.389Z","dependency_job_id":"c2cbe7a5-ccdb-4e4d-8975-51b08ec62d54","html_url":"https://github.com/lambdaisland/kaocha-junit-xml","commit_stats":{"total_commits":100,"total_committers":10,"mean_commits":10.0,"dds":"0.16000000000000003","last_synced_commit":"844def5670894ae74a477b25a1b2d04f25dc1f5f"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/lambdaisland/kaocha-junit-xml","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lambdaisland%2Fkaocha-junit-xml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lambdaisland%2Fkaocha-junit-xml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lambdaisland%2Fkaocha-junit-xml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lambdaisland%2Fkaocha-junit-xml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lambdaisland","download_url":"https://codeload.github.com/lambdaisland/kaocha-junit-xml/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lambdaisland%2Fkaocha-junit-xml/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260159097,"owners_count":22967333,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-28T13:42:05.403Z","updated_at":"2025-06-28T13:42:08.559Z","avatar_url":"https://github.com/lambdaisland.png","language":"Clojure","funding_links":["https://opencollective.com/lambda-island","http://opencollective.com/lambda-island"],"categories":[],"sub_categories":[],"readme":"# lambdaisland/kaocha-junit-xml\n\n\u003c!-- badges --\u003e\n[![CircleCI](https://circleci.com/gh/lambdaisland/kaocha-junit-xml.svg?style=svg)](https://circleci.com/gh/lambdaisland/kaocha-junit-xml) [![cljdoc badge](https://cljdoc.org/badge/lambdaisland/kaocha-junit-xml)](https://cljdoc.org/d/lambdaisland/kaocha-junit-xml) [![Clojars Project](https://img.shields.io/clojars/v/lambdaisland/kaocha-junit-xml.svg)](https://clojars.org/lambdaisland/kaocha-junit-xml)\n\u003c!-- /badges --\u003e\n\n[Kaocha](https://github.com/lambdaisland/kaocha) plugin to generate a JUnit XML version of the test results.\n\n\u003c!-- opencollective --\u003e\n\n## Support Lambda Island Open Source\n\nThank you! kaocha-junit-xml is made possible thanks to our generous backers. [Become a\nbacker on OpenCollective](https://opencollective.com/lambda-island) so that we\ncan continue to make kaocha-junit-xml better.\n\n\u003ca href=\"https://opencollective.com/lambda-island\"\u003e\n\u003cimg src=\"https://opencollective.com/lambda-island/organizations.svg?avatarHeight=46\u0026width=800\u0026button=false\"\u003e\n\u003cimg src=\"https://opencollective.com/lambda-island/individuals.svg?avatarHeight=46\u0026width=800\u0026button=false\"\u003e\n\u003c/a\u003e\n\u003cimg align=\"left\" src=\"https://github.com/lambdaisland/open-source/raw/master/artwork/lighthouse_readme.png\"\u003e\n\n\u0026nbsp;\n\nkaocha-junit-xml is part of a growing collection of quality Clojure libraries and\ntools released on the Lambda Island label. If you are using this project\ncommercially then you are expected to pay it forward by\n[becoming a backer on Open Collective](http://opencollective.com/lambda-island#section-contribute),\nso that we may continue to enjoy a thriving Clojure ecosystem.\n\n\u0026nbsp;\n\n\u0026nbsp;\n\n\u0026nbsp;\n\n\u0026nbsp;\n\n\u003c!-- /opencollective --\u003e\n\n## Usage\n\n- Add kaocha-junit-xml as a dependency\n\n``` clojure\n;; deps.edn\n{:aliases\n {:test\n  {:extra-deps {lambdaisland/kaocha {...}\n                lambdaisland/kaocha-junit-xml {:mvn/version \"1.17.101\"}}}}}\n```\n\nor\n\n``` clojure\n;; project.clj\n(defproject ,,,\n  :dependencies [,,,\n                 [lambdaisland/kaocha-junit-xml \"1.17.101\"]])\n```\n\n- Enable the plugin and set an output file\n\n``` clojure\n;; tests.edn\n#kaocha/v1\n{:plugins [:kaocha.plugin/junit-xml]\n :kaocha.plugin.junit-xml/target-file \"junit.xml\"}\n```\n\nOr from the CLI\n\n``` shell\nbin/kaocha --plugin kaocha.plugin/junit-xml --junit-xml-file junit.xml\n```\n\nOptionally you can omit captured output from junit.xml\n\n``` clojure\n;; tests.edn\n#kaocha/v1\n{:plugins [:kaocha.plugin/junit-xml]\n :kaocha.plugin.junit-xml/target-file      \"junit.xml\"\n :kaocha.plugin.junit-xml/omit-system-out? true}\n```\n\nOr from the CLI\n\n``` shell\nbin/kaocha --plugin kaocha.plugin/junit-xml --junit-xml-file junit.xml --junit-xml-omit-system-out\n```\n\n## Requirements\n\nRequires at least Kaocha 0.0-306 and Clojure 1.9.\n\n## CI Integration\n\nSome CI tooling supports the `junit` `xml` output in various flavours.\n\n### CircleCI\n\nOne of the services that can use this output is CircleCI. Your\n`.circleci/config.yml` could look like this:\n\n``` yml\nversion: 2\njobs:\n  build:\n    docker:\n      - image: circleci/clojure:tools-deps-1.9.0.394\n    steps:\n      - checkout\n      - run: mkdir -p test-results/kaocha\n      - run: bin/kaocha --plugin kaocha.plugin/junit-xml --junit-xml-file test-results/kaocha/results.xml --junit-xml-add-location-metadata --junit-xml-use-relative-path-in-location\n      - store_test_results:\n          path: test-results\n```\n\n### GitHub Actions\n\nThe following configuration will create annotations for test failures on files of \nthe relevant commit/PR. First enable the plugin with the `add-location-metadata?` \nflag in your `tests.edn`:\n\n```edn\n#kaocha/v1\n{:plugins [:kaocha.plugin/junit-xml]\n :kaocha.plugin.junit-xml/target-file \"junit.xml\"\n :kaocha.plugin.junit-xml/add-location-metadata? true}\n```\n\nThen, an example `.github/workflows/build.yml` may look like: \n\n```yml\nname: Build\non: [push]\n\njobs:\n  build:\n    runs-on: ubuntu-latest\n    container:\n      image: clojure:openjdk-8-tools-deps-1.11.1.1113\n    steps:\n      - uses: actions/checkout@v2\n      - name: test\n        run: |\n          bin/kaocha\n      - name: Annotate failure\n        if: failure()\n        uses: mikepenz/action-junit-report@41a3188dde10229782fd78cd72fc574884dd7686\n        with:\n          report_paths: junit.xml\n```\n\n### Gitlab\n\nConfiguring Gitlab to parse JUnit XML is easy; just add a `report` artifact that\npoints to the XML file:\n\n```yaml\ntest:\n  only:\n    -tags\n  script:\n    - make test\n  artifacts:\n    reports:\n      junit: junit.xml\n```\n\nSee the [Gitlab documentation on reports using\nJUnit](https://docs.gitlab.com/ce/ci/junit_test_reports.html) for more information.\n\n## Caveats\n\nFor timing information (timestamp and running time) this plugin relies on the\n`kaocha.plugin/profiling` plugin. If the plugin is not present then a running\ntime of 0 will be reported.\n\nFor output capturing the `kaocha.plugin/capture-output` must be present. If it\nis not present `\u003csystem-out\u003e` will always be empty.\n\n## Resources\n\nIt was hard to find a definitive source of the Ant Junit XML format. I mostly\nwent with [this page](http://llg.cubic.org/docs/junit/) for documentation.\n\nFor information on how to configure CircleCI to use this information, see\n[store_test_results](https://circleci.com/docs/2.0/configuration-reference/#store_test_results).\n\nAfter reports that the output was not compatible with Azure Devops Pipeline the\noutput was changed to adhere to [this schema](https://github.com/windyroad/JUnit-Schema/blob/49e95a79cc0bfba7961aaf779710a43a4d3f96bd/JUnit.xsd).\n\nThe `--junit-xml-add-location-metadata` flag was added to enhance `testcase` \noutput with test location metadata à la \n[pytest](https://docs.pytest.org/en/latest/how-to/output.html?highlight=junit#creating-junitxml-format-files). \nThis allows for integration with various tools on GitHub Actions for producing\nannotations on files in commits/PRs with test failure data. For example, the \n[JUnit Report Action](https://github.com/marketplace/actions/junit-report-action).\n\nThe `--junit-xml-use-relative-path-in-location` flasg was added to enhance the `--junit-xml-add-location-metadata`\noutput for test ecosystems that rely on relative file-pathing.\nNotably, CircleCI's [parallelization](https://circleci.com/docs/use-the-circleci-cli-to-split-tests/#junit-xml-reports) assumes file paths in JUnit files are relative to the runner's working directory.\n\n\u003c!-- contributing --\u003e\n## Contributing\n\nEveryone has a right to submit patches to kaocha-junit-xml, and thus become a contributor.\n\nContributors MUST\n\n- adhere to the [LambdaIsland Clojure Style Guide](https://nextjournal.com/lambdaisland/clojure-style-guide)\n- write patches that solve a problem. Start by stating the problem, then supply a minimal solution. `*`\n- agree to license their contributions as EPL 1.0.\n- not break the contract with downstream consumers. `**`\n- not break the tests.\n\nContributors SHOULD\n\n- update the CHANGELOG and README.\n- add tests for new functionality.\n\nIf you submit a pull request that adheres to these rules, then it will almost\ncertainly be merged immediately. However some things may require more\nconsideration. If you add new dependencies, or significantly increase the API\nsurface, then we need to decide if these changes are in line with the project's\ngoals. In this case you can start by [writing a pitch](https://nextjournal.com/lambdaisland/pitch-template),\nand collecting feedback on it.\n\n`*` This goes for features too, a feature needs to solve a problem. State the problem it solves, then supply a minimal solution.\n\n`**` As long as this project has not seen a public release (i.e. is not on Clojars)\nwe may still consider making breaking changes, if there is consensus that the\nchanges are justified.\n\u003c!-- /contributing --\u003e\n\n\u003c!-- license --\u003e\n## License\n\nCopyright \u0026copy; 2018-2020 Arne Brasseur and contributors\n\nAvailable under the terms of the Eclipse Public License 1.0, see LICENSE.txt\n\u003c!-- /license --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flambdaisland%2Fkaocha-junit-xml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flambdaisland%2Fkaocha-junit-xml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flambdaisland%2Fkaocha-junit-xml/lists"}