Skip to content

Conversation

@Link-
Copy link
Owner

@Link- Link- commented Sep 4, 2025

This pull request introduces improvements to the project's developer experience by enhancing the testing workflow, and updating dependencies for better unit testing support. The most significant changes include the separation of unit and integration tests in CI, new Makefile targets for running tests, and updated dependencies for mocking and assertions.

Documentation improvements:

  • Added a detailed .github/copilot-instructions.md file outlining project structure, coding standards, unit testing guidelines, and git operation instructions.

Testing infrastructure enhancements:

  • Updated the Makefile to include a test target for running all unit tests and marked it as a phony target. [1] [2] [3]
  • Modified the GitHub Actions workflow in .github/workflows/test.yml to distinguish between "Unit Tests" and "Integration Tests," running unit tests on all events and integration tests only on pushes to main or manual dispatches. [1] [2]

Dependency management:

  • Added several indirect dependencies to go.mod relevant for testing, including github.com/stretchr/testify, github.com/jarcoal/httpmock, and others.

- Add comprehensive tabular unit tests for generate.go functionality
- Implement HTTP mocking using github.com/jarcoal/httpmock
- Create test fixtures including RSA private key for JWT testing
- Add test target to Makefile for running all unit tests
- Update go.mod and go.sum with required testing dependencies
- Achieve 95.9% code coverage on Generate function
- Cover all success and error scenarios including edge cases
- Add new 'test' job that runs unit tests on all events
- Modify integration job to only run on push to main or workflow_dispatch
- Integration tests no longer run on pull requests
- Add revoke_test.go with tabular tests covering all revoke functionality
- Add installations_test.go with comprehensive test coverage
- Test successful token revocation with various hostname formats
- Test error handling for HTTP status codes (401, 403, 404, 500, etc.)
- Test network errors and edge cases
- Mock HTTP requests using httpmock library
- Follow existing test patterns from generate_test.go
- All tests pass with full coverage of implemented features
@Link- Link- merged commit 96b0406 into main Sep 4, 2025
5 checks passed
@Link- Link- deleted the Link-/add-tests branch September 4, 2025 10:43
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