-
Notifications
You must be signed in to change notification settings - Fork 0
Sprint 8E - React Apps E2E tests #182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
frigini
wants to merge
142
commits into
master
Choose a base branch
from
feature/sprint-8e-e2e-react-apps
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
142 commits
Select commit
Hold shift + click to select a range
48e7148
docs: update roadmap - Sprint 8D completed, 8E planned, prioritize Co…
bfcc791
feat: add Playwright E2E test structure and pipeline integration
804e23e
docs: update admin-portal docs with React examples and fix E2E tests
4937e20
fix: resolve documentation inconsistencies and add dynamic E2E toggle
790fabe
refactor: restructure E2E tests to tests/MeAjudaAi.Web.*.Tests/
e688313
chore: exclude nul from tracking and update e2e specs
03d7ae9
feat: Introduce E2E tests, establish CI/CD pipeline, and add core doc…
a8f4394
feat: Add e2e-support library with project and ESLint configurations.
fb97b1a
feat: Add Nx project configuration for the e2e-support library.
9e2079a
test: Add E2E tests covering onboarding, profile management, configur…
adb928d
feat: Establish comprehensive project roadmap, architecture documenta…
5e65c3f
feat: Introduce an admin sidebar component, add extensive E2E tests f…
b2a8898
feat: implement responsive sidebar component with navigation, user in…
931df3c
feat: Add comprehensive documentation for project architecture, admin…
43a6d61
feat: Add a comprehensive plan for implementing React 19 + TypeScript…
4ca8e06
feat: Set up Vitest and React Testing Library for unit testing across…
816ba64
test: Add Vitest configuration and initial unit tests for customer-fa…
3687885
feat: Initialize web project testing infrastructure with Vitest and P…
f45e7ad
feat: Establish web project foundation with modular design, comprehen…
0352068
test: Introduce Vitest and add unit tests for various components, hoo…
a851495
feat: Introduce Vitest for customer application unit and E2E testing,…
584df49
test: Introduce Vitest and add unit and E2E performance tests for cus…
705eab1
feat: introduce Vitest for unit and E2E tests across customer web app…
720542e
feat: add unit tests for various customer web components and hooks.
9e3b367
feat: Add comprehensive unit and E2E tests across customer components…
44fb031
feat: Add Vitest unit and E2E performance tests for the customer web …
96eccdd
feat: Add comprehensive frontend testing plan and initial Vitest/Play…
0271da1
feat: Implement initial Vitest unit testing infrastructure and add te…
c44da4d
feat: Implement comprehensive frontend testing infrastructure with Vi…
34adca5
feat: Implement new frontend testing strategy using Vitest and React …
41b9585
feat: Establish comprehensive testing infrastructure with unit and E2…
dc4ef07
chore: modularize CI/CD pipelines
cf815dd
feat: add bicep infrastructure and update deploy-azure workflow for d…
c56acba
chore: update deploy-azure workflow to support dev/prod environments
f8dc74a
docs: add Portuguese instructions for Azure CI/CD and Bicep infrastru…
a60be37
chore: add Aspire infrastructure artifacts to .gitignore
009afd6
chore: refine coverage filters for backend and add coverage report fo…
54f2271
feat: Implement comprehensive testing infrastructure with Vitest, Pla…
0c1c37e
feat: Add Zod schemas for customer and provider authentication and co…
c68893e
fix: review corrections for E2E tests and frontend configuration
ffb51e3
chore: update package-lock.json with e2e-support dependency
d34e158
feat: add cobertura coverage reporter for CI
4b41b92
fix: update mkdocs nav and fix relative paths in e2e-tests
8b072ea
chore: add MkDocs site output to gitignore
bd914dd
fix: review corrections for E2E tests and validation
99cc54d
fix: fix customer-register-form test to properly mock sonner and asse…
0aa982a
docs: update roadmap status - mark completed items
4f8be45
fix: review corrections - multiple improvements
bcb231f
fix: fix coverage glob pattern in ci-frontend.yml
a4d77d2
fix: review corrections - multiple improvements (phase 2)
3c014c8
fix: add output-file param to CodeCoverageSummary and fail_if_missing
590848b
fix: simplify coverage file path patterns in ci-frontend.yml
4d17f2d
fix: use merged coverage report in CodeCoverageSummary instead of ind…
79add1c
fix: normalizeProviderType to return number for valid numeric strings…
6106c2b
feat: Establish new React/Next.js frontend architecture for Admin and…
9f7e5ff
build: remove Aspire.Hosting.Orchestration.linux-x64 package version …
ae73638
build: Generate `packages.lock.json` files for all projects and updat…
b7cd37c
test: Add Vitest unit tests for various components, utilities, and AP…
dab91ae
feat: Introduce comprehensive testing by adding unit tests for Locati…
eb2e864
feat: Introduce comprehensive frontend testing, including unit, integ…
efd4d7e
feat: implement Keycloak permission resolver with caching and add com…
83ab7a6
feat: implement KeycloakPermissionResolver with caching and add unit …
60c521a
test: add integration tests for Documents API endpoints
08d2221
test: add unit tests for UI components and implement coverage report …
1157d04
feat: implement customer registration form and expand test coverage w…
d09120a
feat: add script to aggregate and validate global frontend test cover…
17fafc1
feat: implement frontend testing suite, caching infrastructure, and C…
2295daf
test: add unit tests for search page functionality and error handling
34e06db
feat: implement frontend testing infrastructure and add unit tests fo…
d7dd033
feat: implement locations module structure, search endpoint, hybrid c…
9a7a417
test: add unit tests for customer registration form, admin sidebar, s…
4d0a5ad
feat: implement CI E2E pipeline and add component unit tests
268dfb4
feat: add CI workflow for automated backend and frontend E2E testing
d8bbd68
feat: add E2E CI pipeline and unit tests for UI components and regist…
beda776
test: implement comprehensive unit and component test suites across w…
44d50a8
test: add unit tests for PermissionService covering cache integration…
c289a49
feat: implement E2E CI pipeline, add phone validator, and expand unit…
a9af3db
test: resolve all failing unit tests across react apps
573b7a9
fix(build): resolve next.js build warnings and typescript errors in c…
cb8549a
test: resolve all failing unit tests across react apps and backend en…
06b30f7
ci: fix frontend coverage merge reporting and include customer app
2752267
fix(e2e): configure Playwright for CI with auth mocks and correct routes
a5f8a38
fix(integration-tests): correct failing backend integration tests
c51fde7
ci: implement frontend CI pipeline, add admin portal documentation, a…
c35d4bf
feat: implement Keycloak authentication for admin portal and add next…
9e8bdfb
feat: implement EventTypeRegistry to discover and cache integration e…
12e483c
test: add unit tests for useDashboardStats hook and utility functions
465dff4
feat: implement event type registry, configure Keycloak auth for admi…
b0098cb
feat: implement admin dashboard with statistics visualization and fro…
1978e7d
feat: add Playwright configuration and frontend CI pipeline for autom…
6cb2df9
feat: implement CI pipelines for E2E and frontend testing with Playwr…
b3ba30d
feat: implement E2E testing pipeline and dashboard KPI verification t…
0e4eaef
test: add integration tests for CEP provider fallback scenarios and i…
da49073
feat: add vitest configuration files for customer, provider, and admi…
8a70167
feat: implement end-to-end testing infrastructure with Playwright and…
2b661e0
feat: add Playwright base test fixtures with authentication mocking a…
83e43d6
feat: add base Playwright test utilities with auth mocking and login …
345a8b0
feat: implement NextAuth middleware with E2E test bypass support
c2f48f8
fix: correcao testes de integracao - tolerant responses and skip CEP …
26ff328
fix: improve E2E mocks and skip flaky tests
1fff1f5
fix: skip flaky E2E tests - will fix later
1ab2ac4
feat: implement monorepo structure with shared test utilities, API cl…
fec0f16
feat: implement E2E CI pipeline and add unit/integration test suites …
96263d0
feat: add CI workflow for backend and frontend E2E testing
4b5c713
feat: add CI workflow for backend and frontend E2E testing
bb49f61
feat: add GitHub Actions workflow for automated backend and frontend …
49d8dd0
feat: implement geocoding service, add normalization tests, and confi…
78681fb
feat: implement SelfOrAdmin authorization handler and configure NextA…
3986ca8
test: add integration tests for CEP provider fallback logic and initi…
e08f7b6
test: add integration tests for CEP lookup service and service catalo…
0278a04
feat: implement NextAuth configuration with Keycloak and credential p…
5c57dda
feat: implement provider registration handler, admin configuration, a…
d766c93
feat: implement E2E CI pipeline with Playwright and add integration t…
0d68138
feat: implement Playwright E2E testing suite and CI pipeline for web …
2df3aa5
fix(tests): resolve integration test failures and improve infrastruc…
851d06f
feat: implement search page with geocoding, provider filtering, and a…
fbfde44
feat: implement unit and integration test suites for Locations and Us…
b488e09
feat: implement Playwright E2E testing framework with initial admin p…
f25b7f6
test: add integration tests for AllowedCity admin endpoints
81a794c
test: add integration tests for AllowedCity admin API endpoints
72754d3
test(providers): add unit tests for admin and public endpoints
4e08704
test(providers): implement integration tests for admin endpoints and …
ec57127
test(service-catalogs): add missing integration tests for endpoints
32e688b
test(users): add missing integration tests for endpoints
ebff9fd
test: achieve high coverage using integration tests and fix build issues
c0bb339
fix(providers): add email and phone validation to RegisterProviderCom…
175d599
fix(integration-tests): fix routes, data and deserialization issues i…
62ff949
test: add integration tests for Service Catalogs and Providers admin …
6fb6e40
test: add integration tests for documents, geographic restrictions, a…
7ea46f4
test: add integration test suites for providers, service catalogs, us…
26dbcd0
feat: add backend CI workflow with build, test, and coverage reporting
b191994
ci: add backend CI workflow with build, test, and coverage reporting
06f096e
feat: add CI workflow for backend build, test, and coverage reporting
b26f564
feat: add CI workflow for backend build, unit, and integration testing
18445be
feat: add backend CI workflow with PostgreSQL and Azurite integration…
1772862
feat: add CI workflow for backend build and test automation
10adeb2
feat: add backend CI workflow for automated testing and coverage anal…
66a0812
ci: unify test suite and fix coverage instrumentation to reflect true…
a69a1b2
ci: fix coverage file overwriting and restore db wait step
fce5d13
ci: split unit and integration tests for better debuggability and fix…
834f3cd
ci: ensure coverage collection even if tests fail and fix file aggreg…
5cbeb41
ci: fix shell syntax error and revert to separate test steps for bett…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| name: 'Setup Backend' | ||
| description: 'Setup .NET, restore dependencies, and install required tools' | ||
| inputs: | ||
| dotnet-version: | ||
| description: '.NET version to setup' | ||
| required: false | ||
| default: '10.0.x' | ||
| solution-path: | ||
| description: 'Path to the solution file' | ||
| required: false | ||
| default: 'MeAjudaAi.slnx' | ||
|
|
||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| - name: Setup .NET | ||
| uses: actions/setup-dotnet@v5 | ||
| with: | ||
| dotnet-version: ${{ inputs.dotnet-version }} | ||
|
|
||
| - name: Cache NuGet packages | ||
| uses: actions/cache@v5 | ||
| with: | ||
| path: ~/.nuget/packages | ||
| key: nuget-${{ runner.os }}-${{ hashFiles('**/*.csproj', '**/*.props') }} | ||
| restore-keys: | | ||
| nuget-${{ runner.os }}- | ||
|
|
||
| - name: Restore dependencies | ||
| shell: bash | ||
| run: dotnet restore ${{ inputs.solution-path }} | ||
|
|
||
| - name: Install Tools | ||
| shell: bash | ||
| run: | | ||
| dotnet tool install -g Swashbuckle.AspNetCore.Cli --version 10.1.7 | ||
| dotnet tool install -g dotnet-reportgenerator-globaltool --version 5.5.4 |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| name: 'Setup Frontend' | ||
| description: 'Setup Node.js and install dependencies' | ||
| inputs: | ||
| node-version: | ||
| description: 'Node.js version' | ||
| required: false | ||
| default: '20' | ||
| working-directory: | ||
| description: 'Frontend working directory' | ||
| required: false | ||
| default: './src/Web' | ||
|
|
||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| - name: Setup Node.js environment | ||
| uses: actions/setup-node@v6 | ||
| with: | ||
| node-version: ${{ inputs.node-version }} | ||
| cache: "npm" | ||
| cache-dependency-path: ${{ inputs.working-directory }}/package-lock.json | ||
|
|
||
| - name: Install Frontend Dependencies | ||
| shell: bash | ||
| working-directory: ${{ inputs.working-directory }} | ||
| run: npm ci | ||
|
|
||
| - name: Nx Set SHAs | ||
| uses: nrwl/nx-set-shas@v5 | ||
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,313 @@ | ||
| name: Backend CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [master, develop] | ||
| paths: | ||
| - 'src/Modules/**' | ||
| - 'src/Bootstrapper/**' | ||
| - 'src/Shared/**' | ||
| - 'tests/**' | ||
| - '!tests/MeAjudaAi.E2E.Tests/**' | ||
| - '.github/workflows/ci-backend.yml' | ||
| - '.github/actions/setup-backend/**' | ||
frigini marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - '.github/actions/setup-postgres-connection/**' | ||
| - '.github/scripts/generate-runsettings.sh' | ||
| - 'MeAjudaAi.slnx' | ||
| pull_request: | ||
| branches: [master, develop] | ||
| paths: | ||
| - 'src/Modules/**' | ||
| - 'src/Bootstrapper/**' | ||
| - 'src/Shared/**' | ||
| - 'tests/**' | ||
| - '!tests/MeAjudaAi.E2E.Tests/**' | ||
| - '.github/workflows/ci-backend.yml' | ||
| - '.github/actions/setup-backend/**' | ||
| - '.github/actions/setup-postgres-connection/**' | ||
| - '.github/scripts/generate-runsettings.sh' | ||
| - 'MeAjudaAi.slnx' | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
| checks: write | ||
| statuses: write | ||
|
|
||
| env: | ||
| DOTNET_VERSION: "10.0.x" | ||
| STRICT_COVERAGE: true | ||
| POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD || 'test123' }} | ||
| POSTGRES_USER: ${{ secrets.POSTGRES_USER || 'postgres' }} | ||
| POSTGRES_DB: ${{ secrets.POSTGRES_DB || 'meajudaai_test' }} | ||
|
|
||
| jobs: | ||
| build-and-test: | ||
| name: Build and Test (Backend) | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 60 | ||
|
|
||
| services: | ||
| postgres: | ||
| image: postgis/postgis:16-3.4 | ||
| env: | ||
| POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }} | ||
| POSTGRES_USER: ${{ env.POSTGRES_USER }} | ||
| POSTGRES_DB: ${{ env.POSTGRES_DB }} | ||
| POSTGRES_HOST_AUTH_METHOD: md5 | ||
| options: >- | ||
| --health-cmd pg_isready | ||
| --health-interval 10s | ||
| --health-timeout 5s | ||
| --health-retries 5 | ||
| ports: | ||
| - 5432:5432 | ||
|
|
||
| azurite: | ||
| image: mcr.microsoft.com/azure-storage/azurite:latest | ||
| ports: | ||
| - 10000:10000 | ||
| - 10001:10001 | ||
| - 10002:10002 | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Setup Backend | ||
| uses: ./.github/actions/setup-backend | ||
| with: | ||
| dotnet-version: ${{ env.DOTNET_VERSION }} | ||
|
|
||
| - name: Install PostgreSQL client | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y postgresql-client | ||
|
|
||
| - name: Build solution | ||
| run: dotnet build MeAjudaAi.slnx --configuration Release --no-restore | ||
|
|
||
| - name: Extract Aspire version from Directory.Packages.props | ||
| id: aspire-version | ||
| run: | | ||
| ASPIRE_VERSION=$(grep -oP 'Aspire\.Hosting\.PostgreSQL.*?Version="\K[^"]+' Directory.Packages.props || echo "13.1.3") | ||
| echo "version=$ASPIRE_VERSION" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Prepare Aspire Integration Tests | ||
| run: | | ||
| echo "Preparing .NET Aspire for integration tests..." | ||
| ASPIRE_VERSION="${{ steps.aspire-version.outputs.version }}" | ||
| TEMP_DIR=$(mktemp -d) | ||
| cd "$TEMP_DIR" | ||
| dotnet new console -n TempDcpDownloader | ||
| cd TempDcpDownloader | ||
| dotnet add package Aspire.Hosting.Orchestration.linux-x64 --version "$ASPIRE_VERSION" | ||
| dotnet restore | ||
| cd "$GITHUB_WORKSPACE" | ||
| rm -rf "$TEMP_DIR" | ||
| DCP_PACKAGE_PATH=$(find "$HOME/.nuget/packages" -maxdepth 1 -type d \ | ||
| -iname "aspire.hosting.orchestration.linux-x64" 2>/dev/null | head -n 1) | ||
| if [ -z "$DCP_PACKAGE_PATH" ]; then | ||
| echo "Error: Aspire orchestration package not found" | ||
| exit 1 | ||
| fi | ||
| DCP_BINARY=$(find "$DCP_PACKAGE_PATH" -type f -name "dcp" 2>/dev/null | head -n 1) | ||
| if [ -z "$DCP_BINARY" ]; then | ||
| echo "Error: DCP binary not found" | ||
| exit 1 | ||
| fi | ||
| echo "DOTNET_ROOT=$HOME/.dotnet" >> $GITHUB_ENV | ||
|
|
||
| - name: Wait for PostgreSQL | ||
| shell: bash | ||
| run: | | ||
| max_attempts=30 | ||
| attempt=0 | ||
| until pg_isready -h localhost -p 5432 -U "$POSTGRES_USER"; do | ||
| attempt=$((attempt + 1)) | ||
| if [ $attempt -ge $max_attempts ]; then | ||
| echo "ERROR: PostgreSQL did not become ready after $max_attempts attempts" | ||
| exit 1 | ||
| fi | ||
| echo "Waiting for PostgreSQL... (attempt $attempt/$max_attempts)" | ||
| sleep 2 | ||
| done | ||
| echo "PostgreSQL is ready" | ||
|
|
||
| - name: Setup PostgreSQL connection | ||
| id: db | ||
| uses: ./.github/actions/setup-postgres-connection | ||
| with: | ||
| postgres-host: localhost | ||
| postgres-port: 5432 | ||
| postgres-db: ${{ env.POSTGRES_DB }} | ||
| postgres-user: ${{ env.POSTGRES_USER }} | ||
| postgres-password: ${{ env.POSTGRES_PASSWORD }} | ||
|
|
||
| - name: Wait for PostgreSQL | ||
| shell: bash | ||
| run: | | ||
| max_attempts=60 | ||
| attempt=0 | ||
| until pg_isready -h localhost -p 5432 -U "$POSTGRES_USER"; do | ||
| attempt=$((attempt + 1)) | ||
| if [ $attempt -ge $max_attempts ]; then | ||
| echo "ERROR: PostgreSQL did not become ready after $max_attempts attempts" | ||
| exit 1 | ||
| fi | ||
| echo "Waiting for PostgreSQL... (attempt $attempt/$max_attempts)" | ||
| sleep 2 | ||
| done | ||
| echo "PostgreSQL is ready" | ||
|
|
||
| - name: Run Unit Tests with Coverage | ||
| id: unit-tests | ||
| continue-on-error: true | ||
| env: | ||
| ASPNETCORE_ENVIRONMENT: Testing | ||
| MEAJUDAAI_DB_PASS: ${{ env.POSTGRES_PASSWORD }} | ||
| MEAJUDAAI_DB_USER: ${{ env.POSTGRES_USER }} | ||
| MEAJUDAAI_DB: ${{ env.POSTGRES_DB }} | ||
| ConnectionStrings__DefaultConnection: ${{ steps.db.outputs.connection-string }} | ||
| ConnectionStrings__Users: ${{ steps.db.outputs.connection-string }} | ||
| ConnectionStrings__Search: ${{ steps.db.outputs.connection-string }} | ||
| ConnectionStrings__meajudaai-db: ${{ steps.db.outputs.connection-string }} | ||
| AZURE_STORAGE_CONNECTION_STRING: "DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://localhost:10000/devstoreaccount1;" | ||
| run: | | ||
| echo "🧪 Running Unit & Architecture Tests..." | ||
| rm -rf ./coverage | ||
| mkdir -p ./coverage | ||
|
|
||
| # Run unit tests per module for isolation | ||
| MODULES=( | ||
| "src/Modules/Users/Tests/MeAjudaAi.Modules.Users.Tests.csproj" | ||
| "src/Modules/Providers/Tests/MeAjudaAi.Modules.Providers.Tests.csproj" | ||
| "src/Modules/Documents/Tests/MeAjudaAi.Modules.Documents.Tests.csproj" | ||
| "src/Modules/ServiceCatalogs/Tests/MeAjudaAi.Modules.ServiceCatalogs.Tests.csproj" | ||
| "src/Modules/Locations/Tests/MeAjudaAi.Modules.Locations.Tests.csproj" | ||
| "src/Modules/SearchProviders/Tests/MeAjudaAi.Modules.SearchProviders.Tests.csproj" | ||
| "tests/MeAjudaAi.Shared.Tests/MeAjudaAi.Shared.Tests.csproj" | ||
| "tests/MeAjudaAi.ApiService.Tests/MeAjudaAi.ApiService.Tests.csproj" | ||
| "tests/MeAjudaAi.Architecture.Tests/MeAjudaAi.Architecture.Tests.csproj" | ||
| ) | ||
|
|
||
| for module in "${MODULES[@]}"; do | ||
| if [ -f "$module" ]; then | ||
| module_name=$(basename "$module" .csproj) | ||
| dotnet test "$module" \ | ||
| --configuration Release --no-build \ | ||
| --collect:"XPlat Code Coverage" \ | ||
| --results-directory "./coverage/unit/$module_name" \ | ||
| --settings ./coverlet.runsettings | ||
| fi | ||
| done | ||
|
|
||
| - name: Run Integration Tests | ||
| id: integration-tests | ||
| continue-on-error: true | ||
| env: | ||
| ASPNETCORE_ENVIRONMENT: Testing | ||
| INTEGRATION_TESTS: true | ||
| MEAJUDAAI_DB_PASS: ${{ env.POSTGRES_PASSWORD }} | ||
| MEAJUDAAI_DB_USER: ${{ env.POSTGRES_USER }} | ||
| MEAJUDAAI_DB: ${{ env.POSTGRES_DB }} | ||
| ConnectionStrings__DefaultConnection: ${{ steps.db.outputs.connection-string }} | ||
| ConnectionStrings__Users: ${{ steps.db.outputs.connection-string }} | ||
| ConnectionStrings__Search: ${{ steps.db.outputs.connection-string }} | ||
| ConnectionStrings__meajudaai-db: ${{ steps.db.outputs.connection-string }} | ||
| AZURE_STORAGE_CONNECTION_STRING: "DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://localhost:10000/devstoreaccount1;" | ||
| run: | | ||
| echo "🚀 Running Integration Tests (expected duration ~40m)..." | ||
| dotnet test tests/MeAjudaAi.Integration.Tests/MeAjudaAi.Integration.Tests.csproj \ | ||
| --configuration Release --no-build \ | ||
| --collect:"XPlat Code Coverage" \ | ||
| --results-directory ./coverage/integration \ | ||
| --settings ./coverlet.runsettings \ | ||
| --verbosity normal | ||
|
|
||
| - name: Collect and aggregate coverage files | ||
| run: | | ||
| mkdir -p ./coverage/aggregate | ||
| counter=0 | ||
| # Standard bash loop to find and rename coverage files uniquely | ||
| find ./coverage -type f -name "coverage.cobertura.xml" | while read -r file; do | ||
| counter=$((counter + 1)) | ||
| cp "$file" "./coverage/aggregate/coverage_${counter}.cobertura.xml" | ||
| echo "✅ Collected: $file as coverage_${counter}.cobertura.xml" | ||
| done | ||
|
|
||
| if [ -n "$(ls -A ./coverage/aggregate/ 2>/dev/null)" ]; then | ||
| echo "✅ All coverage files ready for aggregation." | ||
| else | ||
| echo "❌ CRITICAL ERROR: No coverage files were generated." | ||
| exit 1 | ||
| fi | ||
|
|
||
| - name: Configure DOTNET_ROOT for ReportGenerator | ||
| run: | | ||
| DOTNET_PATH="$(which dotnet)" | ||
| echo "DOTNET_ROOT=$(dirname "$(readlink -f "$DOTNET_PATH")")" >> $GITHUB_ENV | ||
|
|
||
| - name: Generate aggregated coverage report | ||
| uses: danielpalme/ReportGenerator-GitHub-Action@5 | ||
| with: | ||
| reports: "coverage/aggregate/**/*.cobertura.xml" | ||
| targetdir: "coverage/final_report" | ||
| reporttypes: "Cobertura;JsonSummary" | ||
| assemblyfilters: "+MeAjudaAi.*;-MeAjudaAi.AppHost;-MeAjudaAi.ServiceDefaults" | ||
| classfilters: "-*.Tests;-*.Tests.*;-*Test*;-testhost;-*.Migrations.*;-*Program*;-*.Seeding.*;-*.Monitoring.*" | ||
|
|
||
| - name: Upload coverage reports | ||
| uses: actions/upload-artifact@v4 | ||
| if: always() | ||
| with: | ||
| name: coverage-reports | ||
| path: coverage/** | ||
|
|
||
| - name: Code Coverage Summary | ||
| uses: irongut/CodeCoverageSummary@v1.3.0 | ||
| with: | ||
| filename: "coverage/final_report/Cobertura.xml" | ||
| badge: true | ||
| format: markdown | ||
| output: both | ||
| thresholds: "90 80" # line branch | ||
| fail_below_min: true | ||
|
|
||
| - name: Add Coverage PR Comment | ||
| uses: marocchino/sticky-pull-request-comment@v2 | ||
| if: github.event_name == 'pull_request' | ||
| with: | ||
| recreate: true | ||
| header: coverage-report | ||
| path: code-coverage-results.md | ||
|
|
||
| security-scan: | ||
| name: Security Scan | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v6 | ||
| - name: Setup .NET | ||
| uses: actions/setup-dotnet@v5 | ||
| with: | ||
| dotnet-version: "10.0.x" | ||
| - name: Run Security Audit | ||
| continue-on-error: true | ||
| run: | | ||
| dotnet list package --vulnerable --include-transitive > security-audit-report.txt | ||
| cat security-audit-report.txt | ||
| - name: Verify No Critical Direct Vulnerabilities | ||
| run: | | ||
| # Parse output to find if there are critical vulnerabilities in direct dependencies | ||
| # We check the top-level references specifically. A basic scan verifies if "Critical" shows up without being in a Transitive block, or simply checks top-level explicitly. | ||
| dotnet list package --vulnerable > direct-security-audit.txt | ||
| if grep -qi "Critical" direct-security-audit.txt; then | ||
| echo "Critical direct vulnerabilities found!" | ||
| cat direct-security-audit.txt | ||
| exit 1 | ||
| fi | ||
| echo "No critical vulnerabilities found in direct dependencies." | ||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.