Implement comprehensive testing suite and optimize CI workflows - #19
Closed
marcomoi395 wants to merge 18 commits into
Closed
Implement comprehensive testing suite and optimize CI workflows#19marcomoi395 wants to merge 18 commits into
marcomoi395 wants to merge 18 commits into
Conversation
- Add Vitest testing infrastructure (vitest.config.ts, test/setup.ts) - Write unit and integration tests across 4 phases (Core, Services, Handlers, Renderer) - Migrate notion-sync tests from node:test to vitest - Fix minor bugs in validators.ts and pexels.ts discovered during testing - Add ignore branches for defensively unreachable code - Achieve overall coverage above 95% threshold across Statements, Branches, Functions, and Lines
- Remove auto-release feature (release-please workflow) - Add comprehensive CI workflow with quality gates: - Lockfile registry validation (PR only) - Dependency vulnerability review (PR only) - Lint, typecheck, unit tests, E2E tests - SHA-pinned actions with explicit permissions - Add tag-triggered build-and-release workflow: - Creates draft releases on v* tags - Builds Linux (AppImage, deb) and Windows (NSIS) packages - Uploads assets to GitHub releases - Update release-smoke workflow: - Inline matrix builds for manual testing - Remove dependency on deleted reusable workflow - Apply security standards (SHA pinning, timeouts) - Delete obsolete workflows: - release-please.yml - build-release.yml - reusable-build-assets.yml - e2e-tests.yml (integrated into ci.yml) - Update architecture documentation
- Add coverage/ to ignores (generated test coverage) - Add e2e/ to ignores (E2E tests not in tsconfig) - Add playwright.config.ts to ignores Fixes lint job failures in CI workflow.
Success feedback is now provided by button state, not alert.
Test was expecting alert('Saved!') but implementation was changed
to only show alerts on error, not success.
- Add test/ and vitest.config.ts to eslint ignores - Fix unnecessary escape character in sanitize-filename regex - Add eslint-disable for intentional empty function in test - Fix typecheck error: use null instead of undefined for mock All CI checks now pass: lint (warnings only), typecheck, tests.
Project uses npm with package-lock.json as the source of truth. yarn.lock was outdated and causing false security warnings in CI.
- Add format job running 'prettier --check .' - Format check runs in parallel with lint and typecheck - Unit tests depend on format check passing Ensures code formatting is consistent before merge.
Remove audio_word property from FlashcardResponse mock objects that were causing TypeScript type errors in CI. The property is optional in the interface but was causing type mismatches in test mocks.
- Format all files with tabWidth: 4 per .prettierrc.yaml - Consistent indentation across workflows, tests, and source files - No functional changes, formatting only
Add *.md to .prettierignore to skip formatting markdown files. Fixes CI prettier check failures on CHANGELOG.md.
Root cause: Mock server not properly cleaned up after test worker completion. Changes: - Create worker-scoped test fixture for automatic mock server cleanup - Fix stopAnkiMockServer() to properly await server.close() - Update all E2E tests to use new test-base with auto-cleanup - Use Promise.withResolvers() per project coding standards Verification: - Smoke tests pass without worker teardown timeout - Mock server properly stops after all tests complete Fixes worker teardown timeout errors in CI E2E job.
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 pull request significantly restructures and modernizes the project's GitHub Actions CI/CD pipeline, moving away from reusable workflow calls and release-please automation in favor of explicit, maintainable, and more granular workflow definitions. It also updates the documentation in
.omp/rulesto reflect the new CI process and clarifies coding and architectural conventions.CI/CD Pipeline Overhaul
.github/workflows/ci.ymlworkflow covering linting, formatting, type-checking, unit tests, and E2E tests for PRs and pushes tomain, with improved dependency and lockfile validation..github/workflows/build-and-release.ymlworkflow to handle tag-triggered and manual releases, building and uploading Linux and Windows assets, and creating draft releases with templated release notes.release-please.yml,build-release.yml, andreusable-build-assets.yml, consolidating their logic into the new explicit workflows. [1] [2] [3]release-smoke.ymlto directly build and upload platform artifacts using an explicit job matrix, rather than calling a reusable workflow.Documentation and Rules Updates
.omp/rules/architecture.mdto describe the new CI pipeline, which now includes lint, typecheck, unit, and E2E tests on PRs and main pushes, and tag-triggered builds for Linux and Windows..omp/rules/coding-conventions.md, and fixed formatting in.omp/rules/RULES_INDEX.md. [1] [2] [3] [4].omp/rules/commands.mdto clarify Node and npm usage.These changes make the CI/CD process more transparent, easier to maintain, and better documented for contributors.