Browse Source

Modify tests to use different settings for each microsevice

pull/223/head
dsanz 7 years ago
parent
commit
1420562b34
10 changed files with 37 additions and 7 deletions
  1. +11
    -1
      test/Services/FunctionalTests/FunctionalTests.csproj
  2. +1
    -1
      test/Services/FunctionalTests/Services/Catalog/CatalogScenariosBase.cs
  3. +7
    -0
      test/Services/FunctionalTests/Services/Catalog/settings.json
  4. +1
    -1
      test/Services/FunctionalTests/Services/Ordering/OrderingScenariosBase.cs
  5. +0
    -0
      test/Services/FunctionalTests/Services/Ordering/settings.json
  6. +9
    -2
      test/Services/IntegrationTests/IntegrationTests.csproj
  7. +1
    -1
      test/Services/IntegrationTests/Services/Catalog/CatalogScenarioBase.cs
  8. +6
    -0
      test/Services/IntegrationTests/Services/Catalog/settings.json
  9. +1
    -1
      test/Services/IntegrationTests/Services/Ordering/OrderingScenarioBase.cs
  10. +0
    -0
      test/Services/IntegrationTests/Services/Ordering/settings.json

+ 11
- 1
test/Services/FunctionalTests/FunctionalTests.csproj View File

@ -4,6 +4,16 @@
<TargetFramework>netcoreapp1.1</TargetFramework> <TargetFramework>netcoreapp1.1</TargetFramework>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<None Remove="Services\Catalog\settings.json" />
</ItemGroup>
<ItemGroup>
<Content Include="Services\Catalog\settings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.DotNet.InternalAbstractions" Version="1.0.0" /> <PackageReference Include="Microsoft.DotNet.InternalAbstractions" Version="1.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0-preview-20170106-08" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0-preview-20170106-08" />
@ -23,7 +33,7 @@
<None Update="appsettings.json"> <None Update="appsettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
<None Update="settings.json">
<None Update="Services\Ordering\settings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
</ItemGroup> </ItemGroup>


+ 1
- 1
test/Services/FunctionalTests/Services/Catalog/CatalogScenariosBase.cs View File

@ -14,7 +14,7 @@ namespace FunctionalTests.Services.Catalog
public TestServer CreateServer() public TestServer CreateServer()
{ {
var webHostBuilder = new WebHostBuilder(); var webHostBuilder = new WebHostBuilder();
webHostBuilder.UseContentRoot(Directory.GetCurrentDirectory());
webHostBuilder.UseContentRoot(Directory.GetCurrentDirectory() + "\\Services\\Catalog");
webHostBuilder.UseStartup<Startup>(); webHostBuilder.UseStartup<Startup>();
return new TestServer(webHostBuilder); return new TestServer(webHostBuilder);


+ 7
- 0
test/Services/FunctionalTests/Services/Catalog/settings.json View File

@ -0,0 +1,7 @@
{
"ConnectionString": "Server=tcp:127.0.0.1,5433;Initial Catalog=Microsoft.eShopOnContainers.Services.CatalogDb;User Id=sa;Password=Pass@word",
"ExternalCatalogBaseUrl": "http://localhost:5101",
"IdentityUrl": "http://localhost:5105",
"isTest": "true",
"EventBusConnection": "localhost"
}

+ 1
- 1
test/Services/FunctionalTests/Services/Ordering/OrderingScenariosBase.cs View File

@ -12,7 +12,7 @@ namespace FunctionalTests.Services.Ordering
public TestServer CreateServer() public TestServer CreateServer()
{ {
var webHostBuilder = new WebHostBuilder(); var webHostBuilder = new WebHostBuilder();
webHostBuilder.UseContentRoot(Directory.GetCurrentDirectory());
webHostBuilder.UseContentRoot(Directory.GetCurrentDirectory() + "\\Services\\Ordering");
webHostBuilder.UseStartup<OrderingTestsStartup>(); webHostBuilder.UseStartup<OrderingTestsStartup>();
return new TestServer(webHostBuilder); return new TestServer(webHostBuilder);


test/Services/FunctionalTests/settings.json → test/Services/FunctionalTests/Services/Ordering/settings.json View File


+ 9
- 2
test/Services/IntegrationTests/IntegrationTests.csproj View File

@ -12,9 +12,16 @@
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute> <GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<None Remove="Services\Catalog\settings.json" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<!--<Content Include="settings.json;web.config">--> <!--<Content Include="settings.json;web.config">-->
<Content Include="settings.json">
<Content Include="Services\Catalog\settings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Services\Ordering\settings.json">
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory> <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content> </Content>
</ItemGroup> </ItemGroup>
@ -35,7 +42,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Update="settings.json">
<Content Update="Services\Ordering\settings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
</ItemGroup> </ItemGroup>


+ 1
- 1
test/Services/IntegrationTests/Services/Catalog/CatalogScenarioBase.cs View File

@ -12,7 +12,7 @@ namespace IntegrationTests.Services.Catalog
public TestServer CreateServer() public TestServer CreateServer()
{ {
var webHostBuilder = new WebHostBuilder(); var webHostBuilder = new WebHostBuilder();
webHostBuilder.UseContentRoot(Directory.GetCurrentDirectory());
webHostBuilder.UseContentRoot(Directory.GetCurrentDirectory() + "\\Services\\Catalog");
webHostBuilder.UseStartup<Startup>(); webHostBuilder.UseStartup<Startup>();
return new TestServer(webHostBuilder); return new TestServer(webHostBuilder);


+ 6
- 0
test/Services/IntegrationTests/Services/Catalog/settings.json View File

@ -0,0 +1,6 @@
{
"ConnectionString": "Server=tcp:127.0.0.1,5433;Initial Catalog=Microsoft.eShopOnContainers.Services.CatalogDb;User Id=sa;Password=Pass@word",
"ExternalCatalogBaseUrl": "http://localhost:5101",
"IdentityUrl": "http://localhost:5105",
"isTest": "true"
}

+ 1
- 1
test/Services/IntegrationTests/Services/Ordering/OrderingScenarioBase.cs View File

@ -10,7 +10,7 @@
public TestServer CreateServer() public TestServer CreateServer()
{ {
var webHostBuilder = new WebHostBuilder(); var webHostBuilder = new WebHostBuilder();
webHostBuilder.UseContentRoot(Directory.GetCurrentDirectory());
webHostBuilder.UseContentRoot(Directory.GetCurrentDirectory() + "\\Services\\Ordering");
webHostBuilder.UseStartup<OrderingTestsStartup>(); webHostBuilder.UseStartup<OrderingTestsStartup>();
return new TestServer(webHostBuilder); return new TestServer(webHostBuilder);


test/Services/IntegrationTests/settings.json → test/Services/IntegrationTests/Services/Ordering/settings.json View File


Loading…
Cancel
Save