Add OpenSpec framework for unit test enhancement#159
Open
vishnuajayccst wants to merge 3 commits into
Open
Conversation
- Added requirements for existing DAO tests to utilize CleanupTracker for cleanup operations. - Refactored existing DAO tests in `dao_test.go` and `cached_simple_dao_test.go` to remove truncateTable calls and implement CleanupTracker. - Introduced TEST_MODE environment variable to toggle between mock and real database executions. - Created comprehensive test coverage for shared packages including estbfirmware, logupload, firmware, dcm, and rfc. - Implemented Makefile targets for simplified test execution and coverage reporting. - Added scripts for verifying test idempotency and coverage. - Documented tasks for refactoring and adding missing tests across various packages. - Established a configuration file for project context and artifact rules.
- Replace TEST_MODE environment variable with USE_MOCK_DB for better clarity in test execution modes. - Implement TestableDAO interfaces and mock DAO structures to facilitate dependency injection in tests. - Introduce CleanupTracker for managing test data cleanup, ensuring only test-inserted data is removed. - Refactor existing tests to support both mock and real database modes, enhancing test isolation and reliability. - Update Makefile targets to reflect new USE_MOCK_DB variable and ensure backward compatibility. - Improve documentation and examples for the new testing patterns and CleanupTracker usage. - Ensure all tests are idempotent and can run in any order without interference. - Add comprehensive coverage verification for both mock and real database modes.
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.
OpenSpec Core Documents:
OpenSpec Workflow (.github):
Key findings: