dbt-to-junit 0.1.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of dbt-to-junit might be problematic. Click here for more details.

@@ -0,0 +1,153 @@
1
+ # Claude Code directives (personal learning notes)
2
+ claude.md
3
+ .claude/
4
+
5
+ # Byte-compiled / optimized / DLL files
6
+ __pycache__/
7
+ *.py[cod]
8
+ *$py.class
9
+
10
+ # C extensions
11
+ *.so
12
+
13
+ # Distribution / packaging
14
+ .Python
15
+ build/
16
+ develop-eggs/
17
+ dist/
18
+ downloads/
19
+ eggs/
20
+ .eggs/
21
+ lib/
22
+ lib64/
23
+ parts/
24
+ sdist/
25
+ var/
26
+ wheels/
27
+ share/python-wheels/
28
+ *.egg-info/
29
+ .installed.cfg
30
+ *.egg
31
+ MANIFEST
32
+
33
+ # PyInstaller
34
+ *.manifest
35
+ *.spec
36
+
37
+ # Installer logs
38
+ pip-log.txt
39
+ pip-delete-this-directory.txt
40
+
41
+ # Unit test / coverage reports
42
+ htmlcov/
43
+ .tox/
44
+ .nox/
45
+ .coverage
46
+ .coverage.*
47
+ .cache
48
+ nosetests.xml
49
+ coverage.xml
50
+ *.cover
51
+ *.py,cover
52
+ .hypothesis/
53
+ .pytest_cache/
54
+ cover/
55
+
56
+ # Translations
57
+ *.mo
58
+ *.pot
59
+
60
+ # Django stuff:
61
+ *.log
62
+ local_settings.py
63
+ db.sqlite3
64
+ db.sqlite3-journal
65
+
66
+ # Flask stuff:
67
+ instance/
68
+ .webassets-cache
69
+
70
+ # Scrapy stuff:
71
+ .scrapy
72
+
73
+ # Sphinx documentation
74
+ docs/_build/
75
+
76
+ # PyBuilder
77
+ .pybuilder/
78
+ target/
79
+
80
+ # Jupyter Notebook
81
+ .ipynb_checkpoints
82
+
83
+ # IPython
84
+ profile_default/
85
+ ipython_config.py
86
+
87
+ # pyenv
88
+ .python-version
89
+
90
+ # pipenv
91
+ Pipfile.lock
92
+
93
+ # poetry
94
+ poetry.lock
95
+
96
+ # pdm
97
+ .pdm.toml
98
+
99
+ # PEP 582
100
+ __pypackages__/
101
+
102
+ # Celery stuff
103
+ celerybeat-schedule
104
+ celerybeat.pid
105
+
106
+ # SageMath parsed files
107
+ *.sage.py
108
+
109
+ # Environments
110
+ .env
111
+ .venv
112
+ env/
113
+ venv/
114
+ ENV/
115
+ env.bak/
116
+ venv.bak/
117
+
118
+ # Spyder project settings
119
+ .spyderproject
120
+ .spyproject
121
+
122
+ # Rope project settings
123
+ .ropeproject
124
+
125
+ # mkdocs documentation
126
+ /site
127
+
128
+ # mypy
129
+ .mypy_cache/
130
+ .dmypy.json
131
+ dmypy.json
132
+
133
+ # Pyre type checker
134
+ .pyre/
135
+
136
+ # pytype static type analyzer
137
+ .pytype/
138
+
139
+ # Cython debug symbols
140
+ cython_debug/
141
+
142
+ # PyCharm
143
+ .idea/
144
+
145
+ # VSCode
146
+ .vscode/
147
+
148
+ # uv
149
+ .uv/
150
+
151
+ tests/
152
+
153
+ dbt-junit.xml
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Jorge Contreras
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.
@@ -0,0 +1,94 @@
1
+ Metadata-Version: 2.4
2
+ Name: dbt-to-junit
3
+ Version: 0.1.4
4
+ Summary: Convert dbt's target/run_results.json into a JUnit XML report so Azure DevOps (ADO) can display dbt test results in the Tests tab.
5
+ Project-URL: Documentation, https://github.com/jorgecontrerasostos/dbt-junit-xml#readme
6
+ Project-URL: Issues, https://github.com/jorgecontrerasostos/dbt-junit-xml/issues
7
+ Project-URL: Source, https://github.com/jorgecontrerasostos/dbt-junit-xml
8
+ Author-email: Jorge Contreras <jorgecontrerasostos@gmail.com>
9
+ License-File: LICENSE
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Programming Language :: Python
12
+ Classifier: Programming Language :: Python :: 3.8
13
+ Classifier: Programming Language :: Python :: 3.9
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: Implementation :: CPython
18
+ Classifier: Programming Language :: Python :: Implementation :: PyPy
19
+ Requires-Python: >=3.8
20
+ Requires-Dist: junit-xml>=1.9
21
+ Provides-Extra: dev
22
+ Requires-Dist: black>=24.8.0; extra == 'dev'
23
+ Requires-Dist: pytest; extra == 'dev'
24
+ Requires-Dist: pytest-cov; extra == 'dev'
25
+ Requires-Dist: ruff; extra == 'dev'
26
+ Description-Content-Type: text/markdown
27
+
28
+ # dbt to JUnit XML
29
+
30
+ Convert dbt's `target/run_results.json` into a JUnit XML report so Azure DevOps (ADO) can display dbt test results in the Tests tab.
31
+
32
+ This tool is designed for CI: it reads the run results produced by `dbt build`, generates a single JUnit report, and writes it to a file that can be published by ADO.
33
+
34
+ ## What it reads
35
+
36
+ - **Input**: dbt `run_results.json` (typically `target/run_results.json`)
37
+ - **Source of truth**: the `results` list inside that file
38
+ - **Filtering**: by default, only dbt tests are included (`unique_id` starts with `test.`)
39
+
40
+ ## What it writes
41
+
42
+ - **Output**: a JUnit XML file (default: `dbt-junit.xml`)
43
+ - **Structure**: one `<testsuite>` containing one `<testcase>` per dbt test
44
+
45
+ ## Install / run (local)
46
+
47
+ If you're using this repo with `uv`:
48
+
49
+ ```bash
50
+ uv sync
51
+ uv run dbt-junit-xml --input target/run_results.json --output dbt-junit.xml
52
+ ```
53
+
54
+ You can also run it directly with Python:
55
+
56
+ ```bash
57
+ python -m src.main --input target/run_results.json --output dbt-junit.xml
58
+ ```
59
+
60
+ ## CLI options
61
+
62
+ - `--input`: path to `run_results.json` (default: `target/run_results.json`)
63
+ - `--output`: output XML path (default: `dbt-junit.xml`)
64
+ - `--log-level`: `DEBUG|INFO|WARNING|ERROR` (default: `INFO`)
65
+ - `--include-models`: include non-test nodes as testcases (default: off)
66
+
67
+ ## Exit codes
68
+
69
+ - **0**: report generated and no failing dbt tests
70
+ - **1**: report generated and at least one dbt test failed/errored
71
+ - **2**: could not generate report (missing file, invalid JSON, unexpected format, etc.)
72
+
73
+ ## Azure DevOps pipeline example
74
+
75
+ Run dbt (which produces `target/run_results.json`), generate the JUnit XML, then publish it:
76
+
77
+ ```yaml
78
+ - script: |
79
+ dbt build
80
+ dbt-junit-xml --input target/run_results.json --output dbt-junit.xml
81
+ displayName: "Run dbt and generate JUnit report"
82
+
83
+ - task: PublishTestResults@2
84
+ displayName: "Publish dbt test results"
85
+ inputs:
86
+ testResultsFormat: "JUnit"
87
+ testResultsFiles: "dbt-junit.xml"
88
+ failTaskOnFailedTests: true
89
+ ```
90
+
91
+ ## Notes / tips
92
+
93
+ - If your pipeline working directory is not the dbt project root, pass an explicit `--input` path.
94
+ - If you only want dbt tests in ADO, do not pass `--include-models` (default behavior already filters to tests).
@@ -0,0 +1,67 @@
1
+ # dbt to JUnit XML
2
+
3
+ Convert dbt's `target/run_results.json` into a JUnit XML report so Azure DevOps (ADO) can display dbt test results in the Tests tab.
4
+
5
+ This tool is designed for CI: it reads the run results produced by `dbt build`, generates a single JUnit report, and writes it to a file that can be published by ADO.
6
+
7
+ ## What it reads
8
+
9
+ - **Input**: dbt `run_results.json` (typically `target/run_results.json`)
10
+ - **Source of truth**: the `results` list inside that file
11
+ - **Filtering**: by default, only dbt tests are included (`unique_id` starts with `test.`)
12
+
13
+ ## What it writes
14
+
15
+ - **Output**: a JUnit XML file (default: `dbt-junit.xml`)
16
+ - **Structure**: one `<testsuite>` containing one `<testcase>` per dbt test
17
+
18
+ ## Install / run (local)
19
+
20
+ If you're using this repo with `uv`:
21
+
22
+ ```bash
23
+ uv sync
24
+ uv run dbt-junit-xml --input target/run_results.json --output dbt-junit.xml
25
+ ```
26
+
27
+ You can also run it directly with Python:
28
+
29
+ ```bash
30
+ python -m src.main --input target/run_results.json --output dbt-junit.xml
31
+ ```
32
+
33
+ ## CLI options
34
+
35
+ - `--input`: path to `run_results.json` (default: `target/run_results.json`)
36
+ - `--output`: output XML path (default: `dbt-junit.xml`)
37
+ - `--log-level`: `DEBUG|INFO|WARNING|ERROR` (default: `INFO`)
38
+ - `--include-models`: include non-test nodes as testcases (default: off)
39
+
40
+ ## Exit codes
41
+
42
+ - **0**: report generated and no failing dbt tests
43
+ - **1**: report generated and at least one dbt test failed/errored
44
+ - **2**: could not generate report (missing file, invalid JSON, unexpected format, etc.)
45
+
46
+ ## Azure DevOps pipeline example
47
+
48
+ Run dbt (which produces `target/run_results.json`), generate the JUnit XML, then publish it:
49
+
50
+ ```yaml
51
+ - script: |
52
+ dbt build
53
+ dbt-junit-xml --input target/run_results.json --output dbt-junit.xml
54
+ displayName: "Run dbt and generate JUnit report"
55
+
56
+ - task: PublishTestResults@2
57
+ displayName: "Publish dbt test results"
58
+ inputs:
59
+ testResultsFormat: "JUnit"
60
+ testResultsFiles: "dbt-junit.xml"
61
+ failTaskOnFailedTests: true
62
+ ```
63
+
64
+ ## Notes / tips
65
+
66
+ - If your pipeline working directory is not the dbt project root, pass an explicit `--input` path.
67
+ - If you only want dbt tests in ADO, do not pass `--include-models` (default behavior already filters to tests).
@@ -0,0 +1,154 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "dbt-to-junit"
7
+ dynamic = ["version"]
8
+ description = "Convert dbt's target/run_results.json into a JUnit XML report so Azure DevOps (ADO) can display dbt test results in the Tests tab."
9
+ readme = "README.md"
10
+ requires-python = ">=3.8"
11
+ authors = [
12
+ {name = "Jorge Contreras", email = "jorgecontrerasostos@gmail.com"},
13
+ ]
14
+ keywords = []
15
+ classifiers = [
16
+ "Development Status :: 4 - Beta",
17
+ "Programming Language :: Python",
18
+ "Programming Language :: Python :: 3.8",
19
+ "Programming Language :: Python :: 3.9",
20
+ "Programming Language :: Python :: 3.10",
21
+ "Programming Language :: Python :: 3.11",
22
+ "Programming Language :: Python :: 3.12",
23
+ "Programming Language :: Python :: Implementation :: CPython",
24
+ "Programming Language :: Python :: Implementation :: PyPy",
25
+ ]
26
+ dependencies = [
27
+ "junit-xml>=1.9",
28
+ ]
29
+
30
+ [project.optional-dependencies]
31
+ dev = [
32
+ "black>=24.8.0",
33
+ "ruff",
34
+ "pytest",
35
+ "pytest-cov",
36
+ ]
37
+
38
+ [project.urls]
39
+ Documentation = "https://github.com/jorgecontrerasostos/dbt-junit-xml#readme"
40
+ Issues = "https://github.com/jorgecontrerasostos/dbt-junit-xml/issues"
41
+ Source = "https://github.com/jorgecontrerasostos/dbt-junit-xml"
42
+
43
+ [project.scripts]
44
+ dbt-junit-xml = "src.main:main"
45
+
46
+ [tool.hatch.version]
47
+ path = "src/__about__.py"
48
+
49
+ [tool.hatch.build.targets.wheel]
50
+ packages = ["src"]
51
+
52
+ [tool.hatch.envs.default]
53
+ dependencies = [
54
+ "coverage[toml]",
55
+ "pytest",
56
+ "pytest-cov",
57
+ ]
58
+
59
+ [tool.hatch.envs.default.scripts]
60
+ test = "pytest {args:tests}"
61
+ test-cov = "coverage run -m pytest {args:tests}"
62
+ cov-report = [
63
+ "- coverage combine",
64
+ "coverage report",
65
+ ]
66
+ cov = [
67
+ "test-cov",
68
+ "cov-report",
69
+ ]
70
+
71
+ [tool.ruff]
72
+ target-version = "py38"
73
+ line-length = 88
74
+ select = [
75
+ "A",
76
+ "ARG",
77
+ "B",
78
+ "C",
79
+ "DTZ",
80
+ "E",
81
+ "EM",
82
+ "F",
83
+ "FBT",
84
+ "I",
85
+ "ICN",
86
+ "ISC",
87
+ "N",
88
+ "PLC",
89
+ "PLE",
90
+ "PLR",
91
+ "PLW",
92
+ "Q",
93
+ "RUF",
94
+ "S",
95
+ "T",
96
+ "TID",
97
+ "UP",
98
+ "W",
99
+ "YTT",
100
+ ]
101
+ ignore = [
102
+ # Allow non-abstract empty methods in abstract base classes
103
+ "B027",
104
+ # Allow boolean positional values in function calls, like `dict.get(... True)`
105
+ "FBT003",
106
+ # Ignore checks for possible passwords
107
+ "S105", "S106", "S107",
108
+ # Ignore complexity
109
+ "C901", "PLR0911", "PLR0912", "PLR0913", "PLR0915",
110
+ ]
111
+ unfixable = [
112
+ # Don't touch unused imports
113
+ "F401",
114
+ ]
115
+
116
+ [tool.ruff.isort]
117
+ known-first-party = ["src"]
118
+
119
+ [tool.ruff.flake8-tidy-imports]
120
+ ban-relative-imports = "all"
121
+
122
+ [tool.ruff.per-file-ignores]
123
+ # Tests can use magic values, assertions, and relative imports
124
+ "tests/**/*" = ["PLR2004", "S101", "TID252"]
125
+
126
+ [tool.coverage.run]
127
+ source_pkgs = ["src", "tests"]
128
+ branch = true
129
+ parallel = true
130
+ omit = [
131
+ "src/__about__.py",
132
+ ]
133
+
134
+ [tool.coverage.paths]
135
+ src = ["src", "*/python-project-template/src"]
136
+ tests = ["tests", "*/python-project-template/tests"]
137
+
138
+ [tool.coverage.report]
139
+ exclude_lines = [
140
+ "no cov",
141
+ "if __name__ == .__main__.:",
142
+ "if TYPE_CHECKING:",
143
+ ]
144
+
145
+ [dependency-groups]
146
+ dev = [
147
+ "black>=24.8.0",
148
+ "build>=1.2.2.post1",
149
+ "hatch>=1.14.2",
150
+ "pytest>=8.3.5",
151
+ "pytest-cov>=5.0.0",
152
+ "ruff>=0.14.10",
153
+ "twine>=6.1.0",
154
+ ]
@@ -0,0 +1,3 @@
1
+ """Version information for dbt-junit-xml."""
2
+
3
+ __version__ = "0.1.4"
File without changes