Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rohit-gohri/drone-junit
A drone plugin to display junit report summary in card view
https://github.com/rohit-gohri/drone-junit
adaptive-cards ci continuous-integration drone drone-plugin junit plugin reporting
Last synced: 5 days ago
JSON representation
A drone plugin to display junit report summary in card view
- Host: GitHub
- URL: https://github.com/rohit-gohri/drone-junit
- Owner: rohit-gohri
- License: other
- Created: 2022-11-11T22:55:38.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-22T08:54:48.000Z (over 1 year ago)
- Last Synced: 2024-10-05T22:41:23.955Z (3 months ago)
- Topics: adaptive-cards, ci, continuous-integration, drone, drone-plugin, junit, plugin, reporting
- Language: Go
- Homepage:
- Size: 131 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Drone Junit
[![Release](https://github.com/rohit-gohri/drone-junit/actions/workflows/release.yaml/badge.svg)](https://github.com/rohit-gohri/drone-junit/actions/workflows/release.yaml)
[![Test Build](https://cloud.drone.io/api/badges/rohit-gohri/drone-junit/status.svg?ref=refs/heads/main)](https://cloud.drone.io/rohit-gohri/drone-junit)A Drone plugin to parse Junit test reports and create tests summary using [plugin cards](https://docs.drone.io/plugins/adaptive_cards/).
![Preview of junit report](./docs/image.jpg)
## Usage
The following settings changes this plugin's behavior.
* paths (required) - Pass a glob pattern to match all xml junit files
* report_name (optional) - Customize the name of the report
* total (optional, default true) - Combine and show sum of all reportsBelow is an example `.drone.yml` that uses this plugin.
```yaml
kind: pipeline
name: defaultsteps:
# Run your tests here and generate report
- name: tests
image: golang
commands:
- go install github.com/jstemmer/go-junit-report/v2@latest
- go test -v 2>&1 ./... | go-junit-report -set-exit-code > report.xml- name: junit-reports
image: ghcr.io/rohit-gohri/drone-junit:v0
settings:
paths: report.xml
when:
status: [
'success',
'failure',
]
```### GHCR
Images are published on Github Container Registry -
```yaml
- name: junit-reports
image: ghcr.io/rohit-gohri/drone-junit:v0
settings:
paths: report.xml
when:
status: [
'success',
'failure',
]
```### Docker Hub
Images are also published on Docker Hub -
```yaml
- name: junit-reports
image: boringdownload/drone-junit:v0
settings:
paths: report.xml
```## Development
### Building
Build the plugin binary:
```text
scripts/build.sh
```Build the plugin image:
```text
docker build -t boringdownload/drone-junit -f docker/Dockerfile .
```### Testing
Execute the plugin from your current working directory:
```text
docker run --rm -e PLUGIN_PATHS="report.xml" -e PLUGIN_REPORT_NAME="drone-junit" \
-e DRONE_COMMIT_SHA=8f51ad7884c5eb69c11d260a31da7a745e6b78e2 \
-e DRONE_COMMIT_BRANCH=master \
-e DRONE_BUILD_NUMBER=43 \
-e DRONE_BUILD_STATUS=success \
-w /drone/src \
-v $(pwd):/drone/src \
boringdownload/drone-junit
```