Skip to content

chore: add tests#19

Open
nazarli-shabnam wants to merge 6 commits intomainfrom
18-add-tests
Open

chore: add tests#19
nazarli-shabnam wants to merge 6 commits intomainfrom
18-add-tests

Conversation

@nazarli-shabnam
Copy link
Copy Markdown
Member

@nazarli-shabnam nazarli-shabnam commented Apr 10, 2026

closes #18
This pull request introduces comprehensive test automation for both the UI and Python backend, adds initial test suites, and sets up the required configuration and dependencies to support these workflows. The changes ensure that both the frontend and backend are tested as part of the continuous integration (CI) process, increasing code reliability and maintainability.

CI/CD Workflow Enhancements:

  • The GitHub Actions CI workflow (.github/workflows/ci.yml) is updated to run UI and Python tests automatically. This includes adding steps to install test dependencies and execute tests for both the UI (npm run test using Vitest) and Python backend (pytest). [1] [2] [3]

UI Testing Infrastructure:

  • Adds Vitest and Testing Library setup for the UI:
    • Adds vitest, @testing-library/react, @testing-library/jest-dom, and related dependencies to apps/ui/package.json. [1] [2]
    • Adds vitest.config.ts and vitest.setup.ts for test configuration and environment setup. [1] [2]
    • Updates tsconfig.json to include test files and module resolution for new dependencies.

Python Testing Infrastructure:

  • Adds pytest as a test dependency (requirements-test.txt) and configures test discovery via pytest.ini. [1] [2]

Initial Test Suites:

  • Adds example test files for both backend and frontend:
    • Python: API health check (tests/api/test_health.py) and worker job processing tests (tests/worker/test_process_job.py). [1] [2]
    • UI: Component and utility function tests (tests/ui/components/page-header.test.tsx, tests/ui/lib/utils.test.ts). [1] [2]

Minor Code Quality Improvements:

  • Refactors import usage in eslint.config.mjs for consistency.

References:

@nazarli-shabnam nazarli-shabnam self-assigned this Apr 10, 2026
Copilot AI review requested due to automatic review settings April 10, 2026 08:27
@nazarli-shabnam nazarli-shabnam added bug Something isn't working enhancement New feature or request labels Apr 10, 2026
@nazarli-shabnam nazarli-shabnam linked an issue Apr 10, 2026 that may be closed by this pull request
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds automated test infrastructure for the UI (Vitest + Testing Library) and Python backend (pytest), and wires both into the GitHub Actions CI pipeline to ensure tests run on every push/PR.

Changes:

  • Add initial UI unit/component tests and configure Vitest to run tests located under tests/ui/.
  • Add initial Python API/worker tests plus pytest.ini to standardize discovery and import paths.
  • Update CI workflow to run UI tests and Python tests before builds/compile checks.

Reviewed changes

Copilot reviewed 12 out of 14 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/worker/test_process_job.py Adds unit-style tests for worker job processing with mocked GitHub HTTP calls.
tests/ui/lib/utils.test.ts Adds unit tests for cn utility.
tests/ui/components/page-header.test.tsx Adds a component render test for PageHeader using Testing Library.
tests/api/test_health.py Adds unit + integration tests for the /healthz endpoint and router mounting.
pytest.ini Configures pytest discovery and sets pythonpath for API/worker imports.
package.json Adds local CI convenience scripts (ci:local*).
apps/ui/vitest.setup.ts Registers @testing-library/jest-dom matchers for Vitest.
apps/ui/vitest.config.ts Adds Vitest configuration targeting tests outside apps/ui.
apps/ui/vitest-env.d.ts Adds TS type references for jest-dom matchers.
apps/ui/tsconfig.json Includes external UI test files and Vitest/jest-dom typing support.
apps/ui/package.json Adds Vitest/testing-library deps and test scripts; updates check pipeline.
apps/ui/package-lock.json Locks newly added UI testing dependencies.
apps/ui/eslint.config.mjs Minor refactor of path handling for eslint config setup.
.github/workflows/ci.yml Runs UI tests (Vitest) and Python tests (pytest) in CI.
Files not reviewed (1)
  • apps/ui/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread package.json Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 13 changed files in this pull request and generated 4 comments.

Files not reviewed (1)
  • apps/ui/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/ci.yml Outdated
Comment thread .github/workflows/ci.yml
Comment thread apps/ui/tsconfig.json
Comment thread .github/workflows/ci.yml
@martian56 martian56 changed the title 18 add tests chore: add tests Apr 13, 2026
Copy link
Copy Markdown
Member

@martian56 martian56 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice Work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add tests

3 participants