Skip to content

Commit

Permalink
Merge pull request stratisproject#229 from fassadlr/fix-ci
Browse files Browse the repository at this point in the history
[Tests] Fix CI issue; Create CA tests common project
  • Loading branch information
codingupastorm authored Feb 28, 2020
2 parents bbd8088 + d29f133 commit 242a3ca
Show file tree
Hide file tree
Showing 13 changed files with 39 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
using Microsoft.Extensions.DependencyInjection;
using Stratis.Feature.PoA.Tokenless;

namespace CertificateAuthority.Tests
namespace CertificateAuthority.Tests.Common
{
public static class CaTestHelper
{
Expand Down Expand Up @@ -64,7 +64,7 @@ public static CredentialsModel CreateAccount(IWebHost server, AccountAccessFlags
return new CredentialsModel(id, password);
}

internal static void InitializeCa(TestServer server)
public static void InitializeCa(TestServer server)
{
var network = new TokenlessNetwork();

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<ApplicationIcon />
<StartupObject />
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="5.10.2" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="2.1.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\CertificateAuthority.API\CertificateAuthority.API.csproj" />
<ProjectReference Include="..\CertificateAuthority\CertificateAuthority.csproj" />
<ProjectReference Include="..\Stratis.Feature.PoA.Tokenless\Stratis.Feature.PoA.Tokenless.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;

namespace CertificateAuthority.Tests
namespace CertificateAuthority.Tests.Common
{
public class TestOnlyStartup : Startup
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.12" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="2.1.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="xunit" Version="2.4.1" />
Expand All @@ -23,6 +22,7 @@

<ItemGroup>
<ProjectReference Include="..\CertificateAuthority.API\CertificateAuthority.API.csproj" />
<ProjectReference Include="..\CertificateAuthority.Tests.Common\CertificateAuthority.Tests.Common.csproj" />
<ProjectReference Include="..\CertificateAuthority\CertificateAuthority.csproj" />
<ProjectReference Include="..\Stratis.Bitcoin.IntegrationTests.Common\Stratis.Bitcoin.IntegrationTests.Common.csproj" />
<ProjectReference Include="..\Stratis.Bitcoin.Networks\Stratis.Bitcoin.Networks.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using CertificateAuthority.Controllers;
using CertificateAuthority.Database;
using CertificateAuthority.Models;
using CertificateAuthority.Tests.Common;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.TestHost;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Security.Cryptography.X509Certificates;
using CertificateAuthority.Controllers;
using CertificateAuthority.Models;
using CertificateAuthority.Tests.Common;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.TestHost;
using NBitcoin;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using CertificateAuthority.Controllers;
using CertificateAuthority.Database;
using CertificateAuthority.Models;
using CertificateAuthority.Tests.Common;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.TestHost;
Expand Down
7 changes: 7 additions & 0 deletions src/Stratis.DLT.sln
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CertificateAuthority.Tests"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CertificateAuthority.API", "CertificateAuthority.API\CertificateAuthority.API.csproj", "{5A0A1334-49E2-4EE1-94E5-91E65D8805F6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CertificateAuthority.Tests.Common", "CertificateAuthority.Tests.Common\CertificateAuthority.Tests.Common.csproj", "{7A1A920F-88C7-4087-90FA-CE3E086A2ED2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -352,6 +354,10 @@ Global
{5A0A1334-49E2-4EE1-94E5-91E65D8805F6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5A0A1334-49E2-4EE1-94E5-91E65D8805F6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5A0A1334-49E2-4EE1-94E5-91E65D8805F6}.Release|Any CPU.Build.0 = Release|Any CPU
{7A1A920F-88C7-4087-90FA-CE3E086A2ED2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7A1A920F-88C7-4087-90FA-CE3E086A2ED2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7A1A920F-88C7-4087-90FA-CE3E086A2ED2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7A1A920F-88C7-4087-90FA-CE3E086A2ED2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -407,6 +413,7 @@ Global
{EE3A494D-5AAC-4A61-B993-5056A6D1C3A3} = {1B9A916F-DDAC-4675-B424-EDEDC1A58231}
{85EA24B1-DB43-46E0-8602-4847CABC17C6} = {1B9A916F-DDAC-4675-B424-EDEDC1A58231}
{5A0A1334-49E2-4EE1-94E5-91E65D8805F6} = {1B9A916F-DDAC-4675-B424-EDEDC1A58231}
{7A1A920F-88C7-4087-90FA-CE3E086A2ED2} = {1B9A916F-DDAC-4675-B424-EDEDC1A58231}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {6C780ABA-5872-4B83-AD3F-A5BD423AD907}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@

<ItemGroup>
<ProjectReference Include="..\CertificateAuthority.API\CertificateAuthority.API.csproj" />
<ProjectReference Include="..\CertificateAuthority.Tests\CertificateAuthority.Tests.csproj" />
<ProjectReference Include="..\NBitcoin\NBitcoin.csproj" />
<ProjectReference Include="..\Stratis.Bitcoin.Features.PoA.IntegrationTests.Common\Stratis.Bitcoin.Features.PoA.IntegrationTests.Common.csproj" />
<ProjectReference Include="..\Stratis.Bitcoin.Features.SmartContracts\Stratis.Bitcoin.Features.SmartContracts.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using System.Threading.Tasks;
using CertificateAuthority;
using CertificateAuthority.Models;
using CertificateAuthority.Tests;
using CertificateAuthority.Tests.Common;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using CertificateAuthority;
using CertificateAuthority.Tests;
using CertificateAuthority.Tests.Common;
using NBitcoin;
using Stratis.Bitcoin;
using Stratis.Bitcoin.Base;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Runtime.CompilerServices;
using CertificateAuthority;
using CertificateAuthority.Models;
using CertificateAuthority.Tests;
using CertificateAuthority.Tests.Common;
using Microsoft.Extensions.Logging;
using NBitcoin;
using Org.BouncyCastle.X509;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\CertificateAuthority.Tests\CertificateAuthority.Tests.csproj" />
<ProjectReference Include="..\CertificateAuthority.Tests.Common\CertificateAuthority.Tests.Common.csproj" />
<ProjectReference Include="..\Stratis.Bitcoin.Features.PoA.IntegrationTests.Common\Stratis.Bitcoin.Features.PoA.IntegrationTests.Common.csproj" />
<ProjectReference Include="..\Stratis.Bitcoin.Features.SmartContracts\Stratis.Bitcoin.Features.SmartContracts.csproj" />
<ProjectReference Include="..\Stratis.Bitcoin.IntegrationTests.Common\Stratis.Bitcoin.IntegrationTests.Common.csproj" />
Expand Down

0 comments on commit 242a3ca

Please sign in to comment.