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">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Data\Tests\GetPinnedTableApi.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Data\Tests\GetToolTypeMetadataApi.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
|
@ -1,8 +1,10 @@
|
||||
{
|
||||
"xApiUrl": "http://messa010ec.ec.local:50301/api",
|
||||
"ApiUrl": "http://localhost:5126/api",
|
||||
"ConnectionString": "Data Source=messv01ec.ec.local\\PROD1,53959;Integrated Security=True;Initial Catalog=Metrology;",
|
||||
"xConnectionString": "Data Source=MESSAD1001\\TEST1,59583;Integrated Security=True;Initial Catalog=Metrology;",
|
||||
"xxxApiUrl": "http://localhost:50301/api",
|
||||
"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,
|
||||
"xMockRoot": "/Data/Tests",
|
||||
"MockRoot": "",
|
||||
|
@ -37,7 +37,7 @@ public class UnitTestPinController
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void GetHeaderTitles()
|
||||
public void GetPinnedTable()
|
||||
{
|
||||
_Logger.Information("Starting Web Application");
|
||||
IServiceProvider serviceProvider = _WebApplicationFactory.Services.CreateScope().ServiceProvider;
|
||||
@ -45,20 +45,18 @@ public class UnitTestPinController
|
||||
IPinRepository pinRepository = serviceProvider.GetRequiredService<IPinRepository>();
|
||||
Result<Pinned[]> result = pinRepository.GetPinnedTable(metrologyRepository, id: 1, cde_id: null, biorad_id: null, rds: null);
|
||||
Assert.IsNotNull(result?.Results);
|
||||
Assert.IsTrue(result.Results.Any());
|
||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public async Task GetHeaderTitlesApi()
|
||||
public async Task GetPinnedTableApi()
|
||||
{
|
||||
HttpClient httpClient = _WebApplicationFactory.CreateClient();
|
||||
_Logger.Information("Starting Web Application");
|
||||
string? json = await httpClient.GetStringAsync($"api/{_ControllerName}/-1/headertitles");
|
||||
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{nameof(GetHeaderTitlesApi)}.json"), json);
|
||||
string? json = await httpClient.GetStringAsync($"api/{_ControllerName}/-1/pinned");
|
||||
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{nameof(GetPinnedTableApi)}.json"), json);
|
||||
Result<Pinned[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<Pinned[]>>(json);
|
||||
Assert.IsNotNull(result?.Results);
|
||||
Assert.IsTrue(result.Results.Any());
|
||||
_Logger.Information($"{_TestContext?.TestName} completed");
|
||||
}
|
||||
|
||||
|
@ -77,10 +77,14 @@ steps:
|
||||
workingDirectory: 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)"
|
||||
workingDirectory: Tests
|
||||
displayName: "Core Test"
|
||||
enabled: false
|
||||
# enabled: false
|
||||
|
||||
- script: '"C:\program files\dotnet\dotnet.exe" tool restore'
|
||||
workingDirectory: Server
|
||||
@ -92,6 +96,22 @@ steps:
|
||||
displayName: "Report Generator"
|
||||
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)'
|
||||
workingDirectory: Server
|
||||
displayName: "Core Publish"
|
||||
|
Loading…
x
Reference in New Issue
Block a user