Skip to content

Commit 2057810

Browse files
committed
first commit
0 parents  commit 2057810

File tree

14 files changed

+1075
-0
lines changed

14 files changed

+1075
-0
lines changed

.DS_Store

6 KB
Binary file not shown.

.github/workflows/main.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
pull_request:
8+
branches:
9+
- '**'
10+
11+
jobs:
12+
testing:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
- name: Install dependencies
18+
run: npm install
19+
- name: Build
20+
run: npx tsc
21+
- name: Convert
22+
run: npx junit-to-ctrf test.xml

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dist
2+
node_modules
3+
ctrf

CONTRIBUTING.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Contributing
2+
3+
First off, thank you for considering contributing to this project.
4+
5+
## Reporting Issues
6+
7+
Before submitting an issue, please check the issue tracker to ensure that the issue hasn't already been reported. If you find your issue already reported, you can subscribe to that issue to receive updates. If you have any additional information to add, please comment on the issue. If the issue is unnasigned and you'd like to contribute, assign the issue to yourself.
8+
9+
## How to Contribute
10+
11+
If you'd like to contribute, start by searching through the issues and pull requests to see whether someone else has raised a similar idea or question.
12+
13+
If you don't see your idea listed, and you think it fits into the goals of this project, do one of the following:
14+
15+
- If your contribution is minor, such as a typo fix, open a pull request.
16+
- If your contribution is major, or you have not yet decided how to implement your idea, open an issue to discuss it. This allows other contributors to point out any potential flaws or to help you flesh out your idea.
17+
18+
### Pull Requests
19+
20+
1. Fork the repository and create your branch from `main`.
21+
2. Write some code
22+
3. Make sure your code lints.
23+
4. Issue that pull request!
24+
25+
### Commit Messages
26+
27+
Write meaningful commit messages that provide insight into the changes made.
28+
29+
## Finding Bugs
30+
31+
If you find a bug, please report it in the issue tracker with a detailed description.
32+
33+
## Feature Requests
34+
35+
Feature requests are welcome. But take a moment to find out whether your idea fits with the scope and aims of the project. Please provide as much detail and context as possible.
36+
37+
## License
38+
39+
By contributing to this project, you agree that your contributions will be licensed under MIT.
40+
41+
## Acknowledgments
42+
43+
Your contributions are sincerely appreciated. We want to make contributing to this project as easy and transparent as possible, whether it's:
44+
45+
- Reporting a bug
46+
- Discussing the current state of the code
47+
- Submitting a fix
48+
- Proposing new features
49+
50+
Thank you for your interest in contributing

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Matthew Thomas
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# Convert JUnit XML to CTRF JSON
2+
3+
> Convert JUnit reports to CTRF reports
4+
5+
**If you find this project useful, consider giving it a GitHub star**
6+
7+
It means a lot to us and helps us grow this open source library.
8+
9+
## We need your help
10+
11+
We believe CTRF can save **a lot** of time for engineers, a single data serialisation report, well structured, community driven and works with any framework. For over 30 years software engineers have used a de facto data serialisation report, you know the one! But we feel it’s time to modernise.
12+
13+
The only way we can grow CTRF is with your help and the support of the software engineering community.
14+
15+
## How can you help?
16+
17+
- Join and build with us! We are looking for [contributors](https://github.com/ctrf-io), get involved in this early stage project. All contributions are welcome.
18+
- Give this repository a star ⭐⭐⭐⭐⭐⭐
19+
- Follow the CTRF [GitHub organisation](https://github.com/ctrf-io)
20+
- Clap for our [Medium articles](https://medium.com/@ma11hewthomas) (30 times each) 👏
21+
- Share, share share! Discord, Reddit, Twitter, LinkedIn, Slack, Teams, whereever! - please share our [libraries](https://github.com/orgs/ctrf-io/repositories), our [homepage](https://www.ctrf.io/), our [Medium articles](https://medium.com/@ma11hewthomas)
22+
- Maybe even write a blog about us!
23+
- Try our [tools](https://github.com/orgs/ctrf-io/repositories)
24+
25+
**Thank you so much!!**
26+
27+
## Usage
28+
29+
```sh
30+
npx junit-to-ctrf /path/to/junit.xml
31+
```
32+
33+
## Options
34+
35+
`-o`, `--output` <output>: Output directory and filename for the CTRF report. If not provided, defaults to ctrf/ctrf-report.json.
36+
37+
`-t`, `--tool` <toolName>: Tool name to include in the CTRF report.
38+
39+
`-e`, `--env` <envProperties>: Environment properties to include in the CTRF report. Accepts multiple properties in the format KEY=value.
40+
41+
## Examples
42+
43+
Convert a JUnit XML report to the default CTRF report location (ctrf/ctrf-report.json):
44+
45+
```sh
46+
npx junit-to-ctrf /path/to/junit.xml
47+
```
48+
49+
### Specify Output File
50+
51+
Convert a JUnit XML report to a specified output file:
52+
53+
```sh
54+
npx junit-to-ctrf /path/to/junit.xml -o /path/to/output/ctrf-report.json
55+
```
56+
57+
### Include Tool Name
58+
59+
Convert a JUnit XML report and include a tool name in the CTRF report:
60+
61+
```sh
62+
npx junit-to-ctrf /path/to/junit.xml -t ExampleTool
63+
```
64+
65+
### Include Environment Properties
66+
67+
Convert a JUnit XML report and include environment properties in the CTRF report:
68+
69+
```sh
70+
npx junit-to-ctrf /path/to/junit.xml -e appName=MyApp buildName=MyBuild
71+
```
72+
73+
See [](https://www.ctrf.io/docs/schema/environment)
74+
75+
### Full Command
76+
77+
Combine all options in a single command:
78+
79+
```sh
80+
npx junit-to-ctrf /path/to/junit.xml -o /path/to/output/ctrf-report.json -t ExampleTool -e appName=MyApp buildName=MyBuild
81+
```
82+
83+
## What is CTRF?
84+
85+
CTRF is a universal JSON test report schema that addresses the lack of a standardized format for JSON test reports.
86+
87+
**Consistency Across Tools:** Different testing tools and frameworks often produce reports in varied formats. CTRF ensures a uniform structure, making it easier to understand and compare reports, regardless of the testing tool used.
88+
89+
**Language and Framework Agnostic:** It provides a universal reporting schema that works seamlessly with any programming language and testing framework.
90+
91+
**Facilitates Better Analysis:** With a standardized format, programatically analyzing test outcomes across multiple platforms becomes more straightforward.
92+
93+
## Support Us
94+
95+
If you find this project useful, consider giving it a GitHub star ⭐ It means a lot to us.

0 commit comments

Comments
 (0)