Test Dev Pipeline
This commit is contained in:
parent
1e1d4803b2
commit
b7447b207f
6
Server/Data/Tests/GetPinnedTableApi.json
Normal file
6
Server/Data/Tests/GetPinnedTableApi.json
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
{
|
||||||
|
"Results": [],
|
||||||
|
"TotalRows": 0
|
||||||
|
}
|
||||||
|
}
|
@ -97,6 +97,9 @@
|
|||||||
<None Include="Data\Tests\GetIpAddressApi.json">
|
<None Include="Data\Tests\GetIpAddressApi.json">
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
|
<None Include="Data\Tests\GetPinnedTableApi.json">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
<None Include="Data\Tests\GetToolTypeMetadataApi.json">
|
<None Include="Data\Tests\GetToolTypeMetadataApi.json">
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
{
|
{
|
||||||
"xApiUrl": "http://messa010ec.ec.local:50301/api",
|
"xApiUrl": "http://messa010ec.ec.local:50301/api",
|
||||||
"ApiUrl": "http://localhost:5126/api",
|
"ApiUrl": "http://localhost:5126/api",
|
||||||
"ConnectionString": "Data Source=messv01ec.ec.local\\PROD1,53959;Integrated Security=True;Initial Catalog=Metrology;",
|
"xxxApiUrl": "http://localhost:50301/api",
|
||||||
"xConnectionString": "Data Source=MESSAD1001\\TEST1,59583;Integrated Security=True;Initial Catalog=Metrology;",
|
"xxxxApiUrl": "http://messa010ec.ec.local:50301/api",
|
||||||
|
"ConnectionString": "Data Source=MESSAD1001\\TEST1,59583;Integrated Security=True;Initial Catalog=Metrology;",
|
||||||
|
"xConnectionString": "Data Source=messv01ec.ec.local\\PROD1,53959;Integrated Security=True;Initial Catalog=Metrology;",
|
||||||
"IsDevelopment": true,
|
"IsDevelopment": true,
|
||||||
"xMockRoot": "/Data/Tests",
|
"xMockRoot": "/Data/Tests",
|
||||||
"MockRoot": "",
|
"MockRoot": "",
|
||||||
|
@ -37,7 +37,7 @@ public class UnitTestPinController
|
|||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void GetHeaderTitles()
|
public void GetPinnedTable()
|
||||||
{
|
{
|
||||||
_Logger.Information("Starting Web Application");
|
_Logger.Information("Starting Web Application");
|
||||||
IServiceProvider serviceProvider = _WebApplicationFactory.Services.CreateScope().ServiceProvider;
|
IServiceProvider serviceProvider = _WebApplicationFactory.Services.CreateScope().ServiceProvider;
|
||||||
@ -45,20 +45,18 @@ public class UnitTestPinController
|
|||||||
IPinRepository pinRepository = serviceProvider.GetRequiredService<IPinRepository>();
|
IPinRepository pinRepository = serviceProvider.GetRequiredService<IPinRepository>();
|
||||||
Result<Pinned[]> result = pinRepository.GetPinnedTable(metrologyRepository, id: 1, cde_id: null, biorad_id: null, rds: null);
|
Result<Pinned[]> result = pinRepository.GetPinnedTable(metrologyRepository, id: 1, cde_id: null, biorad_id: null, rds: null);
|
||||||
Assert.IsNotNull(result?.Results);
|
Assert.IsNotNull(result?.Results);
|
||||||
Assert.IsTrue(result.Results.Any());
|
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public async Task GetHeaderTitlesApi()
|
public async Task GetPinnedTableApi()
|
||||||
{
|
{
|
||||||
HttpClient httpClient = _WebApplicationFactory.CreateClient();
|
HttpClient httpClient = _WebApplicationFactory.CreateClient();
|
||||||
_Logger.Information("Starting Web Application");
|
_Logger.Information("Starting Web Application");
|
||||||
string? json = await httpClient.GetStringAsync($"api/{_ControllerName}/-1/headertitles");
|
string? json = await httpClient.GetStringAsync($"api/{_ControllerName}/-1/pinned");
|
||||||
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{nameof(GetHeaderTitlesApi)}.json"), json);
|
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{nameof(GetPinnedTableApi)}.json"), json);
|
||||||
Result<Pinned[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<Pinned[]>>(json);
|
Result<Pinned[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<Pinned[]>>(json);
|
||||||
Assert.IsNotNull(result?.Results);
|
Assert.IsNotNull(result?.Results);
|
||||||
Assert.IsTrue(result.Results.Any());
|
|
||||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,10 +77,14 @@ steps:
|
|||||||
workingDirectory: Server
|
workingDirectory: Server
|
||||||
displayName: "Core Build - Server"
|
displayName: "Core Build - Server"
|
||||||
|
|
||||||
|
- powershell: Get-ChildItem .\ -include TestResults -Recurse | foreach ($_) { remove-item $_.fullname -Force -Recurse }
|
||||||
|
workingDirectory: "$(System.DefaultWorkingDirectory)/.vscode"
|
||||||
|
displayName: 'PowerShell Script'
|
||||||
|
|
||||||
- script: "dotnet test --configuration $(Configuration)"
|
- script: "dotnet test --configuration $(Configuration)"
|
||||||
workingDirectory: Tests
|
workingDirectory: Tests
|
||||||
displayName: "Core Test"
|
displayName: "Core Test"
|
||||||
enabled: false
|
# enabled: false
|
||||||
|
|
||||||
- script: '"C:\program files\dotnet\dotnet.exe" tool restore'
|
- script: '"C:\program files\dotnet\dotnet.exe" tool restore'
|
||||||
workingDirectory: Server
|
workingDirectory: Server
|
||||||
@ -92,6 +96,22 @@ steps:
|
|||||||
displayName: "Report Generator"
|
displayName: "Report Generator"
|
||||||
enabled: false
|
enabled: false
|
||||||
|
|
||||||
|
- task: PublishTestResults@2
|
||||||
|
displayName: "Publish Test Results **/*.trx"
|
||||||
|
inputs:
|
||||||
|
testResultsFormat: VSTest
|
||||||
|
testResultsFiles: "**/*.trx"
|
||||||
|
searchFolder: "$(System.DefaultWorkingDirectory)/.vscode"
|
||||||
|
|
||||||
|
- task: mspremier.CreateWorkItem.CreateWorkItem-task.CreateWorkItem@1
|
||||||
|
displayName: "Create work item"
|
||||||
|
inputs:
|
||||||
|
teamProject: "Mesa_FI"
|
||||||
|
workItemType: Bug
|
||||||
|
title: $(GitCommitSeven)-$(Build.BuildId)-$(Build.Repository.Name)-$(Configuration)
|
||||||
|
assignedTo: "$(Build.RequestedForId)"
|
||||||
|
enabled: false
|
||||||
|
|
||||||
- script: '"C:\program files\dotnet\dotnet.exe" publish --configuration $(Configuration) --runtime win-x64 --self-contained -o $(Build.ArtifactStagingDirectory)\Server --source $(NugetSource)'
|
- script: '"C:\program files\dotnet\dotnet.exe" publish --configuration $(Configuration) --runtime win-x64 --self-contained -o $(Build.ArtifactStagingDirectory)\Server --source $(NugetSource)'
|
||||||
workingDirectory: Server
|
workingDirectory: Server
|
||||||
displayName: "Core Publish"
|
displayName: "Core Publish"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user