diff --git a/Adaptation/.vscode/settings.json b/Adaptation/.vscode/settings.json index 1d4e80a..8e67af0 100644 --- a/Adaptation/.vscode/settings.json +++ b/Adaptation/.vscode/settings.json @@ -45,6 +45,5 @@ "titleBar.inactiveForeground": "#e7e7e799", "commandCenter.border": "#e7e7e799" }, - "peacock.color": "#4a727e", - "cSpell.enabled": false + "peacock.color": "#4a727e" } \ No newline at end of file diff --git a/Adaptation/FileHandlers/Markdown/ProcessData.cs b/Adaptation/FileHandlers/Markdown/ProcessData.cs index d3b156a..822e328 100644 --- a/Adaptation/FileHandlers/Markdown/ProcessData.cs +++ b/Adaptation/FileHandlers/Markdown/ProcessData.cs @@ -400,47 +400,64 @@ public class ProcessData : IProcessData _ => 8 }; - private static string? GetMaxIterationPath122508(ReadOnlyCollection records) + private static ReadOnlyCollection GetMaxIterationPaths122508(ReadOnlyCollection records) { - string? result; - List results = new(); + List results; + List? collection; + Dictionary> keyValuePairs = new(); foreach (Record record in records) { - if (results.Contains(record.WorkItem.IterationPath)) - continue; - results.Add(record.WorkItem.IterationPath); + if (!keyValuePairs.TryGetValue(record.WorkItem.IterationPath, out collection)) + { + keyValuePairs.Add(record.WorkItem.IterationPath, new()); + if (!keyValuePairs.TryGetValue(record.WorkItem.IterationPath, out collection)) + throw new Exception(); + + } + collection.Add(record); } - result = results.Count == 0 ? null : results.Max(); - return result; + string? max = keyValuePairs.Keys.Max(); + results = string.IsNullOrEmpty(max) ? new() : keyValuePairs[max]; + return results.AsReadOnly(); } private static ReadOnlyCollection FeatureCheckIterationPath122508(string url, List lines, ReadOnlyCollection workItemTypes, ReadOnlyDictionary keyValuePairs, string workItemType) { List results = new(); Record record; - string? maxIterationPath; + List violations = new(); List collection = new(); ReadOnlyCollection records; + ReadOnlyCollection maxIterationPaths; foreach (KeyValuePair keyValuePair in keyValuePairs) { record = keyValuePair.Value; if (record.WorkItem.State is "Removed") continue; + if (!record.WorkItem.IterationPath.Contains('\\')) + continue; if (record.WorkItem.WorkItemType != workItemType) continue; collection.Clear(); + violations.Clear(); if (record.Children is null || record.Children.Length == 0) continue; records = FilterChildren(workItemTypes, record); - maxIterationPath = GetMaxIterationPath122508(records); - if (string.IsNullOrEmpty(maxIterationPath) || record.WorkItem.IterationPath == maxIterationPath) - continue; - collection.Add($"## {record.WorkItem.AssignedTo} - {record.WorkItem.Id} - {record.WorkItem.Title}"); - collection.Add(string.Empty); - collection.Add($"- [ ] [{record.WorkItem.Id}]({url}{record.WorkItem.Id}) => {record.WorkItem.IterationPath} != {maxIterationPath}"); - collection.Add(string.Empty); - lines.AddRange(collection); - results.Add(Record.GetWithoutNesting(record, $"IterationPath:{record.WorkItem.Id};{record.WorkItem.IterationPath} != {maxIterationPath}")); + maxIterationPaths = GetMaxIterationPaths122508(records); + foreach (Record r in maxIterationPaths) + { + if (string.IsNullOrEmpty(r.WorkItem.IterationPath) || record.WorkItem.IterationPath == r.WorkItem.IterationPath) + continue; + violations.Add($"{r.WorkItem.Id}:{r.WorkItem.IterationPath};"); + } + if (violations.Count > 0) + { + collection.Insert(0, string.Empty); + collection.Insert(0, $"## {record.WorkItem.AssignedTo} - {record.WorkItem.Id} - {record.WorkItem.Title}"); + lines.AddRange(collection); + violations.Insert(0, $"IterationPath:{record.WorkItem.IterationPath};"); + results.Add(Record.GetWithoutNesting(record, string.Join(" ", violations))); + } } return new(results); } diff --git a/Adaptation/Shared/FileRead.cs b/Adaptation/Shared/FileRead.cs index 2c3fd06..bc160cf 100644 --- a/Adaptation/Shared/FileRead.cs +++ b/Adaptation/Shared/FileRead.cs @@ -491,7 +491,7 @@ public class FileRead : Properties.IFileRead protected static void NestExistingFiles(FileConnectorConfiguration fileConnectorConfiguration) { - if (!fileConnectorConfiguration.IncludeSubDirectories.Value) + if (!fileConnectorConfiguration.IncludeSubDirectories.Value && fileConnectorConfiguration.TriggerOnCreated is not null && fileConnectorConfiguration.TriggerOnCreated.Value) { string[] matches = GetMatches(fileConnectorConfiguration); if (matches is not null && matches.Length > 0) diff --git a/Adaptation/_Tests/CreateSelfDescription/Development/v2.59.0/ALIGNMENT-EQPT.cs b/Adaptation/_Tests/CreateSelfDescription/Development/v2.59.0/ALIGNMENT-EQPT.cs deleted file mode 100644 index aace5c6..0000000 --- a/Adaptation/_Tests/CreateSelfDescription/Development/v2.59.0/ALIGNMENT-EQPT.cs +++ /dev/null @@ -1,65 +0,0 @@ -#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_59_0; - -[TestClass] -public class ALIGNMENT_EQPT : EAFLoggingUnitTesting -{ - -#pragma warning disable CA2254 -#pragma warning disable IDE0060 - - internal static string DummyRoot { get; private set; } - internal static ALIGNMENT_EQPT EAFLoggingUnitTesting { get; private set; } - - static ALIGNMENT_EQPT() => DummyRoot = @"\\mesfs.infineon.com\EC_Characterization_Si\Dummy"; - - public ALIGNMENT_EQPT() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false) - { - if (EAFLoggingUnitTesting is null) - throw new Exception(); - } - - public ALIGNMENT_EQPT(TestContext testContext) : base(DummyRoot, testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false) - { - } - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - EAFLoggingUnitTesting ??= new ALIGNMENT_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 Development__v2_59_0__ALIGNMENT_EQPT__DownloadExcelFile() - { - string check = ".xlsx"; - 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/CreateSelfDescription/Development/v2.59.0/ALIGNMENT.cs b/Adaptation/_Tests/CreateSelfDescription/Development/v2.59.0/ALIGNMENT.cs deleted file mode 100644 index e245406..0000000 --- a/Adaptation/_Tests/CreateSelfDescription/Development/v2.59.0/ALIGNMENT.cs +++ /dev/null @@ -1,65 +0,0 @@ -#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_59_0; - -[TestClass] -public class ALIGNMENT : EAFLoggingUnitTesting -{ - -#pragma warning disable CA2254 -#pragma warning disable IDE0060 - - internal static string DummyRoot { get; private set; } - internal static ALIGNMENT EAFLoggingUnitTesting { get; private set; } - - static ALIGNMENT() => DummyRoot = @"\\mesfs.infineon.com\EC_Characterization_Si\Dummy"; - - public ALIGNMENT() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false) - { - if (EAFLoggingUnitTesting is null) - throw new Exception(); - } - - public ALIGNMENT(TestContext testContext) : base(DummyRoot, testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false) - { - } - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - EAFLoggingUnitTesting ??= new ALIGNMENT(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 Development__v2_59_0__ALIGNMENT__ConvertExcelToJson() - { - string check = "*.xlsx"; - 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.59.0/ALIGNMENT-EQPT.cs b/Adaptation/_Tests/Extract/Development/v2.59.0/ALIGNMENT-EQPT.cs deleted file mode 100644 index 8cf3cd2..0000000 --- a/Adaptation/_Tests/Extract/Development/v2.59.0/ALIGNMENT-EQPT.cs +++ /dev/null @@ -1,52 +0,0 @@ -#if true -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System; -using System.Diagnostics; -using System.Reflection; -using System.Threading; - -namespace Adaptation._Tests.Extract.Development.v2_59_0; - -[TestClass] -public class ALIGNMENT_EQPT -{ - -#pragma warning disable CA2254 -#pragma warning disable IDE0060 - - private static CreateSelfDescription.Development.v2_59_0.ALIGNMENT_EQPT _ALIGNMENT_EQPT; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - CreateSelfDescription.Development.v2_59_0.ALIGNMENT_EQPT.ClassInitialize(testContext); - _ALIGNMENT_EQPT = CreateSelfDescription.Development.v2_59_0.ALIGNMENT_EQPT.EAFLoggingUnitTesting; - } - - private static void NonThrowTryCatch() - { - try - { throw new Exception(); } - catch (Exception) { } - } - - [Ignore] - [TestMethod] - public void Development__v2_59_0__ALIGNMENT_EQPT__DownloadExcelFile() => _ALIGNMENT_EQPT.Development__v2_59_0__ALIGNMENT_EQPT__DownloadExcelFile(); - - [Ignore] - [TestMethod] - public void Development__v2_59_0__ALIGNMENT_EQPT__DownloadExcelFile637961178824025822__Normal() - { - string check = ".xlsx"; - bool validatePDSF = false; - MethodBase methodBase = new StackFrame().GetMethod(); - _ALIGNMENT_EQPT.Development__v2_59_0__ALIGNMENT_EQPT__DownloadExcelFile(); - _ = _ALIGNMENT_EQPT.AdaptationTesting.GetVariables(methodBase, check, validatePDSF); - for (int i = 0; i < int.MinValue; i++) - Thread.Sleep(500); - NonThrowTryCatch(); - } - -} -#endif \ No newline at end of file diff --git a/Adaptation/_Tests/Extract/Development/v2.59.0/ALIGNMENT.cs b/Adaptation/_Tests/Extract/Development/v2.59.0/ALIGNMENT.cs deleted file mode 100644 index 89cd05c..0000000 --- a/Adaptation/_Tests/Extract/Development/v2.59.0/ALIGNMENT.cs +++ /dev/null @@ -1,64 +0,0 @@ -#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_59_0; - -[TestClass] -public class ALIGNMENT -{ - -#pragma warning disable CA2254 -#pragma warning disable IDE0060 - - private static CreateSelfDescription.Development.v2_59_0.ALIGNMENT _ALIGNMENT; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - CreateSelfDescription.Development.v2_59_0.ALIGNMENT.ClassInitialize(testContext); - _ALIGNMENT = CreateSelfDescription.Development.v2_59_0.ALIGNMENT.EAFLoggingUnitTesting; - } - - private static void NonThrowTryCatch() - { - try - { throw new Exception(); } - catch (Exception) { } - } - -#if DEBUG - [Ignore] -#endif - [TestMethod] - public void Development__v2_59_0__ALIGNMENT__ConvertExcelToJson() => _ALIGNMENT.Development__v2_59_0__ALIGNMENT__ConvertExcelToJson(); - -#if DEBUG - [Ignore] -#endif - [TestMethod] - public void Development__v2_59_0__ALIGNMENT__ConvertExcelToJson638353030755467303__Normal() - { - string check = "*.xlsx"; - bool validatePDSF = false; - MethodBase methodBase = new StackFrame().GetMethod(); - _ALIGNMENT.Development__v2_59_0__ALIGNMENT__ConvertExcelToJson(); - Assert.IsFalse(string.IsNullOrEmpty(_ALIGNMENT.AdaptationTesting.TestContext.FullyQualifiedTestClassName)); - string[] variables = _ALIGNMENT.AdaptationTesting.GetVariables(methodBase, check, validatePDSF); - IFileRead fileRead = _ALIGNMENT.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/Extract/Development/v2.59.0/MESAFIBACKLOG.cs b/Adaptation/_Tests/Extract/Development/v2.59.0/MESAFIBACKLOG.cs index 152f936..3943681 100644 --- a/Adaptation/_Tests/Extract/Development/v2.59.0/MESAFIBACKLOG.cs +++ b/Adaptation/_Tests/Extract/Development/v2.59.0/MESAFIBACKLOG.cs @@ -218,5 +218,25 @@ public class MESAFIBACKLOG NonThrowTryCatch(); } +#if DEBUG + [Ignore] +#endif + [TestMethod] + public void Development__v2_59_0__MESAFIBACKLOG__Markdown638779784153157286__Normal() + { + string check = "*.json"; + bool validatePDSF = false; + _MESAFIBACKLOG.Development__v2_59_0__MESAFIBACKLOG__Markdown(); + MethodBase methodBase = new StackFrame().GetMethod(); + Assert.IsFalse(string.IsNullOrEmpty(_MESAFIBACKLOG.AdaptationTesting.TestContext.FullyQualifiedTestClassName)); + string[] variables = _MESAFIBACKLOG.AdaptationTesting.GetVariables(methodBase, check, validatePDSF); + IFileRead fileRead = _MESAFIBACKLOG.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/ALIGNMENT.cs b/Adaptation/_Tests/Static/ALIGNMENT.cs deleted file mode 100644 index 5a94ae4..0000000 --- a/Adaptation/_Tests/Static/ALIGNMENT.cs +++ /dev/null @@ -1,106 +0,0 @@ -using Adaptation._Tests.Shared; -using Microsoft.Extensions.Logging; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Text; - -namespace Adaptation._Tests.Static; - -[TestClass] -public class ALIGNMENT : LoggingUnitTesting, IDisposable -{ - -#pragma warning disable CA2254 -#pragma warning disable IDE0060 - - internal static ALIGNMENT LoggingUnitTesting { get; private set; } - - public ALIGNMENT() : base(testContext: null, declaringType: null) - { - if (LoggingUnitTesting is null) - throw new Exception(); - } - - public ALIGNMENT(TestContext testContext) : base(testContext, new StackFrame().GetMethod().DeclaringType) - { - } - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) => LoggingUnitTesting ??= new ALIGNMENT(testContext); - - [ClassCleanup()] - public static void ClassCleanup() - { - LoggingUnitTesting?.Logger?.LogInformation("Cleanup"); - LoggingUnitTesting?.Dispose(); - } - - private static void NonThrowTryCatch() - { - try - { throw new Exception(); } - catch (Exception) { } - } - - [TestMethod] - public void TestDateTime() - { - DateTime dateTime = DateTime.Now; - Assert.AreEqual(dateTime.ToString(), dateTime.ToString("M/d/yyyy h:mm:ss tt")); - } - -#if DEBUG - [Ignore] -#endif - [TestMethod] - public void Development() - { - MethodBase methodBase = new StackFrame().GetMethod(); - StringBuilder results = new(); - (string cellInstanceName, string cellInstanceVersionName)[] collection = new (string, string)[] - { - new("ALIGNMENT", "v2.59.0"), - new("ALIGNMENT-EQPT", "v2.59.0"), - }; - string development = "http://eaf-dev.mes.infineon.com:9003/CellInstanceServiceV2"; - Shared.PasteSpecialXml.EAF.XML.API.CellInstance.CellInstanceVersion cellInstanceVersion; - LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration")); - foreach ((string cellInstanceName, string cellInstanceVersionName) in collection) - { - cellInstanceVersion = AdaptationTesting.GetCellInstanceVersion($"{development}/{cellInstanceName}/{cellInstanceVersionName}/configuration"); - _ = results.AppendLine($"{cellInstanceName}\t{cellInstanceVersionName}\t{cellInstanceVersion.EdaConnection.PortNumber}"); - } - string sourceDirectory = "D:/Tmp/cellInstanceVersion.EdaConnection.PortNumber"; - if (!Directory.Exists(sourceDirectory)) - _ = Directory.CreateDirectory(sourceDirectory); - File.WriteAllText(Path.Combine(sourceDirectory, $"{methodBase.Module.Name}-{methodBase.ReflectedType.Name}-{methodBase.Name}.tsv"), results.ToString()); - LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); - NonThrowTryCatch(); - } - - [TestMethod] - public void CellInstanceVersionEdaConnectionPortNumber() - { - MethodBase methodBase = new StackFrame().GetMethod(); - string sourceDirectory = "D:/Tmp/cellInstanceVersion.EdaConnection.PortNumber"; - if (Directory.Exists(sourceDirectory)) - { - string destinationDirectory = Path.Combine(sourceDirectory, "All"); - if (!Directory.Exists(destinationDirectory)) - _ = Directory.CreateDirectory(destinationDirectory); - List lines = new(); - string[] files = Directory.GetFiles(sourceDirectory, "*.tsv", SearchOption.TopDirectoryOnly); - foreach (string file in files) - lines.AddRange(File.ReadAllLines(file)); - File.WriteAllLines(Path.Combine(destinationDirectory, $"{DateTime.Now.Ticks}.tsv"), lines.Distinct().OrderBy(l => l)); - } - LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit")); - NonThrowTryCatch(); - } - -} \ No newline at end of file diff --git a/MESAFIBACKLOG.csproj b/MESAFIBACKLOG.csproj index 6fa2658..b3a0aec 100644 --- a/MESAFIBACKLOG.csproj +++ b/MESAFIBACKLOG.csproj @@ -212,7 +212,7 @@ 0.15.1 - 2.59.0 + 2.58.0 2.4.3 @@ -220,17 +220,20 @@ 2.4.3 + + 1.0.0 + - 4.0.0 + 2.1.0 - 4.0.0 + 2.1.0 + + + 2.1.0 - 4.0.0 - - - 4.0.0 + 2.1.0 16.205.1 diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index 23e2e00..0e774cf 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.59.0.0")] -[assembly: AssemblyFileVersion("2.59.0.0")] +[assembly: AssemblyVersion("2.58.0.0")] +[assembly: AssemblyFileVersion("2.58.0.0")]