-
Notifications
You must be signed in to change notification settings - Fork 7
test(CLI): add test harness #1041
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces a Ruby/RSpec-based integration test harness for the CLI, enabling mocked HTTP responses and request assertions. The implementation uses a Rack-based mock server that runs alongside the CLI binary during test execution.
Changes:
- Added a Rack-based mock server with control endpoints for setting responses and inspecting captured requests
- Created helper modules and RSpec configuration for managing the mock server lifecycle
- Implemented a basic integration test demonstrating authenticated API requests
- Updated CI workflow to run integration tests alongside existing unit tests
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| clients/cli/spec/support/mock_server.ru | Rack application providing mock HTTP server with control API for test setup and request recording |
| clients/cli/spec/support/mock_control.rb | Ruby module providing helper methods to interact with mock server control endpoints |
| clients/cli/spec/spec_helper.rb | RSpec configuration managing mock server lifecycle and CLI execution helpers |
| clients/cli/spec/cli_spec.rb | Integration test verifying CLI can authenticate and make API requests |
| clients/cli/Gemfile | Dependencies for the test harness (rspec, rack, rackup, webrick) |
| .github/workflows/test-cli.yml | CI workflow updates to run integration tests with Ruby setup |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
BlumMichael
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
.github/workflows/test-cli.yml
Outdated
| go build . | ||
| go test -v ./... | ||
| - name: Install Ruby and rspec | ||
| uses: ruby/setup-ruby@v1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one should be locked to a commit
theSoenke
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙌
Adds a simple ruby/rspec/rack based test harness for CLI integration tests.
So far, contains only a basic test, but provides a way to mock API responses and assert requests performed by the CLI app.