integration-testing
Skill8 starsChanged 8 months agoMITView on GitHub
Use when setting up, running, or debugging integration tests against real OmniFocus. Also use when unit tests pass but behavior seems wrong, when adding new AppleScript operations, or when you need to understand why mocked tests are insufficient for this project. Covers the test database system, fixture setup, and the specific class of bugs that only integration tests catch.
12 other projects use a version of this.
Adopted by
Most recently taken up by
- lengrufeng2008/dsh-skill-librarytheir own version, first seen Nov 15, 2026
- Wade-DevCode/awesome-coding-skills-cntheir own version, first seen Nov 8, 2026
- DevelopersGlobal/ai-agent-skillstheir own version, first seen Oct 25, 2026
- Ronnasayd/aipptheir own version, first seen Oct 20, 2026
- mejbaurbahar/software-tester-skillstheir own version, first seen Oct 13, 2026
- zyggy-org/zyggytheir own version, first seen Oct 13, 2026
Used with
Projects with it also use error-handling.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
MicrosoftSkillerror-handling
统一错误处理系统。在添加 API 端点、修改错误处理、添加前端 API 调用、编写错误相关测试时使用。
Also in 3 projects that use this
Other versions12 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 12
- DevelopersGlobal/ai-agent-skills★ 216same name
- kid-sid/claude-spellbook★ 190same name
- s-morgan-jeffries/apple-mail-mcp★ 104same name
- s-morgan-jeffries/apple-mail-fast-mcp★ 103same name
- elastic/integration-skills★ 16same name
- Wade-DevCode/awesome-coding-skills-cn★ 7same name
- zyggy-org/zyggy★ 2same name
- caseyng/Claude-skills★ 1same name
- mejbaurbahar/software-tester-skills★ 1same name
- Ronnasayd/aipp★ 1same name
2 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository5 other files it gives its agents.
- .claude/CLAUDE.mdCLAUDE.md
- api-designSkill
- applescript-omnifocusSkill
- performance-patternsSkill
- releaseSkill
The file
We split this skill into the rules it gives an agent
8 rules. 0 are common, 5 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 9 edited versions we read keep these.
5
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 70
Test database must be active (check with ./scripts/local/switch_to_test_db.sh)
- Distinctive: line 71
Test fixtures must be loaded
- Distinctive: line 118
Always clean up created data (delete tasks/projects you create)
- Very specific: line 119
Use @pytest.mark.integration to allow selective running
- Distinctive: line 120
Test against known fixture data when possible
- Distinctive: line 121
Verify both the happy path and error cases (e.g., invalid IDs)
- Distinctive: line 139
Every CRUD connector method should have a minimal integration test:
- Very specific: line 146
Use try/finally for cleanup.
“Common” is measured: kept by at least 6 in 10 of the 9 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
OmniFocus Integration Testing
Unit tests in this project mock AppleScript execution. This is fast but dangerous — mocked tests cannot catch AppleScript-level bugs. Integration tests run against a real OmniFocus instance and have caught critical bugs that unit tests missed.
Why Integration Tests Matter Here
The elifintervalDays story: A variable naming typo in AppleScript went undetected by 400+ unit tests because they mocked run_applescript(). The AppleScript was syntactically valid Python-side, but at runtime, AppleScript interpreted elifintervalDays as something unexpected. Only integration tests against real OmniFocus caught it.
Classes of bugs only integration tests catch:
- Variable naming conflicts with OmniFocus properties (see applescript-omnifocus skill)
- AppleScript syntax that's valid but produces wrong results
- OmniFocus version-specific behavior changes
- Timing issues with AppleScript execution
- Rich text handling inconsistencies
- Recurring task completion behavior differences
Test Database Setup
Integration tests use a separate OmniFocus database to prevent production data corruption.
Initial Setup
# Create test database in OmniFocus
# File > New Database > name it "OmniFocus-TEST"
# Set environment variables
export OMNIFOCUS_TEST_MODE=true
export OMNIFOCUS_TEST_DATABASE=OmniFocus-TEST.ofocus
# Generate test fixtures
./scripts/setup_test_database.shSwitching Databases
# Switch to test database (sets env vars, switches OmniFocus)
./scripts/local/switch_to_test_db.sh
# Switch back to production
./scripts/local/switch_to_prod_db.shCleaning Up
# Remove test data (keeps database)
./scripts/cleanup_test_data.shRunning Integration Tests
# All integration tests
make test-integration
# Specific test file
pytest tests/test_integration_real.py -v
# E2E tests (full MCP stack)
make test-e2e
pytest tests/test_e2e_real.py -vPrerequisites:
- OmniFocus must be running
- Test database must be active (check with
./scripts/local/switch_to_test_db.sh) - Test fixtures must be loaded
Three-Tier Testing Strategy
| Tier | Speed | What it catches | When to run |
| Unit (mocked) | ~2min, 544 tests | Python logic errors, parameter validation, response formatting | Every change (make test) |
| Integration (real OF) | ~30s | AppleScript bugs, OmniFocus API quirks, variable naming conflicts | New AppleScript code, before merge |
| E2E (full MCP) | ~30s | MCP tool registration, parameter passing, end-to-end flow | New/modified tools, before release |
Test Fixtures
The project uses TaskPaper-format fixtures for consistent test data. Test fixtures are defined in scripts and imported into OmniFocus via AppleScript.
Key fixture scripts:
scripts/setup_test_database.sh— Basic fixtures (projects, tasks, tags)
Fixture design principles:
- Fixtures create known-state data that tests can assert against
- Each test file documents which fixtures it depends on
- Fixtures are idempotent — running setup twice doesn't create duplicates
Writing Integration Tests
import pytest
# Mark as integration test (skipped unless test DB is active)
@pytest.mark.integration
def test_create_and_retrieve_task():
"""Integration test against real OmniFocus."""
client = OmniFocusConnector(enable_safety_checks=True)
# Create
task_id = client.create_task(name="Integration Test Task", project_name="Test Project")
assert task_id is not None
# Retrieve and verify
tasks = client.get_tasks(task_id=task_id)
assert len(tasks) == 1
assert tasks[0]["name"] == "Integration Test Task"
# Cleanup
client.delete_tasks(task_id)Key patterns:
- Always clean up created data (delete tasks/projects you create)
- Use
@pytest.mark.integrationto allow selective running - Test against known fixture data when possible
- Verify both the happy path and error cases (e.g., invalid IDs)
When to Write Integration Tests
Always write integration tests when:
- Adding or modifying AppleScript code
- Changing how data is serialized/deserialized from OmniFocus
- Adding new filter parameters to get_tasks() or get_projects()
- Modifying recurring task handling
- Changing date conversion logic
Unit tests are sufficient when:
- Changing Python-only logic (formatting, validation)
- Modifying server-level parameter handling
- Updating response formatting in server_fastmcp.py
Smoke Test Pattern for CRUD Operations
Every CRUD connector method should have a minimal integration test:
- Create — make a test entity, verify it gets an ID back
- Read — fetch it, verify the fields match what was created
- Update — change a field, re-fetch, verify the change took
- Delete — delete it, verify it's gone
Use try/finally for cleanup. Prefix test data with test- or Test .
tag_id = None
try:
tag_id = client.create_tag(f"test-integ-{uuid.uuid4()}")
assert tag_id # Create returns ID
tags = client.get_tags()
assert any(t['id'] == tag_id for t in tags) # Read confirms
finally:
if tag_id:
try:
client.delete_tags(tag_id)
except Exception as e:
warnings.warn(f"Cleanup failed: {e}")Detailed Setup Guide
For complete setup instructions including troubleshooting, see docs/guides/INTEGRATION_TESTING.md.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

