From f798e594513af67ce7dba1efedb7824a90677b3c Mon Sep 17 00:00:00 2001 From: Mike Phares Date: Mon, 29 Apr 2024 15:24:34 -0700 Subject: [PATCH] Tests Failed --- Adaptation/.vscode/tasks.json | 24 ++++++- Adaptation/FileHandlers/Archive/FileRead.cs | 6 +- .../FileHandlers/wc/WaferCounterHelper.cs | 2 +- Adaptation/MET08AWCT.Tests.csproj | 3 + .../Development/v2.52.0/WC6INCH1-EQPT.cs | 6 +- .../Development/v2.56.0/WC6INCH1-EQPT.cs | 65 +++++++++++++++++++ .../Development/v2.52.0/WC6INCH1-EQPT.cs | 8 ++- .../Development/v2.56.0/WC6INCH1-EQPT.cs | 64 ++++++++++++++++++ Adaptation/_Tests/Static/MET08AWCT.cs | 6 +- Adaptation/_Tests/Static/WC.cs | 30 +++++---- MET08AWCT.csproj | 5 +- 11 files changed, 195 insertions(+), 24 deletions(-) create mode 100644 Adaptation/_Tests/CreateSelfDescription/Development/v2.56.0/WC6INCH1-EQPT.cs create mode 100644 Adaptation/_Tests/Extract/Development/v2.56.0/WC6INCH1-EQPT.cs diff --git a/Adaptation/.vscode/tasks.json b/Adaptation/.vscode/tasks.json index 77e77d8..d5cd461 100644 --- a/Adaptation/.vscode/tasks.json +++ b/Adaptation/.vscode/tasks.json @@ -12,6 +12,28 @@ ], "problemMatcher": "$msCompile" }, + { + "label": "Test-Debug", + "command": "dotnet", + "type": "process", + "args": [ + "test", + "-c", + "Debug" + ], + "problemMatcher": "$msCompile" + }, + { + "label": "Test-Release", + "command": "dotnet", + "type": "process", + "args": [ + "test", + "-c", + "Release" + ], + "problemMatcher": "$msCompile" + }, { "label": "Format", "command": "dotnet", @@ -46,7 +68,7 @@ "args": [ "/target:Build", "/restore:True", - "/p:RestoreSources=https://api.nuget.org/v3/index.json%3Bhttps://packagemanagement.eu.infineon.com:4430/api/v2/%3Bhttps://tfs.intra.infineon.com/tfs/ManufacturingIT/_packaging/eaf/nuget/v3/index.json%3Bhttps://localhost/v3/index.json", + "/p:RestoreSources=https://artifactory.intra.infineon.com/artifactory/api/nuget/ngt-fi-package-main-vir/%3Bhttps://packagemanagement.eu.infineon.com:4430/api/v2/%3Bhttps://tfs.intra.infineon.com/tfs/ManufacturingIT/_packaging/eaf/nuget/v3/index.json%3Bhttps://tfs.intra.infineon.com/tfs/FactoryIntegration/_packaging/EAF%40Local/nuget/v3/index.json%3Bhttps://api.nuget.org/v3/index.json", "/detailedsummary", "/consoleloggerparameters:PerformanceSummary;ErrorsOnly;", "/property:Configuration=Debug;TargetFrameworkVersion=v4.8", diff --git a/Adaptation/FileHandlers/Archive/FileRead.cs b/Adaptation/FileHandlers/Archive/FileRead.cs index 0dbe06e..392e3af 100644 --- a/Adaptation/FileHandlers/Archive/FileRead.cs +++ b/Adaptation/FileHandlers/Archive/FileRead.cs @@ -148,7 +148,7 @@ public class FileRead : Shared.FileRead, IFileRead } } - private static void NetworkStreamDataAvailable(string cellInstanceName, FileConnectorConfiguration fileConnectorConfiguration, Calendar calendar, NetworkStream networkStream) + private static void NetworkStreamDataAvailable(NetworkStream networkStream) { int length; string read; @@ -170,7 +170,7 @@ public class FileRead : Shared.FileRead, IFileRead throw new NotImplementedException(); } - private void Callback() + private static void Callback() { if (_NetworkStream is not null && _NetworkStream.CanRead) { @@ -179,7 +179,7 @@ public class FileRead : Shared.FileRead, IFileRead if (_PropertyInfo.GetValue(_NetworkStream) is not Socket socket) throw new NotSupportedException(); if (socket.Connected && _NetworkStream.DataAvailable) - NetworkStreamDataAvailable(_CellInstanceName, _FileConnectorConfiguration, _Calendar, _NetworkStream); + NetworkStreamDataAvailable(_NetworkStream); } } diff --git a/Adaptation/FileHandlers/wc/WaferCounterHelper.cs b/Adaptation/FileHandlers/wc/WaferCounterHelper.cs index a3f78c8..77d94de 100644 --- a/Adaptation/FileHandlers/wc/WaferCounterHelper.cs +++ b/Adaptation/FileHandlers/wc/WaferCounterHelper.cs @@ -313,7 +313,7 @@ public class WaferCounterHelper } private static string GetWaferSizeDirectory(string area, string waferSize) => - Path.Combine(_Directory, area, waferSize); + Path.Combine(_Directory ?? throw new NotSupportedException(), area, waferSize); internal static string GetLastQuantityAndSlotMap(string area, string waferSize) { diff --git a/Adaptation/MET08AWCT.Tests.csproj b/Adaptation/MET08AWCT.Tests.csproj index d21dddb..c3a4882 100644 --- a/Adaptation/MET08AWCT.Tests.csproj +++ b/Adaptation/MET08AWCT.Tests.csproj @@ -31,6 +31,9 @@ Linux + + + diff --git a/Adaptation/_Tests/CreateSelfDescription/Development/v2.52.0/WC6INCH1-EQPT.cs b/Adaptation/_Tests/CreateSelfDescription/Development/v2.52.0/WC6INCH1-EQPT.cs index eece662..362a067 100644 --- a/Adaptation/_Tests/CreateSelfDescription/Development/v2.52.0/WC6INCH1-EQPT.cs +++ b/Adaptation/_Tests/CreateSelfDescription/Development/v2.52.0/WC6INCH1-EQPT.cs @@ -1,3 +1,4 @@ +#if v2_52_0 using Adaptation._Tests.Shared; using Microsoft.Extensions.Logging; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -47,7 +48,9 @@ public class WC6INCH1_EQPT : EAFLoggingUnitTesting EAFLoggingUnitTesting?.Dispose(); } +#if DEBUG [Ignore] +#endif [TestMethod] public void Staging__v2_52_0__WC6INCH1_EQPT__ConvertExcelToJson() { @@ -58,4 +61,5 @@ public class WC6INCH1_EQPT : EAFLoggingUnitTesting EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/Adaptation/_Tests/CreateSelfDescription/Development/v2.56.0/WC6INCH1-EQPT.cs b/Adaptation/_Tests/CreateSelfDescription/Development/v2.56.0/WC6INCH1-EQPT.cs new file mode 100644 index 0000000..780a756 --- /dev/null +++ b/Adaptation/_Tests/CreateSelfDescription/Development/v2.56.0/WC6INCH1-EQPT.cs @@ -0,0 +1,65 @@ +#if true +using Adaptation._Tests.Shared; +using Microsoft.Extensions.Logging; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; +using System.Diagnostics; +using System.IO; +using System.Reflection; + +namespace Adaptation._Tests.CreateSelfDescription.Development.v2_56_0; + +[TestClass] +public class WC6INCH1_EQPT : EAFLoggingUnitTesting +{ + +#pragma warning disable CA2254 +#pragma warning disable IDE0060 + + internal static string DummyRoot { get; private set; } + internal static WC6INCH1_EQPT EAFLoggingUnitTesting { get; private set; } + + static WC6INCH1_EQPT() => DummyRoot = @"\\mesfs.infineon.com\EC_Characterization_Si\Dummy"; + + public WC6INCH1_EQPT() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false) + { + if (EAFLoggingUnitTesting is null) + throw new Exception(); + } + + public WC6INCH1_EQPT(TestContext testContext) : base(DummyRoot, testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false) + { + } + + [ClassInitialize] + public static void ClassInitialize(TestContext testContext) + { + EAFLoggingUnitTesting ??= new WC6INCH1_EQPT(testContext); + EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(testContext.TestName, " - ClassInitialize")); + string[] fileNameAndText = EAFLoggingUnitTesting.AdaptationTesting.GetCSharpText(testContext.TestName); + File.WriteAllText(fileNameAndText[0], fileNameAndText[1]); + File.WriteAllText(fileNameAndText[2], fileNameAndText[3]); + } + + [ClassCleanup()] + public static void ClassCleanup() + { + EAFLoggingUnitTesting.Logger?.LogInformation("Cleanup"); + EAFLoggingUnitTesting?.Dispose(); + } + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_56_0__WC6INCH1_EQPT__ConvertExcelToJson() + { + string check = "*.wc"; + MethodBase methodBase = new StackFrame().GetMethod(); + EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration")); + _ = AdaptationTesting.GetWriteConfigurationGetFileRead(methodBase, check, EAFLoggingUnitTesting.AdaptationTesting); + EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); + } + +} +#endif \ No newline at end of file diff --git a/Adaptation/_Tests/Extract/Development/v2.52.0/WC6INCH1-EQPT.cs b/Adaptation/_Tests/Extract/Development/v2.52.0/WC6INCH1-EQPT.cs index 0e676b2..1d96138 100644 --- a/Adaptation/_Tests/Extract/Development/v2.52.0/WC6INCH1-EQPT.cs +++ b/Adaptation/_Tests/Extract/Development/v2.52.0/WC6INCH1-EQPT.cs @@ -1,3 +1,4 @@ +#if v2_52_0 using Adaptation.Shared; using Adaptation.Shared.Methods; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -33,11 +34,15 @@ public class WC6INCH1_EQPT catch (Exception) { } } +#if DEBUG [Ignore] +#endif [TestMethod] public void Staging__v2_52_0__WC6INCH1_EQPT__ConvertExcelToJson() => _WC6INCH1_EQPT.Staging__v2_52_0__WC6INCH1_EQPT__ConvertExcelToJson(); +#if DEBUG [Ignore] +#endif [TestMethod] public void Staging__v2_52_0__WC6INCH1_EQPT__ConvertExcelToJson637961178824025822__Normal() { @@ -55,4 +60,5 @@ public class WC6INCH1_EQPT NonThrowTryCatch(); } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/Adaptation/_Tests/Extract/Development/v2.56.0/WC6INCH1-EQPT.cs b/Adaptation/_Tests/Extract/Development/v2.56.0/WC6INCH1-EQPT.cs new file mode 100644 index 0000000..0f5a156 --- /dev/null +++ b/Adaptation/_Tests/Extract/Development/v2.56.0/WC6INCH1-EQPT.cs @@ -0,0 +1,64 @@ +#if true +using Adaptation.Shared; +using Adaptation.Shared.Methods; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Reflection; +using System.Text.Json; + +namespace Adaptation._Tests.Extract.Development.v2_56_0; + +[TestClass] +public class WC6INCH1_EQPT +{ + +#pragma warning disable CA2254 +#pragma warning disable IDE0060 + + private static CreateSelfDescription.Development.v2_56_0.WC6INCH1_EQPT _WC6INCH1_EQPT; + + [ClassInitialize] + public static void ClassInitialize(TestContext testContext) + { + CreateSelfDescription.Development.v2_56_0.WC6INCH1_EQPT.ClassInitialize(testContext); + _WC6INCH1_EQPT = CreateSelfDescription.Development.v2_56_0.WC6INCH1_EQPT.EAFLoggingUnitTesting; + } + + private static void NonThrowTryCatch() + { + try + { throw new Exception(); } + catch (Exception) { } + } + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_56_0__WC6INCH1_EQPT__ConvertExcelToJson() => _WC6INCH1_EQPT.Staging__v2_56_0__WC6INCH1_EQPT__ConvertExcelToJson(); + +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Staging__v2_56_0__WC6INCH1_EQPT__ConvertExcelToJson637961178824025822__Normal() + { + string check = "*.wc"; + bool validatePDSF = false; + MethodBase methodBase = new StackFrame().GetMethod(); + _WC6INCH1_EQPT.Staging__v2_56_0__WC6INCH1_EQPT__ConvertExcelToJson(); + Assert.IsFalse(string.IsNullOrEmpty(_WC6INCH1_EQPT.AdaptationTesting.TestContext.FullyQualifiedTestClassName)); + string[] variables = _WC6INCH1_EQPT.AdaptationTesting.GetVariables(methodBase, check, validatePDSF); + IFileRead fileRead = _WC6INCH1_EQPT.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false); + Tuple> extractResult = fileRead.ReExtract(); + Assert.IsFalse(string.IsNullOrEmpty(extractResult?.Item1)); + Assert.IsNotNull(extractResult.Item3); + Assert.IsNotNull(extractResult.Item4); + NonThrowTryCatch(); + } + +} +#endif \ No newline at end of file diff --git a/Adaptation/_Tests/Static/MET08AWCT.cs b/Adaptation/_Tests/Static/MET08AWCT.cs index 8cc45ef..1f7cc16 100644 --- a/Adaptation/_Tests/Static/MET08AWCT.cs +++ b/Adaptation/_Tests/Static/MET08AWCT.cs @@ -64,7 +64,7 @@ public class MET08AWCT : LoggingUnitTesting, IDisposable StringBuilder results = new(); (string cellInstanceName, string cellInstanceVersionName)[] collection = new (string, string)[] { - new("MET08AWCT", "v2.52.0"), + new("MET08AWCT", "v2.56.0"), }; string development = "http://eaf-dev.mes.infineon.com:9003/CellInstanceServiceV2"; Shared.PasteSpecialXml.EAF.XML.API.CellInstance.CellInstanceVersion cellInstanceVersion; @@ -82,7 +82,9 @@ public class MET08AWCT : LoggingUnitTesting, IDisposable NonThrowTryCatch(); } +#if DEBUG [Ignore] +#endif [TestMethod] public void Staging() { @@ -90,7 +92,7 @@ public class MET08AWCT : LoggingUnitTesting, IDisposable StringBuilder results = new(); (string cellInstanceName, string cellInstanceVersionName)[] collection = new (string, string)[] { - new("MET08AWCT", "v2.52.0"), + new("MET08AWCT", "v2.56.0"), }; string staging = "http://mestsa07ec.infineon.com:9003/CellInstanceServiceV2"; Shared.PasteSpecialXml.EAF.XML.API.CellInstance.CellInstanceVersion cellInstanceVersion; diff --git a/Adaptation/_Tests/Static/WC.cs b/Adaptation/_Tests/Static/WC.cs index d1215b3..d401a62 100644 --- a/Adaptation/_Tests/Static/WC.cs +++ b/Adaptation/_Tests/Static/WC.cs @@ -64,13 +64,13 @@ public class WC : LoggingUnitTesting, IDisposable StringBuilder results = new(); (string cellInstanceName, string cellInstanceVersionName)[] collection = new (string, string)[] { - new("WC6INCH1-EQPT", "v2.52.0"), - new("WC6INCH2-EQPT", "v2.52.0"), - new("WC6INCH3-EQPT", "v2.52.0"), - new("WC6INCH4-EQPT", "v2.52.0"), - new("WC8INCH1-EQPT", "v2.52.0"), - new("WC8INCH2-EQPT", "v2.52.0"), - new("WC8INCH3-EQPT", "v2.52.0"), + new("WC6INCH1-EQPT", "v2.56.0"), + new("WC6INCH2-EQPT", "v2.56.0"), + new("WC6INCH3-EQPT", "v2.56.0"), + new("WC6INCH4-EQPT", "v2.56.0"), + new("WC8INCH1-EQPT", "v2.56.0"), + new("WC8INCH2-EQPT", "v2.56.0"), + new("WC8INCH3-EQPT", "v2.56.0"), }; string development = "http://eaf-dev.mes.infineon.com:9003/CellInstanceServiceV2"; Shared.PasteSpecialXml.EAF.XML.API.CellInstance.CellInstanceVersion cellInstanceVersion; @@ -88,7 +88,9 @@ public class WC : LoggingUnitTesting, IDisposable NonThrowTryCatch(); } +#if DEBUG [Ignore] +#endif [TestMethod] public void Staging() { @@ -96,13 +98,13 @@ public class WC : LoggingUnitTesting, IDisposable StringBuilder results = new(); (string cellInstanceName, string cellInstanceVersionName)[] collection = new (string, string)[] { - new("WC6INCH1-EQPT", "v2.52.0"), - new("WC6INCH2-EQPT", "v2.52.0"), - new("WC6INCH3-EQPT", "v2.52.0"), - new("WC6INCH4-EQPT", "v2.52.0"), - new("WC8INCH1-EQPT", "v2.52.0"), - new("WC8INCH2-EQPT", "v2.52.0"), - new("WC8INCH3-EQPT", "v2.52.0"), + new("WC6INCH1-EQPT", "v2.56.0"), + new("WC6INCH2-EQPT", "v2.56.0"), + new("WC6INCH3-EQPT", "v2.56.0"), + new("WC6INCH4-EQPT", "v2.56.0"), + new("WC8INCH1-EQPT", "v2.56.0"), + new("WC8INCH2-EQPT", "v2.56.0"), + new("WC8INCH3-EQPT", "v2.56.0"), }; string staging = "http://mestsa07ec.infineon.com:9003/CellInstanceServiceV2"; Shared.PasteSpecialXml.EAF.XML.API.CellInstance.CellInstanceVersion cellInstanceVersion; diff --git a/MET08AWCT.csproj b/MET08AWCT.csproj index 9671ad7..cd24c87 100644 --- a/MET08AWCT.csproj +++ b/MET08AWCT.csproj @@ -51,6 +51,9 @@ NETFRAMEWORK;NET20;NET35;NET40;NET45;NET451;NET452;NET46;NET461;NET462;NET47;NET471;NET472;NET48;$(DefineConstants) + + + @@ -156,7 +159,7 @@ - 2.52.0 + 2.56.0 5.2.7