1
0
mirror of https://github.com/bitwarden/server synced 2025-12-15 15:53:59 +00:00

[BEEEP] Integration tests (#1945)

* Add api integration tests

* Add some stuff

* Make program mockable

* Work on IntegrationTests for Identity

* Formatting

* Update packages.lock.json

* Update more packages.lock.json

* Update all packages.lock.json

* Fix InMemory configuration

* Actually fix test configuration

* Fix tests for CI

* Fix event service

* Force EF EventRepository

* Add client_credentials test

* Remove Api.IntegrationTest

* Remove Api Program changes

* Cleanup

* Add more Auth-Email tests

* Run formatting

* Address some PR feedback

* Move integration stuff to it's own common project

* Ran linter

* Add shared project to test solution

* Remove sln changes

* Clean usings

* Add more coverage

* Address PR feedback
This commit is contained in:
Justin Baur
2022-05-20 15:24:59 -04:00
committed by GitHub
parent 98546a65ea
commit 719abc7e61
36 changed files with 8706 additions and 161 deletions

View File

@@ -3416,7 +3416,7 @@
"commcore": {
"type": "Project",
"dependencies": {
"Core": "1.47.1"
"Core": "1.48.1"
}
},
"core": {
@@ -3461,7 +3461,7 @@
"infrastructure.dapper": {
"type": "Project",
"dependencies": {
"Core": "1.47.1",
"Core": "1.48.1",
"Dapper": "2.0.123",
"System.Data.SqlClient": "4.8.3"
}
@@ -3470,7 +3470,7 @@
"type": "Project",
"dependencies": {
"AutoMapper.Extensions.Microsoft.DependencyInjection": "8.0.1",
"Core": "1.47.1",
"Core": "1.48.1",
"Microsoft.EntityFrameworkCore.Relational": "5.0.12",
"Npgsql.EntityFrameworkCore.PostgreSQL": "5.0.2",
"Pomelo.EntityFrameworkCore.MySql": "5.0.3",
@@ -3480,7 +3480,7 @@
"migrator": {
"type": "Project",
"dependencies": {
"Core": "1.47.1",
"Core": "1.48.1",
"Microsoft.Extensions.Logging": "5.0.0",
"dbup-sqlserver": "4.4.0"
}
@@ -3488,9 +3488,9 @@
"sharedweb": {
"type": "Project",
"dependencies": {
"Core": "1.47.1",
"Infrastructure.Dapper": "1.47.1",
"Infrastructure.EntityFramework": "1.47.1"
"Core": "1.48.1",
"Infrastructure.Dapper": "1.48.1",
"Infrastructure.EntityFramework": "1.48.1"
}
}
}

View File

@@ -3355,7 +3355,7 @@
"commcore": {
"type": "Project",
"dependencies": {
"Core": "1.47.1"
"Core": "1.48.1"
}
},
"core": {
@@ -3400,7 +3400,7 @@
"infrastructure.dapper": {
"type": "Project",
"dependencies": {
"Core": "1.47.1",
"Core": "1.48.1",
"Dapper": "2.0.123",
"System.Data.SqlClient": "4.8.3"
}
@@ -3409,7 +3409,7 @@
"type": "Project",
"dependencies": {
"AutoMapper.Extensions.Microsoft.DependencyInjection": "8.0.1",
"Core": "1.47.1",
"Core": "1.48.1",
"Microsoft.EntityFrameworkCore.Relational": "5.0.12",
"Npgsql.EntityFrameworkCore.PostgreSQL": "5.0.2",
"Pomelo.EntityFrameworkCore.MySql": "5.0.3",
@@ -3419,9 +3419,9 @@
"sharedweb": {
"type": "Project",
"dependencies": {
"Core": "1.47.1",
"Infrastructure.Dapper": "1.47.1",
"Infrastructure.EntityFramework": "1.47.1"
"Core": "1.48.1",
"Infrastructure.Dapper": "1.48.1",
"Infrastructure.EntityFramework": "1.48.1"
}
}
}

View File

@@ -3424,7 +3424,7 @@
"infrastructure.dapper": {
"type": "Project",
"dependencies": {
"Core": "1.47.1",
"Core": "1.48.1",
"Dapper": "2.0.123",
"System.Data.SqlClient": "4.8.3"
}
@@ -3433,7 +3433,7 @@
"type": "Project",
"dependencies": {
"AutoMapper.Extensions.Microsoft.DependencyInjection": "8.0.1",
"Core": "1.47.1",
"Core": "1.48.1",
"Microsoft.EntityFrameworkCore.Relational": "5.0.12",
"Npgsql.EntityFrameworkCore.PostgreSQL": "5.0.2",
"Pomelo.EntityFrameworkCore.MySql": "5.0.3",
@@ -3443,9 +3443,9 @@
"sharedweb": {
"type": "Project",
"dependencies": {
"Core": "1.47.1",
"Infrastructure.Dapper": "1.47.1",
"Infrastructure.EntityFramework": "1.47.1"
"Core": "1.48.1",
"Infrastructure.Dapper": "1.48.1",
"Infrastructure.EntityFramework": "1.48.1"
}
}
}

View File

@@ -3333,7 +3333,7 @@
"infrastructure.dapper": {
"type": "Project",
"dependencies": {
"Core": "1.47.1",
"Core": "1.48.1",
"Dapper": "2.0.123",
"System.Data.SqlClient": "4.8.3"
}
@@ -3342,7 +3342,7 @@
"type": "Project",
"dependencies": {
"AutoMapper.Extensions.Microsoft.DependencyInjection": "8.0.1",
"Core": "1.47.1",
"Core": "1.48.1",
"Microsoft.EntityFrameworkCore.Relational": "5.0.12",
"Npgsql.EntityFrameworkCore.PostgreSQL": "5.0.2",
"Pomelo.EntityFrameworkCore.MySql": "5.0.3",
@@ -3352,9 +3352,9 @@
"sharedweb": {
"type": "Project",
"dependencies": {
"Core": "1.47.1",
"Infrastructure.Dapper": "1.47.1",
"Infrastructure.EntityFramework": "1.47.1"
"Core": "1.48.1",
"Infrastructure.Dapper": "1.48.1",
"Infrastructure.EntityFramework": "1.48.1"
}
}
}

View File

@@ -3333,7 +3333,7 @@
"infrastructure.dapper": {
"type": "Project",
"dependencies": {
"Core": "1.47.1",
"Core": "1.48.1",
"Dapper": "2.0.123",
"System.Data.SqlClient": "4.8.3"
}
@@ -3342,7 +3342,7 @@
"type": "Project",
"dependencies": {
"AutoMapper.Extensions.Microsoft.DependencyInjection": "8.0.1",
"Core": "1.47.1",
"Core": "1.48.1",
"Microsoft.EntityFrameworkCore.Relational": "5.0.12",
"Npgsql.EntityFrameworkCore.PostgreSQL": "5.0.2",
"Pomelo.EntityFrameworkCore.MySql": "5.0.3",
@@ -3352,9 +3352,9 @@
"sharedweb": {
"type": "Project",
"dependencies": {
"Core": "1.47.1",
"Infrastructure.Dapper": "1.47.1",
"Infrastructure.EntityFramework": "1.47.1"
"Core": "1.48.1",
"Infrastructure.Dapper": "1.48.1",
"Infrastructure.EntityFramework": "1.48.1"
}
}
}

View File

@@ -3342,7 +3342,7 @@
"infrastructure.dapper": {
"type": "Project",
"dependencies": {
"Core": "1.46.2",
"Core": "1.48.1",
"Dapper": "2.0.123",
"System.Data.SqlClient": "4.8.3"
}
@@ -3351,7 +3351,7 @@
"type": "Project",
"dependencies": {
"AutoMapper.Extensions.Microsoft.DependencyInjection": "8.0.1",
"Core": "1.46.2",
"Core": "1.48.1",
"Microsoft.EntityFrameworkCore.Relational": "5.0.12",
"Npgsql.EntityFrameworkCore.PostgreSQL": "5.0.2",
"Pomelo.EntityFrameworkCore.MySql": "5.0.3",
@@ -3361,9 +3361,9 @@
"sharedweb": {
"type": "Project",
"dependencies": {
"Core": "1.46.2",
"Infrastructure.Dapper": "1.46.2",
"Infrastructure.EntityFramework": "1.46.2"
"Core": "1.48.1",
"Infrastructure.Dapper": "1.48.1",
"Infrastructure.EntityFramework": "1.48.1"
}
}
}

View File

@@ -10,7 +10,14 @@ namespace Bit.Identity
{
public static void Main(string[] args)
{
Host
CreateHostBuilder(args)
.Build()
.Run();
}
public static IHostBuilder CreateHostBuilder(string[] args)
{
return Host
.CreateDefaultBuilder(args)
.ConfigureCustomAppConfiguration(args)
.ConfigureWebHostDefaults(webBuilder =>
@@ -34,9 +41,7 @@ namespace Bit.Identity
return e.Level >= LogEventLevel.Error;
}));
})
.Build()
.Run();
});
}
}
}

View File

@@ -3333,7 +3333,7 @@
"infrastructure.dapper": {
"type": "Project",
"dependencies": {
"Core": "1.47.1",
"Core": "1.48.1",
"Dapper": "2.0.123",
"System.Data.SqlClient": "4.8.3"
}
@@ -3342,7 +3342,7 @@
"type": "Project",
"dependencies": {
"AutoMapper.Extensions.Microsoft.DependencyInjection": "8.0.1",
"Core": "1.47.1",
"Core": "1.48.1",
"Microsoft.EntityFrameworkCore.Relational": "5.0.12",
"Npgsql.EntityFrameworkCore.PostgreSQL": "5.0.2",
"Pomelo.EntityFrameworkCore.MySql": "5.0.3",
@@ -3352,9 +3352,9 @@
"sharedweb": {
"type": "Project",
"dependencies": {
"Core": "1.47.1",
"Infrastructure.Dapper": "1.47.1",
"Infrastructure.EntityFramework": "1.47.1"
"Core": "1.48.1",
"Infrastructure.Dapper": "1.48.1",
"Infrastructure.EntityFramework": "1.48.1"
}
}
}

View File

@@ -3427,7 +3427,7 @@
"infrastructure.dapper": {
"type": "Project",
"dependencies": {
"Core": "1.47.1",
"Core": "1.48.1",
"Dapper": "2.0.123",
"System.Data.SqlClient": "4.8.3"
}
@@ -3436,7 +3436,7 @@
"type": "Project",
"dependencies": {
"AutoMapper.Extensions.Microsoft.DependencyInjection": "8.0.1",
"Core": "1.47.1",
"Core": "1.48.1",
"Microsoft.EntityFrameworkCore.Relational": "5.0.12",
"Npgsql.EntityFrameworkCore.PostgreSQL": "5.0.2",
"Pomelo.EntityFrameworkCore.MySql": "5.0.3",
@@ -3446,9 +3446,9 @@
"sharedweb": {
"type": "Project",
"dependencies": {
"Core": "1.47.1",
"Infrastructure.Dapper": "1.47.1",
"Infrastructure.EntityFramework": "1.47.1"
"Core": "1.48.1",
"Infrastructure.Dapper": "1.48.1",
"Infrastructure.EntityFramework": "1.48.1"
}
}
}

View File

@@ -3333,7 +3333,7 @@
"infrastructure.dapper": {
"type": "Project",
"dependencies": {
"Core": "1.46.2",
"Core": "1.48.1",
"Dapper": "2.0.123",
"System.Data.SqlClient": "4.8.3"
}
@@ -3342,7 +3342,7 @@
"type": "Project",
"dependencies": {
"AutoMapper.Extensions.Microsoft.DependencyInjection": "8.0.1",
"Core": "1.46.2",
"Core": "1.48.1",
"Microsoft.EntityFrameworkCore.Relational": "5.0.12",
"Npgsql.EntityFrameworkCore.PostgreSQL": "5.0.2",
"Pomelo.EntityFrameworkCore.MySql": "5.0.3",