Skip to content

Commit 21c96bb

Browse files
docs(skills): clarify version bump scope and add conftest.py to test structure (#39)
- upgrading-sdk-v2: clarify that config.json version bump to 2.0.0 only applies to existing integrations being upgraded, not new integrations written directly against SDK 2.0.0 - writing-unit-tests: add conftest.py to file structure examples and document its standard content (sys.path setup)
1 parent 5d70b30 commit 21c96bb

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

skills/upgrading-sdk-v2/SKILL.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ Increment the **major** version since the SDK dependency is a breaking change:
130130

131131
If the integration was already at a higher version (e.g. `1.1.0`), bump to `2.0.0`.
132132

133+
> **This step only applies to existing integrations being upgraded.** A brand-new integration written directly against SDK 2.0.0 should start at `"version": "1.0.0"` — the integration's own version reflects its release history, not the SDK version.
134+
133135
### Step 5 — Update unit tests (if they exist)
134136

135137
**A. Wrap fetch mocks in FetchResponse:**
@@ -256,7 +258,7 @@ Before considering an integration upgraded, verify:
256258
- [ ] `ActionError` is imported from the SDK
257259
- [ ] `"error"` and error-only `"result"` properties removed from output schemas in `config.json`
258260
- [ ] `requirements.txt` pins `autohive-integrations-sdk~=2.0.0`
259-
- [ ] `config.json` version is bumped to `2.0.0`
261+
- [ ] `config.json` version is bumped to `2.0.0` (upgrades only — new integrations stay at `1.0.0`)
260262
- [ ] Unit test mocks wrap return values in `FetchResponse(...)`
261263
- [ ] Unit test error assertions use `result.type == ResultType.ACTION_ERROR` and `result.result.message`
262264
- [ ] `pytest.raises(ValidationError)` replaced with `result.type == ResultType.VALIDATION_ERROR`

skills/writing-unit-tests/SKILL.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ For small integrations (1–10 actions), a single file is fine:
2121
```
2222
myintegration/tests/
2323
├── __init__.py
24+
├── conftest.py
2425
└── test_myintegration_unit.py
2526
```
2627

@@ -29,6 +30,7 @@ For large integrations (10+ actions), split by domain:
2930
```
3031
hubspot/tests/
3132
├── __init__.py
33+
├── conftest.py
3234
├── test_hubspot_helpers_unit.py
3335
├── test_hubspot_contacts_unit.py
3436
├── test_hubspot_companies_unit.py
@@ -38,6 +40,18 @@ hubspot/tests/
3840
└── test_hubspot_misc_unit.py
3941
```
4042

43+
### conftest.py
44+
45+
Every `tests/` directory should include a `conftest.py` with this standard content:
46+
47+
```python
48+
import sys
49+
import os
50+
51+
# Allow 'from context import ...' to work when pytest runs from repo root
52+
sys.path.insert(0, os.path.dirname(__file__))
53+
```
54+
4155
The `_unit.py` suffix is required — CI uses it to discover unit tests.
4256

4357
### File Header (boilerplate)

0 commit comments

Comments
 (0)