Skip to content

Commit a73b381

Browse files
authored
Merge pull request #30 from Nesteo/fix-integration-tests-in-ci
Fix integration tests in ci
2 parents b56b5ce + da38575 commit a73b381

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

.circleci/config.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@ jobs:
1414
MYSQL_ROOT_PASSWORD: root
1515
steps:
1616
- checkout
17-
# - run:
18-
# name: Run tests
19-
# command: dotnet test
20-
# environment:
21-
# ConnectionStrings__DefaultConnection: "Server=localhost;Database=test;User=root;Password=root"
17+
- run:
18+
name: Run tests
19+
command: dotnet test
20+
environment:
21+
ConnectionStrings__DefaultConnection: "Server=localhost;Database=test;User=root;Password=root"
22+
Storage__ImageUploadsDirectoryPath: "/tmp/nesteo-uploads"
2223
build:
2324
executor: docker-instance
2425
steps:
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
using Xunit;
2+
3+
[assembly: CollectionBehavior(DisableTestParallelization = true)]

Nesteo.Server.IntegrationTests/NesteoWebApplicationFactory.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
using System;
2+
using System.Collections.Generic;
23
using System.IO;
34
using System.Linq;
45
using Microsoft.AspNetCore.Hosting;
56
using Microsoft.AspNetCore.Mvc.Testing;
7+
using Microsoft.EntityFrameworkCore;
68
using Microsoft.Extensions.Configuration;
79
using Microsoft.Extensions.DependencyInjection;
810
using Microsoft.Extensions.Logging;
@@ -29,7 +31,7 @@ protected override void ConfigureWebHost(IWebHostBuilder builder)
2931
NesteoDbContext dbContext = scope.ServiceProvider.GetRequiredService<NesteoDbContext>();
3032

3133
// Ensure the database is created
32-
dbContext.Database.EnsureCreated();
34+
dbContext.Database.Migrate();
3335
});
3436
}
3537
}

0 commit comments

Comments
 (0)