Skip to content

Commit 1d278e6

Browse files
committed
feat: init commit, pypi init
0 parents  commit 1d278e6

24 files changed

Lines changed: 2087 additions & 0 deletions
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "0.1.0"
3+
}

.github/release-please-config.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
3+
"release-type": "python",
4+
"packages": {
5+
".": {
6+
"release-type": "python",
7+
"version-file": "pyproject.toml",
8+
"changelog-path": "CHANGELOG.md"
9+
}
10+
}
11+
}

.github/workflows/publish.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Publish to PyPI (manual)
2+
3+
# Emergency / re-publish fallback. Normal publishes are triggered automatically
4+
# by the release-please.yml workflow when a release is created.
5+
on:
6+
workflow_dispatch:
7+
inputs:
8+
tag:
9+
description: "Git tag to publish (e.g. v0.1.0)"
10+
required: true
11+
12+
permissions:
13+
id-token: write # Required for OIDC trusted publishing
14+
15+
jobs:
16+
publish:
17+
name: Publish to PyPI
18+
runs-on: ubuntu-latest
19+
environment:
20+
name: pypi
21+
url: https://pypi.org/p/robotmk-bridge-testdatagenerator
22+
steps:
23+
- uses: actions/checkout@v4
24+
with:
25+
ref: ${{ github.event.inputs.tag }}
26+
27+
- uses: actions/setup-python@v5
28+
with:
29+
python-version: "3.x"
30+
31+
- name: Build package
32+
run: |
33+
pip install build hatchling
34+
python -m build
35+
36+
- name: Publish to PyPI
37+
uses: pypa/gh-action-pypi-publish@release/v1
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Release Please
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
12+
jobs:
13+
release-please:
14+
runs-on: ubuntu-latest
15+
outputs:
16+
release_created: ${{ steps.release.outputs.release_created }}
17+
tag_name: ${{ steps.release.outputs.tag_name }}
18+
steps:
19+
- uses: googleapis/release-please-action@v4
20+
id: release
21+
with:
22+
config-file: .github/release-please-config.json
23+
manifest-file: .github/.release-please-manifest.json
24+
25+
publish:
26+
name: Publish to PyPI
27+
needs: release-please
28+
if: ${{ needs.release-please.outputs.release_created == 'true' }}
29+
runs-on: ubuntu-latest
30+
environment:
31+
name: pypi
32+
url: https://pypi.org/p/robotmk-bridge-testdatagenerator
33+
permissions:
34+
id-token: write # Required for OIDC trusted publishing
35+
steps:
36+
- uses: actions/checkout@v4
37+
with:
38+
ref: ${{ needs.release-please.outputs.tag_name }}
39+
40+
- uses: actions/setup-python@v5
41+
with:
42+
python-version: "3.x"
43+
44+
- name: Build package
45+
run: |
46+
pip install build hatchling
47+
python -m build
48+
49+
- name: Publish to PyPI
50+
uses: pypa/gh-action-pypi-publish@release/v1

.gitignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
dist/
2+
build/
3+
*.egg-info/
4+
__pycache__/
5+
*.py[cod]
6+
.venv/
7+
.env
8+
*.whl
9+
*.tar.gz
10+
.pytest_cache/
11+
.mypy_cache/
12+
.ruff_cache/
13+
.claude
14+
_bmad-output
15+
docs
16+
_bmad

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
Changelog entries are managed automatically by [release-please](https://github.com/googleapis/release-please).
9+
10+
<!-- Release notes are appended above this line by release-please -->

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) 2026 Simon Meggle
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: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# robotmk-bridge-testdatagenerator
2+
3+
Generates synthetic test result files for [robotmk-bridge-plugin](https://github.com/simonmeggle/robotmk-bridge-plugin) testing. Produces realistic, randomized output in the formats consumed by the bridge plugin's handlers.
4+
5+
## Supported Formats
6+
7+
| Handler | Format | Extension |
8+
|---|---|---|
9+
| `junit` | JUnit XML | `.xml` |
10+
| `zaproxy` | OWASP ZAP XML v2.7.0 | `.xml` |
11+
| `gatling` | Gatling simulation.log v2.0 | `.log` |
12+
13+
## Installation
14+
15+
```bash
16+
pip install robotmk-bridge-testdatagenerator
17+
```
18+
19+
## CLI Usage
20+
21+
```bash
22+
# Generate all handlers (output: tests/e2e/data/)
23+
rmkb-testgen
24+
25+
# Specify output directory and status
26+
rmkb-testgen --output-dir /tmp/test-data --status failed
27+
28+
# Generate specific handlers only
29+
rmkb-testgen --handlers junit gatling
30+
31+
# Continuous mode (Ctrl+C to stop)
32+
rmkb-testgen --continuous --interval 5
33+
34+
# List available handlers
35+
rmkb-testgen --list
36+
```
37+
38+
### Options
39+
40+
| Flag | Short | Default | Description |
41+
|---|---|---|---|
42+
| `--output-dir` | `-o` | `tests/e2e/data` | Output directory |
43+
| `--status` | `-s` | `passed` | `passed` / `failed` / `mixed` |
44+
| `--handlers` | `-H` | all | Specific handlers to generate |
45+
| `--pattern` | `-p` | `{handler}.{ext}` | Filename pattern |
46+
| `--continuous` | `-c` | off | Regenerate on interval |
47+
| `--interval` | `-i` | `5.0` | Seconds between generations |
48+
| `--list` | `-l` || List handlers and exit |
49+
| `--verbose` | `-v` | off | Verbose output |
50+
51+
## Library Usage
52+
53+
```python
54+
from robotmk_bridge_testdatagenerator import (
55+
generate_all_handler_files,
56+
generate_handler_file,
57+
get_supported_handlers,
58+
)
59+
from pathlib import Path
60+
61+
# Generate all handlers
62+
files = generate_all_handler_files(Path("/tmp/test-data"), test_status="mixed")
63+
64+
# Generate a single handler
65+
generate_handler_file("junit", Path("/tmp/result.xml"), test_status="failed")
66+
67+
# List handlers
68+
handlers = get_supported_handlers() # ['junit', 'gatling', 'zaproxy']
69+
```
70+
71+
## Custom handlers.yaml
72+
73+
By default the bundled `handlers.yaml` is used. Override via environment variable:
74+
75+
```bash
76+
ROBOTMK_HANDLERS_YAML=/path/to/your/handlers.yaml rmkb-testgen
77+
```
78+
79+
## Test Status Semantics
80+
81+
| Status | JUnit | ZAP | Gatling |
82+
|---|---|---|---|
83+
| `passed` | All pass | Low-risk alerts only | All requests OK |
84+
| `failed` | All fail | High-risk alerts | All requests KO |
85+
| `mixed` | Every 3rd fails | Low + medium risk | Every 4th KO |
86+
87+
## License
88+
89+
MIT

__init__.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
"""Test data generator for robotmk-bridge-plugin.
2+
3+
This module generates realistic test result files for different handler types
4+
(JUnit, ZAP, Gatling). Used by both e2e tests and unit test fixtures.
5+
"""
6+
7+
from .generator import (
8+
generate_all_handler_files,
9+
generate_handler_file,
10+
get_supported_handlers,
11+
)
12+
13+
__all__ = [
14+
"generate_all_handler_files",
15+
"generate_handler_file",
16+
"get_supported_handlers",
17+
]

0 commit comments

Comments
 (0)