- Include root in valid directories

- AppSetting bug fix

- Updated testes with base test class and editor configuration changes

- Created new server and wafer counter tasks json files and pipelines to match
This commit is contained in:
2025-07-29 16:56:09 -07:00
parent 6f52566fc2
commit a427c5648a
49 changed files with 1680 additions and 822 deletions

View File

@ -9,14 +9,14 @@ using System.Collections.ObjectModel;
namespace OI.Metrology.Tests;
[TestClass]
public class UnitTestFileShareController
public class UnitTestFileShareController : BaseTestClass
{
#pragma warning disable CS8618
private static ILogger? _Logger;
private static string _ControllerName;
private static string? _TestContextTestName;
public TestContext TestContext { get; set; }
private static WebApplicationFactory<Wafer.Counter.Program>? _WebApplicationFactory;
#pragma warning restore
@ -24,7 +24,6 @@ public class UnitTestFileShareController
[ClassInitialize]
public static void ClassInitAsync(TestContext testContext)
{
_TestContextTestName = testContext.TestName;
_WebApplicationFactory = new WebApplicationFactory<Wafer.Counter.Program>();
IServiceProvider serviceProvider = _WebApplicationFactory.Services.CreateScope().ServiceProvider;
_Logger = serviceProvider.GetRequiredService<ILogger<Wafer.Counter.Program>>();
@ -39,12 +38,19 @@ public class UnitTestFileShareController
catch (Exception) { }
}
[TestCleanup]
public void TestCleanup()
{
if (TestContext.CurrentTestOutcome == UnitTestOutcome.Failed)
IncrementFailedTests();
}
[TestMethod]
public void TestControllerName()
{
_Logger?.LogInformation("Starting Web Application");
Assert.AreEqual(IFileShareController<string>.GetRouteName(), _ControllerName);
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
_Logger?.LogInformation("{TestName} completed", TestContext.TestName);
NonThrowTryCatch();
}
@ -54,10 +60,10 @@ public class UnitTestFileShareController
{
HttpClient? httpClient = _WebApplicationFactory?.CreateClient();
_Logger?.LogInformation("Starting Web Application");
Assert.IsTrue(httpClient is not null);
Assert.IsNotNull(httpClient);
string? response = await httpClient.GetStringAsync($"api/v1/file-share/copy-file/?from=\\\\mesfs.infineon.com\\EC_Metrology_Si\\MetrologyAttachments\\CDERunHeader_\\2024\\WW11\\247233\\CDE5_240315162756858.pdsf&to=\\\\messa01ec.infineon.com\\apps\\Metrology\\MET08RESIMAPCDE\\Test\\a.pdsf");
Assert.IsNotNull(response);
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
_Logger?.LogInformation("{TestName} completed", TestContext.TestName);
NonThrowTryCatch();
}
@ -67,25 +73,29 @@ public class UnitTestFileShareController
{
HttpClient? httpClient = _WebApplicationFactory?.CreateClient();
_Logger?.LogInformation("Starting Web Application");
Assert.IsTrue(httpClient is not null);
Assert.IsNotNull(httpClient);
string? response = await httpClient.GetStringAsync($"api/v1/file-share/move-file/?from=\\\\mesfs.infineon.com\\EC_Metrology_Si\\MetrologyAttachments\\CDERunHeader_\\2024\\WW11\\247233\\CDE5_240315162756858.pdsf&to=\\\\messa01ec.infineon.com\\apps\\Metrology\\MET08RESIMAPCDE\\Test\\a.pdsf");
Assert.IsNotNull(response);
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
_Logger?.LogInformation("{TestName} completed", TestContext.TestName);
NonThrowTryCatch();
}
[Ignore]
[TestMethod]
public async Task FileWriteApi()
{
HttpClient? httpClient = _WebApplicationFactory?.CreateClient();
_Logger?.LogInformation("Starting Web Application");
Assert.IsTrue(httpClient is not null);
Assert.IsNotNull(httpClient);
string? response = await httpClient.GetStringAsync($"api/v1/file-share/file-write/?path=\\\\messa01ec.infineon.com\\apps\\Metrology\\MET08RESIMAPCDE\\Test\\b.pdsf&contents=b");
Assert.IsNotNull(response);
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
_Logger?.LogInformation("{TestName} completed", TestContext.TestName);
NonThrowTryCatch();
}
#if DEBUG
[Ignore]
#endif
[TestMethod]
public void GetArchiveData()
{
@ -94,7 +104,7 @@ public class UnitTestFileShareController
CharacterizationParameters characterizationParameters;
IServiceProvider? serviceProvider = _WebApplicationFactory?.Services.CreateScope().ServiceProvider;
IFileShareRepository? fileShareRepository = serviceProvider?.GetRequiredService<IFileShareRepository>();
characterizationParameters = new("FQA", "FQA-8INCH", "*.wc", null, null, "8INCH");
characterizationParameters = new("MU", "MU-6INCH", "*.wc", null, null, "6INCH");
result = fileShareRepository?.GetArchiveData(characterizationParameters);
Assert.IsNotNull(result);
characterizationParameters = new(string.Empty, "BIORAD4", "BIO*.json", null, null, "8INCH");
@ -103,22 +113,28 @@ public class UnitTestFileShareController
characterizationParameters = new(string.Empty, "CDE5", "CDE*.json", null, null, "8INCH");
result = fileShareRepository?.GetArchiveData(characterizationParameters);
Assert.IsNotNull(result);
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
_Logger?.LogInformation("{TestName} completed", TestContext.TestName);
NonThrowTryCatch();
}
#if DEBUG
[Ignore]
#endif
[TestMethod]
public async Task ArchiveDataApi()
{
HttpClient? httpClient = _WebApplicationFactory?.CreateClient();
_Logger?.LogInformation("Starting Web Application");
Assert.IsTrue(httpClient is not null);
Assert.IsNotNull(httpClient);
string? response = await httpClient.GetStringAsync($"api/v1/file-share/archive-data/?area=FQA&equipment-id=FQA-8INCH&search-pattern=*.wc&wafer-size=8INCH");
Assert.IsNotNull(response);
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
_Logger?.LogInformation("{TestName} completed", TestContext.TestName);
NonThrowTryCatch();
}
#if DEBUG
[Ignore]
#endif
[TestMethod]
public void EquipmentIds()
{
@ -127,19 +143,22 @@ public class UnitTestFileShareController
IFileShareRepository? fileShareRepository = serviceProvider?.GetRequiredService<IFileShareRepository>();
ReadOnlyCollection<ToolTypeNameId>? result = fileShareRepository?.GetEquipmentIds();
Assert.IsNotNull(result);
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
_Logger?.LogInformation("{TestName} completed", TestContext.TestName);
NonThrowTryCatch();
}
#if DEBUG
[Ignore]
#endif
[TestMethod]
public async Task EquipmentIdsApi()
{
HttpClient? httpClient = _WebApplicationFactory?.CreateClient();
_Logger?.LogInformation("Starting Web Application");
Assert.IsTrue(httpClient is not null);
Assert.IsNotNull(httpClient);
string? response = await httpClient.GetStringAsync($"api/v1/file-share/equipment-ids");
Assert.IsNotNull(response);
_Logger?.LogInformation("{TestName} completed", _TestContextTestName);
_Logger?.LogInformation("{TestName} completed", TestContext.TestName);
NonThrowTryCatch();
}