Skip to content

Feature: Integrate Testing Workflows for GitHub Actions #77

@AchiTsa

Description

@AchiTsa

Feature Summary

This feature implements a comprehensive Automated Testing & CI Pipeline for the Ai-Healthcare-Chatbot repository. It introduces automated workflows for both Frontend (Next.js) and Backend (FastAPI), ensuring that every code change is automatically validated for quality, functionality, and build integrity. The setup includes cloud-based GitHub Actions, localized execution scripts for developers, and test verification cases to guarantee environment stability.

Motivation / Use Case

As the project grows, manual verification of changes becomes slow and prone to human error. Without an automated pipeline:

  • Regression Risks: New features might accidentally break existing medical logic or UI components.
  • Inconsistent Environments: "It works on my machine" issues arise when local developer setups differ from the production/deployment environment.
  • Code Quality Decay: Lack of automated linting leads to inconsistent code styles and potential hidden bugs.
  • Developer Friction: New contributors lack a clear, single-command method to verify their work before submitting a Pull Request.

Proposed Solution

  1. GitHub Actions Integration:
  • Backend CI: Automatically runs pytest and ruff (linting) on Python 3.11. It uses a custom PYTHONPATH configuration to correctly resolve the app module within the FastAPI structure.
  • Frontend CI: Executes npm run lint, npm run test (Jest), and npm run build. It is future-proofed by opting into the Node.js 24 runner environment to avoid deprecation warnings.
  1. Developer Tooling (Local DX):
  • Introduces scripts/test_all.sh and scripts/test_all.ps1, allowing developers on Linux, macOS, and Windows to run the entire project test suite locally with a single command that mirrors the CI environment.
  1. Verification & Documentation:
  • Smoke Tests: Added tests/test_ci_setup.py and frontend/src/tests/ci_setup.test.ts to provide immediate feedback on whether the testing infrastructure itself is healthy.
  • Centralized Docs: Created docs/AUTOMATED_TESTING.md to serve as the definitive guide for running, adding, and troubleshooting tests within the repository.

Alternatives Considered

No response

Feature Area

Testing

Estimated Effort

Medium (1–3 days)

Suggested Labels

  • enhancement
  • good first issue
  • help wanted
  • documentation

Checklist

  • I have searched existing issues and this is not a duplicate.
  • This feature aligns with the project's medical safety guidelines.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions