feat(test): add integration tests, remove bats#199
Merged
Conversation
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>
Contributor
|
Thank you for contributing to this project! 😊🕹️ |
Codecov Report✅ All modified and coverable lines are covered by tests. @@ 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.
🚀 New features to boost your workflow:
|
a567003 to
a67d6c8
Compare
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>
a67d6c8 to
cbd17c3
Compare
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>
a366fda to
11f6a43
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
test/integration/) that builds a realosapibinary, 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)*_integration_test.goHTTP wiring tests into*_public_test.goasTestXxxHTTP/TestXxxRBACHTTPmethods — eliminates a separate file per endpointtest/libs/, and all related justfile/CI/doc referencesinternal/api/gen/api.yamlviaredocly joinjust go::unit-intrecipe (via shared osapi-io-justfiles) for running integration testsgo-int.ymlCI workflow for integration testsTest plan
go build ./...compilesgo test ./...— 25 packages passjust go::unit-int— 7 suites pass against live server🤖 Generated with Claude Code