Skip to content

feat(test): add integration tests, remove bats#199

Merged
retr0h merged 4 commits intomainfrom
feat/integration-tests
Feb 28, 2026
Merged

feat(test): add integration tests, remove bats#199
retr0h merged 4 commits intomainfrom
feat/integration-tests

Conversation

@retr0h
Copy link
Collaborator

@retr0h retr0h commented Feb 28, 2026

Summary

  • Add Go integration test suite (test/integration/) that builds a real osapi binary, starts all three components (NATS, API, agent) on random ports, and exercises CLI commands end-to-end across 7 domains (health, node, agent, job, audit, network, command)
  • Merge all 22 *_integration_test.go HTTP wiring tests into *_public_test.go as TestXxxHTTP/TestXxxRBACHTTP methods — eliminates a separate file per endpoint
  • Remove bats test framework, fixtures, test/libs/, and all related justfile/CI/doc references
  • Generate combined OpenAPI spec at internal/api/gen/api.yaml via redocly join
  • Add just go::unit-int recipe (via shared osapi-io-justfiles) for running integration tests
  • Add separate go-int.yml CI workflow for integration tests

Test plan

  • go build ./... compiles
  • go test ./... — 25 packages pass
  • just go::unit-int — 7 suites pass against live server
  • CI passes (unit + integration workflows)

🤖 Generated with Claude Code

Add Go integration test suite that builds a real osapi binary, starts
all three components (NATS, API, agent) on random ports, and exercises
CLI commands end-to-end. Tests cover health, node, agent, job, audit,
network, and command domains.

Merge all *_integration_test.go HTTP wiring tests into *_public_test.go
as TestXxxHTTP/TestXxxRBACHTTP methods. Remove bats test framework,
fixtures, and related tooling. Generate combined OpenAPI spec at
internal/api/gen/api.yaml via redocly join.

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions
Copy link
Contributor

Thank you for contributing to this project! 😊🕹️

@codecov
Copy link

codecov bot commented Feb 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #199   +/-   ##
=======================================
  Coverage   99.94%   99.94%           
=======================================
  Files         136      136           
  Lines        5035     5035           
=======================================
  Hits         5032     5032           
  Misses          2        2           
  Partials        1        1           

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 60df2ce...11f6a43. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@retr0h retr0h force-pushed the feat/integration-tests branch from a567003 to a67d6c8 Compare February 28, 2026 21:47
Add separate integration.yml workflow that runs just go::unit-int
to exercise CLI commands end-to-end against a real osapi binary.
Runs in parallel with the unit test workflow.

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
@retr0h retr0h force-pushed the feat/integration-tests branch from a67d6c8 to cbd17c3 Compare February 28, 2026 21:48
retr0h and others added 2 commits February 28, 2026 13:55
Add sysctl for unprivileged ping in CI workflow. Skip DNS update
test in CI since resolvectl requires polkit authentication.

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Add missing tests for audit get, metrics, job add, and job
run. Every CLI command now has an integration test. Write
operations (job add/run/delete/retry, dns update) are guarded
behind OSAPI_INTEGRATION_WRITES=1; all other tests including
command exec/shell run by default.

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
@retr0h retr0h force-pushed the feat/integration-tests branch from a366fda to 11f6a43 Compare February 28, 2026 22:26
@retr0h retr0h merged commit e49b43d into main Feb 28, 2026
7 checks passed
@retr0h retr0h deleted the feat/integration-tests branch February 28, 2026 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant