testbench-defect-service 0.1.0__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.
Files changed (103) hide show
  1. testbench_defect_service-0.1.0/.github/workflows/release.yaml +79 -0
  2. testbench_defect_service-0.1.0/.github/workflows/trigger-docs-release.yml +49 -0
  3. testbench_defect_service-0.1.0/.gitignore +217 -0
  4. testbench_defect_service-0.1.0/.pre-commit-config.yaml +49 -0
  5. testbench_defect_service-0.1.0/CHANGELOG.md +24 -0
  6. testbench_defect_service-0.1.0/CONTRIBUTING.md +112 -0
  7. testbench_defect_service-0.1.0/LICENSE +201 -0
  8. testbench_defect_service-0.1.0/PKG-INFO +127 -0
  9. testbench_defect_service-0.1.0/README.md +71 -0
  10. testbench_defect_service-0.1.0/bootstrap.py +81 -0
  11. testbench_defect_service-0.1.0/build_binary.py +203 -0
  12. testbench_defect_service-0.1.0/build_readme.py +43 -0
  13. testbench_defect_service-0.1.0/docs/cli.md +195 -0
  14. testbench_defect_service-0.1.0/docs/clients/_category_.json +4 -0
  15. testbench_defect_service-0.1.0/docs/clients/custom-client.md +252 -0
  16. testbench_defect_service-0.1.0/docs/clients/index.md +75 -0
  17. testbench_defect_service-0.1.0/docs/clients/jira-client.md +251 -0
  18. testbench_defect_service-0.1.0/docs/clients/jsonl-client.md +176 -0
  19. testbench_defect_service-0.1.0/docs/configuration.md +374 -0
  20. testbench_defect_service-0.1.0/docs/getting-started/_category_.json +4 -0
  21. testbench_defect_service-0.1.0/docs/getting-started/installation.md +165 -0
  22. testbench_defect_service-0.1.0/docs/getting-started/quickstart.md +118 -0
  23. testbench_defect_service-0.1.0/docs/intro.md +66 -0
  24. testbench_defect_service-0.1.0/docs/testbench-integration.md +99 -0
  25. testbench_defect_service-0.1.0/docs/windows-service-installation.md +25 -0
  26. testbench_defect_service-0.1.0/download_dependencies.py +421 -0
  27. testbench_defect_service-0.1.0/examples/jsonl/UserDefinedAttributes.json +20 -0
  28. testbench_defect_service-0.1.0/examples/jsonl/car_configurator/UserDefinedAttributes.json +8 -0
  29. testbench_defect_service-0.1.0/examples/jsonl/car_configurator/defects.jsonl +5 -0
  30. testbench_defect_service-0.1.0/pyproject.toml +141 -0
  31. testbench_defect_service-0.1.0/src/testbench_defect_service/__init__.py +8 -0
  32. testbench_defect_service-0.1.0/src/testbench_defect_service/__main__.py +8 -0
  33. testbench_defect_service-0.1.0/src/testbench_defect_service/app.py +73 -0
  34. testbench_defect_service-0.1.0/src/testbench_defect_service/cli.py +282 -0
  35. testbench_defect_service-0.1.0/src/testbench_defect_service/clients/__init__.py +13 -0
  36. testbench_defect_service-0.1.0/src/testbench_defect_service/clients/abstract_client.py +244 -0
  37. testbench_defect_service-0.1.0/src/testbench_defect_service/clients/jira/__init__.py +0 -0
  38. testbench_defect_service-0.1.0/src/testbench_defect_service/clients/jira/client.py +928 -0
  39. testbench_defect_service-0.1.0/src/testbench_defect_service/clients/jira/config.py +333 -0
  40. testbench_defect_service-0.1.0/src/testbench_defect_service/clients/jira/defect_mapping_service.py +207 -0
  41. testbench_defect_service-0.1.0/src/testbench_defect_service/clients/jira/jira_client.py +639 -0
  42. testbench_defect_service-0.1.0/src/testbench_defect_service/clients/jira/utils.py +218 -0
  43. testbench_defect_service-0.1.0/src/testbench_defect_service/clients/jsonl/__init__.py +0 -0
  44. testbench_defect_service-0.1.0/src/testbench_defect_service/clients/jsonl/client.py +500 -0
  45. testbench_defect_service-0.1.0/src/testbench_defect_service/clients/jsonl/config.py +85 -0
  46. testbench_defect_service-0.1.0/src/testbench_defect_service/clients/jsonl/utils.py +356 -0
  47. testbench_defect_service-0.1.0/src/testbench_defect_service/clients/utils.py +178 -0
  48. testbench_defect_service-0.1.0/src/testbench_defect_service/config.py +151 -0
  49. testbench_defect_service-0.1.0/src/testbench_defect_service/exceptions.py +86 -0
  50. testbench_defect_service-0.1.0/src/testbench_defect_service/log.py +294 -0
  51. testbench_defect_service-0.1.0/src/testbench_defect_service/middleware.py +166 -0
  52. testbench_defect_service-0.1.0/src/testbench_defect_service/models/__init__.py +0 -0
  53. testbench_defect_service-0.1.0/src/testbench_defect_service/models/config.py +110 -0
  54. testbench_defect_service-0.1.0/src/testbench_defect_service/models/defects.py +242 -0
  55. testbench_defect_service-0.1.0/src/testbench_defect_service/models/logging.py +21 -0
  56. testbench_defect_service-0.1.0/src/testbench_defect_service/openapi.yaml +716 -0
  57. testbench_defect_service-0.1.0/src/testbench_defect_service/routes.py +209 -0
  58. testbench_defect_service-0.1.0/src/testbench_defect_service/static/swagger-ui/favicon-16x16.png +0 -0
  59. testbench_defect_service-0.1.0/src/testbench_defect_service/static/swagger-ui/favicon-32x32.png +0 -0
  60. testbench_defect_service-0.1.0/src/testbench_defect_service/static/swagger-ui/index.css +16 -0
  61. testbench_defect_service-0.1.0/src/testbench_defect_service/static/swagger-ui/index.html +19 -0
  62. testbench_defect_service-0.1.0/src/testbench_defect_service/static/swagger-ui/swagger-initializer.js +21 -0
  63. testbench_defect_service-0.1.0/src/testbench_defect_service/static/swagger-ui/swagger-ui-bundle.min.js +17 -0
  64. testbench_defect_service-0.1.0/src/testbench_defect_service/static/swagger-ui/swagger-ui-standalone-preset.min.js +1 -0
  65. testbench_defect_service-0.1.0/src/testbench_defect_service/static/swagger-ui/swagger-ui.min.css +1 -0
  66. testbench_defect_service-0.1.0/src/testbench_defect_service/utils/__init__.py +0 -0
  67. testbench_defect_service-0.1.0/src/testbench_defect_service/utils/auth.py +120 -0
  68. testbench_defect_service-0.1.0/src/testbench_defect_service/utils/config.py +344 -0
  69. testbench_defect_service-0.1.0/src/testbench_defect_service/utils/config_wizard.py +631 -0
  70. testbench_defect_service-0.1.0/src/testbench_defect_service/utils/dependencies.py +121 -0
  71. testbench_defect_service-0.1.0/src/testbench_defect_service/utils/import_utils.py +209 -0
  72. testbench_defect_service-0.1.0/src/testbench_defect_service/utils/validation.py +42 -0
  73. testbench_defect_service-0.1.0/src/testbench_defect_service/utils/wizard.py +1148 -0
  74. testbench_defect_service-0.1.0/testbench-defect-service.spec +114 -0
  75. testbench_defect_service-0.1.0/tests/robot/resources/APIKeywords.py +272 -0
  76. testbench_defect_service-0.1.0/tests/robot/resources/Comparators.resource +46 -0
  77. testbench_defect_service-0.1.0/tests/robot/resources/Teardown.robot +14 -0
  78. testbench_defect_service-0.1.0/tests/robot/resources/__init__.py +0 -0
  79. testbench_defect_service-0.1.0/tests/robot/resources/service_setup.robot +48 -0
  80. testbench_defect_service-0.1.0/tests/robot/resources/variables.resource +5 -0
  81. testbench_defect_service-0.1.0/tests/robot/tests/generic_test/__init__.robot +5 -0
  82. testbench_defect_service-0.1.0/tests/robot/tests/generic_test/test_auth.robot +161 -0
  83. testbench_defect_service-0.1.0/tests/robot/tests/generic_test/test_routes.robot +151 -0
  84. testbench_defect_service-0.1.0/tests/robot/tests/jira_project_specific_config_test/__init__.robot +5 -0
  85. testbench_defect_service-0.1.0/tests/robot/tests/jira_project_specific_config_test/test_projects_config.robot +25 -0
  86. testbench_defect_service-0.1.0/tests/robot/tests/jira_readonly_test/__init__.robot +5 -0
  87. testbench_defect_service-0.1.0/tests/robot/tests/jira_readonly_test/test_routes.robot +58 -0
  88. testbench_defect_service-0.1.0/tests/robot/tests/jira_test/__init__.robot +5 -0
  89. testbench_defect_service-0.1.0/tests/robot/tests/jira_test/test_create_defect.robot +211 -0
  90. testbench_defect_service-0.1.0/tests/robot/tests/jira_test/test_routes.robot +294 -0
  91. testbench_defect_service-0.1.0/tests/robot/tests/jira_test/test_update_defect.robot +166 -0
  92. testbench_defect_service-0.1.0/tests/unit/README.md +137 -0
  93. testbench_defect_service-0.1.0/tests/unit/__init__.py +1 -0
  94. testbench_defect_service-0.1.0/tests/unit/clients/__init__.py +1 -0
  95. testbench_defect_service-0.1.0/tests/unit/clients/jira/__init__.py +1 -0
  96. testbench_defect_service-0.1.0/tests/unit/clients/jira/conftest.py +188 -0
  97. testbench_defect_service-0.1.0/tests/unit/clients/jira/test_client.py +1906 -0
  98. testbench_defect_service-0.1.0/tests/unit/clients/jira/test_defect_mapping_service.py +464 -0
  99. testbench_defect_service-0.1.0/tests/unit/clients/jira/test_jira_client.py +841 -0
  100. testbench_defect_service-0.1.0/tests/unit/clients/jira/test_utils.py +401 -0
  101. testbench_defect_service-0.1.0/tests/unit/clients/jsonl/__init__.py +0 -0
  102. testbench_defect_service-0.1.0/tests/unit/clients/jsonl/test_jsonl_client.py +850 -0
  103. testbench_defect_service-0.1.0/tests/unit/clients/jsonl/test_utils.py +622 -0
@@ -0,0 +1,79 @@
1
+ name: Release
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ permissions:
8
+ contents: read
9
+
10
+ jobs:
11
+ build_wheel:
12
+ runs-on: ubuntu-latest
13
+
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+
17
+ - uses: actions/setup-python@v5
18
+ with:
19
+ python-version: "3.13"
20
+ cache: "pip"
21
+
22
+ - name: Install Flit
23
+ run: pip install flit
24
+
25
+ - name: Build wheel
26
+ run: flit build --format wheel
27
+
28
+ - uses: actions/upload-artifact@v4
29
+ with:
30
+ name: wheel
31
+ path: dist/*.whl
32
+ if-no-files-found: error
33
+
34
+ build_binaries:
35
+ runs-on: ${{ matrix.os }}
36
+ strategy:
37
+ fail-fast: false
38
+ matrix:
39
+ include:
40
+ - os: windows-2022
41
+ - os: ubuntu-22.04
42
+ - os: macos-14
43
+
44
+ steps:
45
+ - uses: actions/checkout@v4
46
+
47
+ - uses: actions/setup-python@v5
48
+ with:
49
+ python-version: "3.13"
50
+ cache: "pip"
51
+
52
+ - name: Build binary
53
+ run: python build_binary.py
54
+
55
+ - uses: actions/upload-artifact@v4
56
+ with:
57
+ name: binary-${{ matrix.os }}
58
+ path: dist/*.zip
59
+ if-no-files-found: error
60
+
61
+ create_release:
62
+ needs: [build_wheel, build_binaries]
63
+ runs-on: ubuntu-latest
64
+ permissions:
65
+ contents: write
66
+
67
+ steps:
68
+ - uses: actions/download-artifact@v4
69
+ with:
70
+ path: release-assets
71
+ merge-multiple: true
72
+
73
+ - name: Upload assets to release
74
+ uses: softprops/action-gh-release@v2
75
+ with:
76
+ files: release-assets/*
77
+ fail_on_unmatched_files: true
78
+ env:
79
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,49 @@
1
+ name: Trigger Documentation Release
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ jobs:
8
+ trigger-docs:
9
+ name: Trigger ecosystem docs versioning
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - name: Derive tool metadata
13
+ id: meta
14
+ run: |
15
+ # Tool ID = repository name (must match tools.config.json in ecosystem-docs)
16
+ TOOL_ID="${{ github.event.repository.name }}"
17
+
18
+ # Version = release tag, strip leading 'v' if present
19
+ RAW_TAG="${{ github.event.release.tag_name }}"
20
+ VERSION="${RAW_TAG#v}"
21
+
22
+ echo "tool_id=${TOOL_ID}" >> $GITHUB_OUTPUT
23
+ echo "version=${VERSION}" >> $GITHUB_OUTPUT
24
+ echo "tag=${RAW_TAG}" >> $GITHUB_OUTPUT
25
+
26
+ echo "Tool: ${TOOL_ID}"
27
+ echo "Version: ${VERSION}"
28
+ echo "Tag: ${RAW_TAG}"
29
+
30
+ - name: Trigger ecosystem documentation workflow
31
+ run: |
32
+ jq -n \
33
+ --arg tool_id "${{ steps.meta.outputs.tool_id }}" \
34
+ --arg version "${{ steps.meta.outputs.version }}" \
35
+ --arg tag "${{ steps.meta.outputs.tag }}" \
36
+ --arg source_repo "${{ github.repository }}" \
37
+ '{
38
+ event_type: "tool-docs-release",
39
+ client_payload: {
40
+ tool_id: $tool_id,
41
+ version: $version,
42
+ tag: $tag,
43
+ source_repo: $source_repo
44
+ }
45
+ }' | gh api repos/${{ github.repository_owner }}/testbench-ecosystem-documentation/dispatches \
46
+ --method POST \
47
+ --input -
48
+ env:
49
+ GH_TOKEN: ${{ secrets.ECOSYSTEM_DOCS_TOKEN }}
@@ -0,0 +1,217 @@
1
+ ### Python ###
2
+ # Byte-compiled / optimized / DLL files
3
+ __pycache__/
4
+ *.py[cod]
5
+ *$py.class
6
+
7
+ # C extensions
8
+ *.so
9
+
10
+ # Distribution / packaging
11
+ .Python
12
+ build/
13
+ develop-eggs/
14
+ dist/
15
+ downloads/
16
+ eggs/
17
+ .eggs/
18
+ lib/
19
+ lib64/
20
+ parts/
21
+ sdist/
22
+ var/
23
+ wheels/
24
+ share/python-wheels/
25
+ *.egg-info/
26
+ .installed.cfg
27
+ *.egg
28
+ MANIFEST
29
+
30
+ # PyInstaller
31
+ # Usually these files are written by a python script from a template
32
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
33
+ *.manifest
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Sphinx documentation
59
+ docs/_build/
60
+
61
+ # PyBuilder
62
+ .pybuilder/
63
+ target/
64
+
65
+ # Jupyter Notebook
66
+ .ipynb_checkpoints
67
+
68
+ # IPython
69
+ profile_default/
70
+ ipython_config.py
71
+
72
+ # pyenv
73
+ # For a library or package, you might want to ignore these files since the code is
74
+ # intended to run in multiple environments; otherwise, check them in:
75
+ .python-version
76
+
77
+ # pipenv
78
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
79
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
80
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
81
+ # install all needed dependencies.
82
+ #Pipfile.lock
83
+
84
+ # poetry
85
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
86
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
87
+ # commonly ignored for libraries.
88
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
89
+ #poetry.lock
90
+
91
+ # pdm
92
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
93
+ #pdm.lock
94
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
95
+ # in version control.
96
+ # https://pdm.fming.dev/#use-with-ide
97
+ .pdm.toml
98
+
99
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
100
+ __pypackages__/
101
+
102
+ # Environments
103
+ .env
104
+ .venv
105
+ env/
106
+ venv/
107
+ ENV/
108
+ env.bak/
109
+ venv.bak/
110
+
111
+ # Spyder project settings
112
+ .spyderproject
113
+ .spyproject
114
+
115
+ # Rope project settings
116
+ .ropeproject
117
+
118
+ # mkdocs documentation
119
+ /site
120
+
121
+ # mypy
122
+ .mypy_cache/
123
+ .dmypy.json
124
+ dmypy.json
125
+
126
+ # Pyre type checker
127
+ .pyre/
128
+
129
+ # pytype static type analyzer
130
+ .pytype/
131
+
132
+ # Cython debug symbols
133
+ cython_debug/
134
+
135
+ # PyCharm
136
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
137
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
138
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
139
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
140
+ #.idea/
141
+
142
+ ### Python Patch ###
143
+ # Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration
144
+ poetry.toml
145
+
146
+ # ruff
147
+ .ruff_cache/
148
+
149
+ # LSP config files
150
+ pyrightconfig.json
151
+
152
+ # pyenv version file
153
+ .python-version
154
+
155
+ # Temporary directories and files
156
+ temp/
157
+ tmp*/
158
+ *.tmp
159
+
160
+ # Backup files
161
+ *backup*
162
+ *.backup
163
+
164
+ # Application log files
165
+ *.log
166
+ *.log.*
167
+ *.log.lck
168
+
169
+ # Test result artifacts
170
+ results/
171
+ logs/
172
+
173
+ # TLS certificates and keys
174
+ certs/
175
+ *.pem
176
+ *.key
177
+ *.crt
178
+ *.p12
179
+ *.pfx
180
+ *.p8
181
+
182
+ # Configuration files with sensitive data
183
+ # Block all config files by default to prevent accidental commits of credentials
184
+ config.py
185
+ *.toml
186
+ *.properties
187
+
188
+ # Allow project configuration files
189
+ !pyproject.toml
190
+
191
+ # Allow example configs
192
+ !examples/config.py
193
+ !examples/*.toml
194
+ !examples/*.properties
195
+
196
+ # Allow config files in tests
197
+ !tests/**/config.py
198
+ !tests/**/*.toml
199
+ !tests/**/*.properties
200
+
201
+ # Allow internal config.py files (not user configs)
202
+ !src/testbench_defect_service/**/config.py
203
+ !src/testbench_defect_service/clients/**/config.py
204
+
205
+ # Environment files (contain Jira credentials, etc.)
206
+ .env
207
+ .env.*
208
+ !.env.example
209
+
210
+ # VS Code settings
211
+ .vscode/
212
+
213
+ # Robot Framework results
214
+ results/
215
+
216
+ # Defect files
217
+ defects/
@@ -0,0 +1,49 @@
1
+ repos:
2
+ # mypy linter for Python files
3
+ - repo: local
4
+ hooks:
5
+ - id: mypy
6
+ name: mypy
7
+ description: 'Run mypy for static type checking'
8
+ entry: mypy
9
+ language: python
10
+ types_or: [python, pyi]
11
+ require_serial: true
12
+
13
+ # Ruff linter for Python files
14
+ - repo: local
15
+ hooks:
16
+ - id: ruff-format
17
+ name: ruff-format
18
+ description: "Run 'ruff format' for extremely fast Python formatting"
19
+ entry: ruff format --force-exclude
20
+ language: python
21
+ types_or: [python, pyi, jupyter]
22
+ require_serial: true
23
+
24
+ - id: ruff
25
+ name: ruff
26
+ description: "Run 'ruff' for extremely fast Python linting"
27
+ entry: ruff check --force-exclude
28
+ language: python
29
+ types_or: [python, pyi, jupyter]
30
+ require_serial: true
31
+
32
+ # Robocop for linting and formatting
33
+ - repo: local
34
+ hooks:
35
+ - id: robocop
36
+ name: robocop
37
+ description: "Robot Framework linter"
38
+ entry: robocop check --force-exclude
39
+ language: python
40
+ files: '.*\.(robot|resource)$'
41
+ minimum_pre_commit_version: "2.9.2"
42
+
43
+ - id: robocop-format
44
+ name: robocop-format
45
+ description: "Robot Framework formatter"
46
+ entry: robocop format --force-exclude
47
+ language: python
48
+ files: '.*\.(robot|resource)$'
49
+ minimum_pre_commit_version: "2.9.2"
@@ -0,0 +1,24 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ---
9
+
10
+ ## [0.1.0] - 2026-04-20
11
+
12
+ ### Added
13
+
14
+ - Initial release of TestBench Defect Service.
15
+ - REST API for managing defects backed by Jira or JSONL (file-based) clients.
16
+ - Interactive configuration wizard (`testbench-defect-service init`).
17
+ - HTTP Basic Authentication for API access.
18
+ - OpenAPI / Swagger UI documentation served at `/docs`.
19
+ - Pre/post sync command hooks.
20
+ - Support for multiple projects from a single service instance.
21
+ - CLI entry point (`testbench-defect-service`) with `init`, `start`, and `set-credentials` commands.
22
+ - `jira` optional dependency group for Jira backend support.
23
+
24
+ [0.1.0]: https://github.com/imbus/testbench-defect-service/releases/tag/v0.1.0
@@ -0,0 +1,112 @@
1
+ # Contributing
2
+
3
+ Thank you for considering contributing to TestBench Defect Service! We appreciate your help in making this project even better. Please take a moment to read through this guide to understand how you can contribute effectively.
4
+
5
+ ## Development Setup
6
+
7
+ To get started with development, follow these steps to clone the repository and set up your environment.
8
+
9
+ **1. Fork the repository**
10
+
11
+ Start by forking the repository to your own account.
12
+
13
+ **2. Clone your forked repository**
14
+
15
+ After forking, clone your forked version of the repository to your local machine.
16
+
17
+ **3. Set up the virtual environment**
18
+
19
+ We provide a script to automatically set up the virtual environment and install all the necessary dependencies.
20
+
21
+ Run the following command from the project’s root directory:
22
+
23
+ ```bash
24
+ python bootstrap.py
25
+ ```
26
+
27
+ The script `bootstrap.py` creates a virtual environment and installs both development and test dependencies.
28
+
29
+ **4. Activate the virtual environment**
30
+
31
+ Once the setup is complete, activate the virtual environment:
32
+ - on macOS/Linux:
33
+ ```bash
34
+ source .venv/bin/activate
35
+ ```
36
+ - on Windows:
37
+ ```powershell
38
+ .venv\Scripts\activate
39
+ ```
40
+
41
+ ## Running Tests
42
+
43
+ If you want to contribute code, it's important to ensure that everything works correctly. You can run the tests to make sure the code passes all the required checks.
44
+
45
+ **Run the unit tests (pytest):**
46
+ ```bash
47
+ pytest tests/unit
48
+ ```
49
+
50
+ **Run the Robot Framework Tests**
51
+
52
+ To run the tests, simply execute the following from the project’s root directory:
53
+
54
+ ```bash
55
+ robot tests/robot/
56
+ ```
57
+
58
+ This will automatically discover and run all robot tests in the project.
59
+
60
+ ## Code Style & Linting
61
+
62
+ This project uses [Ruff](https://docs.astral.sh/ruff/) for linting and formatting, and [mypy](https://mypy-lang.org/) for static type checking.
63
+
64
+ **Check linting:**
65
+ ```bash
66
+ ruff check src/
67
+ ```
68
+
69
+ **Check types:**
70
+ ```bash
71
+ mypy src/
72
+ ```
73
+
74
+ **Pre-commit hooks** (run automatically on each commit after setup):
75
+ ```bash
76
+ pre-commit install
77
+ ```
78
+
79
+ Please ensure `ruff` and `mypy` pass with no errors before opening a pull request.
80
+
81
+ ## Branching & Pull Requests
82
+
83
+ 1. **Create a branch** from `main` with a descriptive name:
84
+ - `feature/<short-description>` for new features
85
+ - `fix/<short-description>` for bug fixes
86
+ - `docs/<short-description>` for documentation changes
87
+
88
+ 2. **Commit** your changes with clear, concise commit messages.
89
+
90
+ 3. **Push** your branch and open a pull request against `main`.
91
+
92
+ 4. Fill in the pull request description, referencing any related issues (e.g. `Closes #42`).
93
+
94
+ 5. Ensure all CI checks pass before requesting a review.
95
+
96
+ ## Reporting Bugs
97
+
98
+ Please open a [GitHub Issue](https://github.com/imbus/testbench-defect-service/issues) and include:
99
+
100
+ - **Version** — output of `testbench-defect-service --version`
101
+ - **Python version** — output of `python --version`
102
+ - **Operating system**
103
+ - **Steps to reproduce** the problem (for bugs)
104
+ - **Expected vs actual behavior**
105
+
106
+ ## Requesting Features
107
+
108
+ Open a [GitHub Issue](https://github.com/imbus/testbench-defect-service/issues) and describe:
109
+
110
+ - The use case you are trying to solve.
111
+ - How you imagine the feature working.
112
+ - Any alternatives you have considered.