Skip to content

Add pytest test suite with coverage and CI workflow#28

Merged
TheRealAgentK merged 17 commits intomasterfrom
feature/test-setup
Apr 10, 2026
Merged

Add pytest test suite with coverage and CI workflow#28
TheRealAgentK merged 17 commits intomasterfrom
feature/test-setup

Conversation

@TheRealAgentK
Copy link
Copy Markdown
Collaborator

@TheRealAgentK TheRealAgentK commented Apr 9, 2026

Summary

Adds a comprehensive pytest-based test suite (72 tests, 99% coverage) and GitHub Actions CI workflow.

Test suite

  • tests/test_results.py (14 tests) — dataclasses (ActionResult, ActionError, ConnectedAccountInfo, IntegrationResult, FetchResponse), exceptions, and enums
  • tests/test_integration.py (36 tests) — config loading, handler registration, action/trigger/connected-account execution, auth validation, interval parsing, edge cases
  • tests/test_execution_context.py (22 tests) — HTTP methods, error handling, auth injection, query params, retries, form encoding, timeouts, JSON parse fallback, context manager lifecycle

CI/CD

  • GitHub Actions workflow (.github/workflows/tests.yml) runs on push to master and PRs
  • Coverage report via pytest-cov with MishaKav/pytest-coverage-comment posting results to PRs
  • set -o pipefail ensures test failures correctly fail the CI step

Documentation

  • AGENTS.md — testing guidelines for AI agents
  • README.md — testing section for developers
  • RELEASING.md — run tests before building/uploading

Dependencies

Added [project.optional-dependencies] test with pytest, pytest-asyncio, aioresponses, pytest-cov

Coverage

The only 3 uncovered lines are abstract pass bodies in ActionHandler, PollingTriggerHandler, and ConnectedAccountHandler — untestable by design.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

Coverage

Coverage Report
FileStmtsMissCoverMissing
src/autohive_integrations_sdk
   __init__.py20100% 
   integration.py358399%308, 315, 347
TOTAL360399% 

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ea75516b56

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread .github/workflows/tests.yml
Comment thread .github/workflows/tests.yml
@github-actions
Copy link
Copy Markdown

Coverage

Coverage Report
FileStmtsMissCoverMissing
src/autohive_integrations_sdk
   __init__.py20100% 
   integration.py358399%308, 315, 347
TOTAL360399% 

@github-actions
Copy link
Copy Markdown

Coverage

Coverage Report
FileStmtsMissCoverMissing
src/autohive_integrations_sdk
   __init__.py20100% 
   integration.py358399%308, 315, 347
TOTAL360399% 

@github-actions
Copy link
Copy Markdown

Coverage

Coverage Report
FileStmtsMissCoverMissing
src/autohive_integrations_sdk
   __init__.py20100% 
   integration.py358399%308, 315, 347
TOTAL360399% 

@github-actions
Copy link
Copy Markdown

Coverage

Coverage — feb2b86 Merge 856511d into a32afe8
FileStmtsMissCoverMissing
src/autohive_integrations_sdk
   __init__.py20100% 
   integration.py358399%308, 315, 347
TOTAL360399% 

@github-actions
Copy link
Copy Markdown

Coverage

Coverage — b8e37b7 Merge 773c888 into a32afe8
FileStmtsMissCoverMissing
src/autohive_integrations_sdk
   __init__.py20100% 
   integration.py358399%308, 315, 347
TOTAL360399% 

@github-actions
Copy link
Copy Markdown

Coverage

Coverage — 16aea07
FileStmtsMissCoverMissing
src/autohive_integrations_sdk
   __init__.py20100% 
   integration.py358399%308, 315, 347
TOTAL360399% 

@github-actions
Copy link
Copy Markdown

Coverage

Coverage — 1061a3a (Show commit message and author in coverage report title) by @kai Koenig
FileStmtsMissCoverMissing
src/autohive_integrations_sdk
   __init__.py20100% 
   integration.py358399%308, 315, 347
TOTAL360399% 

@github-actions
Copy link
Copy Markdown

Coverage

Coverage — 6dc609d (Use GitHub username for coverage title and always show coverage table) by @TheRealAgentK
FileStmtsMissCoverMissing
src/autohive_integrations_sdk
   __init__.py20100% 
   integration.py358399%308, 315, 347
TOTAL360399% 

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 10, 2026

Coverage — 05d9044 (Link commit SHA and missing line numbers in coverage comment) by @TheRealAgentK

Total coverage: 3

File Stmts Miss Cover Missing
src/autohive_integrations_sdk/__init__.py 2 0 100%
src/autohive_integrations_sdk/integration.py 358 3 99% 308, 315, 347

@TheRealAgentK
Copy link
Copy Markdown
Collaborator Author

Thx @ProRedCat - added a few more tweaks around the coverage output, but that doesn't make a material difference to the core of the changes. Merged.

@TheRealAgentK TheRealAgentK merged commit 0a3fdde into master Apr 10, 2026
1 check passed
@TheRealAgentK TheRealAgentK deleted the feature/test-setup branch April 10, 2026 01:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants