Try copy files

This commit is contained in:
Alex Hyett 2023-07-10 12:12:15 +01:00
parent bc470cfd07
commit e9aee85861
7 changed files with 12 additions and 7 deletions

View file

@ -17,14 +17,18 @@ jobs:
- name: Build
run: dotnet build
- name: Run Unit Tests
run: dotnet test --filter Unit --no-restore --verbosity normal
run: dotnet test --filter Category=Unit --no-restore --verbosity normal
- uses: canastro/copy-file-action@master
with:
source: "test/**/TestResults/*UnitTests.trx"
target: "TestResults"
- name: Start containers
run: docker-compose -f "docker-compose.yml" up -d --build
- name: Wait for docker containers to setup
run: sleep 30s
shell: bash
- name: Run Integration Tests
run: dotnet test --filter Integration --no-restore --verbosity normal
run: dotnet test --filter Category=Integration --no-restore --verbosity normal
- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure()

View file

@ -29,7 +29,7 @@
<PropertyGroup>
<VSTestLogger>trx%3bLogFileName=$(MSBuildProjectName).trx</VSTestLogger>
<VSTestResultsDirectory>$(SolutionDir)/TestResults</VSTestResultsDirectory>
<VSTestResultsDirectory>$(MSBuildThisFileDirectory)/TestResults</VSTestResultsDirectory>
</PropertyGroup>
</Project>

View file

@ -1,4 +1,3 @@
using GitHubActionsDemo.Api.Sdk.Authors;
using GitHubActionsDemo.Api.Sdk.Books;
using Refit;
@ -6,6 +5,7 @@ using Shouldly;
namespace GitHubActionsDemo.Api.Integration.Tests;
[Trait("Category", "Integration")]
public class IntegrationTests
{
private const string BaseUri = "http://localhost:5275";

View file

@ -10,6 +10,7 @@ using GitHubActionsDemo.Api.Sdk.Shared;
namespace GitHubActionsDemo.Api.Unit.Tests;
[Trait("Category", "Unit")]
public class AuthorsControllerTests
{
private readonly Mock<ILibraryService> _libraryService;

View file

@ -30,7 +30,7 @@
<PropertyGroup>
<VSTestLogger>trx%3bLogFileName=$(MSBuildProjectName).trx</VSTestLogger>
<VSTestResultsDirectory>$(SolutionDir)/TestResults</VSTestResultsDirectory>
<VSTestResultsDirectory>$(MSBuildThisFileDirectory)/TestResults</VSTestResultsDirectory>
</PropertyGroup>
</Project>

View file

@ -30,6 +30,6 @@
<PropertyGroup>
<VSTestLogger>trx%3bLogFileName=$(MSBuildProjectName).trx</VSTestLogger>
<VSTestResultsDirectory>$(SolutionDir)/TestResults</VSTestResultsDirectory>
<VSTestResultsDirectory>$(MSBuildThisFileDirectory)/TestResults</VSTestResultsDirectory>
</PropertyGroup>
</Project>

View file

@ -1,4 +1,3 @@
using System;
using GitHubActionsDemo.Persistance;
using GitHubActionsDemo.Persistance.Models;
using GitHubActionsDemo.Service.Models;
@ -6,6 +5,7 @@ using Microsoft.Extensions.Logging;
namespace GitHubActionsDemo.Service.Unit.Tests;
[Trait("Category", "Unit")]
public class LibraryServiceTests
{
private readonly Mock<ILibraryRespository> _libraryRespository;