The unittest/action.yaml now automatically excludes test projects ending with Integration.csproj from unit test runs.
β
Will run unit tests:
- ProjectName.Tests.csproj
- ProjectName.UnitTests.csproj
- ProjectName.Tests.Unit.csproj
- ProjectName.ComponentTests.csproj
π« Will exclude from unit tests:
- ProjectName.Integration.csproj
- ProjectName.Tests.Integration.csproj
- ProjectName.IntegrationTests.Integration.csproj
π Searching for test projects matching pattern: **/*Tests/*.csproj
π« Excluding integration test projects (ending with Integration.csproj)
π« Excluding integration test: ./tests/Conferenti.Api.Tests.Integration.csproj
π« Excluding integration test: ./tests/Conferenti.Services.Integration.csproj
β
Running unit tests on projects:
π¦ ./tests/Conferenti.Api.Tests.csproj
π¦ ./tests/Conferenti.Services.Tests.csproj
π¦ ./tests/Conferenti.Domain.UnitTests.csproj
π§ͺ Running tests for: ./tests/Conferenti.Api.Tests.csproj
π§ͺ Running tests for: ./tests/Conferenti.Services.Tests.csproj
π§ͺ Running tests for: ./tests/Conferenti.Domain.UnitTests.csproj
- name: Run Unit Tests Only
uses: ./unittest
with:
solution-path: './Conferenti.sln'
test-projects: '**/*Tests/*.csproj' # Finds all test projects
collect-coverage: 'true'
# Integration.csproj files are automatically excluded- π Discovery: Finds all projects matching the
test-projectspattern - π« Filtering: Removes any project files ending with
Integration.csproj - π Logging: Shows which projects are excluded and which will run
- π§ͺ Execution: Runs tests only on the remaining unit test projects
tests/
βββ Conferenti.Api.Tests.csproj β
Runs (unit tests)
βββ Conferenti.Api.Tests.Integration.csproj π« Excluded (integration)
βββ Conferenti.Services.Tests.csproj β
Runs (unit tests)
βββ Conferenti.Services.Integration.csproj π« Excluded (integration)
βββ Conferenti.Domain.UnitTests.csproj β
Runs (unit tests)
- β‘ Faster Builds: Unit tests run separately from integration tests
- π― Separation: Clear distinction between unit and integration test execution
- π Visibility: Clear logging of which projects are included/excluded
- π οΈ Flexible: Still uses the same
test-projectspattern input
Use the separate integrationtest/action.yaml for running integration tests:
- name: Run Integration Tests
uses: ./integrationtest
with:
system_name: "conferenti"
test-projects: '**/*Integration*.csproj'
environment: "test"Unit tests and integration tests are now properly separated! π