Separate internal tests from API tests and add integration/e2e tests#1028
Draft
Separate internal tests from API tests and add integration/e2e tests#1028
Conversation
You're out of free credits.You can fix that by putting in a card here. |
Co-authored-by: mateimicu <4560298+mateimicu@users.noreply.github.com>
Co-authored-by: mateimicu <4560298+mateimicu@users.noreply.github.com>
Co-authored-by: mateimicu <4560298+mateimicu@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Separate internal tests from API tests and add integration tests
Separate internal tests from API tests and add integration/e2e tests
Oct 14, 2025
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.
This PR addresses the test organization issues raised in #XX by separating internal unit tests from API tests and adding comprehensive integration tests to prevent regressions like the kubeconfig persistence bug (#28).
Changes Made
Test Separation
Previously, all tests were mixed together in the
cmd/package, making it difficult to distinguish between testing internal implementation details versus the public CLI API. This has been reorganized:cmd/,internal/aws/,internal/kubeconfig/) and focus on testing internal functions and implementation detailstest/api/package and focus on testing the complete CLI interface behavior including command execution, logging, and help functionalitytest/integration/package for end-to-end testingIntegration/E2E Tests Added
The new integration tests provide comprehensive coverage of the CLI functionality:
These tests run the actual
kdiscoverbinary and verify:Benefits
Testing
All test suites pass:
go test ./cmd/... ./internal/...go test ./test/api/...go test ./test/integration/...The integration tests are designed to work without real AWS credentials by testing the application's behavior when credentials are unavailable, ensuring they can run in any CI environment.
Original prompt
Fixes #36
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.