Compare commits
	
		
			6 Commits
		
	
	
		
			4c2bef71ec
			...
			09-23-a
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 5ff031178f | |||
| b1b20e1bb0 | |||
| 8e294ab83f | |||
| 7b2a843664 | |||
| 6f52566fc2 | |||
| 2afb312065 | 
| @ -105,7 +105,7 @@ dotnet_diagnostic.CS8936.severity = error # Feature 'collection expressions' is | ||||
| dotnet_diagnostic.IDE0001.severity = warning # IDE0001: Simplify name | ||||
| dotnet_diagnostic.IDE0002.severity = warning # Simplify (member access) - System.Version.Equals("1", "2"); Version.Equals("1", "2"); | ||||
| dotnet_diagnostic.IDE0004.severity = warning # IDE0004: Cast is redundant. | ||||
| dotnet_diagnostic.IDE0005.severity = warning # Using directive is unnecessary | ||||
| dotnet_diagnostic.IDE0005.severity = none # Using directive is unnecessary | ||||
| dotnet_diagnostic.IDE0028.severity = none # IDE0028: Collection initialization can be simplified | ||||
| dotnet_diagnostic.IDE0031.severity = warning # Use null propagation (IDE0031) | ||||
| dotnet_diagnostic.IDE0047.severity = warning # IDE0047: Parentheses can be removed | ||||
| @ -115,6 +115,7 @@ dotnet_diagnostic.IDE0290.severity = none # Use primary constructor [Distance]cs | ||||
| dotnet_diagnostic.IDE0300.severity = none # IDE0300: Collection initialization can be simplified | ||||
| dotnet_diagnostic.IDE0301.severity = none #IDE0301: Collection initialization can be simplified | ||||
| dotnet_diagnostic.IDE0305.severity = none # IDE0305: Collection initialization can be simplified | ||||
| dotnet_diagnostic.MSTEST0015.severity = none # MSTEST0015: Test method {method} should not be ignored | ||||
| dotnet_naming_rule.abstract_method_should_be_pascal_case.severity = warning | ||||
| dotnet_naming_rule.abstract_method_should_be_pascal_case.style = pascal_case | ||||
| dotnet_naming_rule.abstract_method_should_be_pascal_case.symbols = abstract_method | ||||
|  | ||||
							
								
								
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @ -345,4 +345,4 @@ ASALocalRun/ | ||||
| .kanbn | ||||
| Tests/.kanbn | ||||
|  | ||||
| /Wafer-Counter/.vscode/.UserSecrets/secrets.json | ||||
| secrets.json | ||||
							
								
								
									
										6
									
								
								.vscode/launch.json
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								.vscode/launch.json
									
									
									
									
										vendored
									
									
								
							| @ -8,7 +8,7 @@ | ||||
|             "name": ".NET Core Launch (web) - Server", | ||||
|             "type": "coreclr", | ||||
|             "request": "launch", | ||||
|             "preLaunchTask": "buildServer", | ||||
|             "preLaunchTask": "Build Server", | ||||
|             // If you have changed target frameworks, make sure to update the program path. | ||||
|             "program": "${workspaceFolder}/Server/bin/Debug/net8.0/win-x64/OI.Metrology.Server.dll", | ||||
|             "args": [], | ||||
| @ -31,7 +31,7 @@ | ||||
|             "name": ".NET Core Attach - Server", | ||||
|             "type": "coreclr", | ||||
|             "request": "attach", | ||||
|             "preLaunchTask": "watchServer", | ||||
|             "preLaunchTask": "Watch Server", | ||||
|             "processName": "OI.Metrology.Server.exe" | ||||
|         }, | ||||
|         { | ||||
| @ -41,7 +41,7 @@ | ||||
|             "name": ".NET Core Launch (web) - ClientHub", | ||||
|             "type": "coreclr", | ||||
|             "request": "launch", | ||||
|             "preLaunchTask": "buildClientHub", | ||||
|             "preLaunchTask": "Build Client Hub", | ||||
|             // If you have changed target frameworks, make sure to update the program path. | ||||
|             "program": "${workspaceFolder}/ClientHub/bin/Debug/net7.0/win-x64/OI.Metrology.ClientHub.dll", | ||||
|             "args": [], | ||||
|  | ||||
							
								
								
									
										52
									
								
								.vscode/tasks.json
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										52
									
								
								.vscode/tasks.json
									
									
									
									
										vendored
									
									
								
							| @ -28,72 +28,60 @@ | ||||
|             "problemMatcher": "$msCompile" | ||||
|         }, | ||||
|         { | ||||
|             "label": "buildServer", | ||||
|             "label": "Build Server", | ||||
|             "command": "dotnet", | ||||
|             "type": "process", | ||||
|             "args": [ | ||||
|                 "build", | ||||
|                 "${workspaceFolder}/Server/OI.Metrology.Server.csproj", | ||||
|                 "/property:GenerateFullPaths=true", | ||||
|                 "/consoleloggerparameters:NoSummary" | ||||
|                 "${workspaceFolder}/Server/OI.Metrology.Server.csproj" | ||||
|             ], | ||||
|             "problemMatcher": "$msCompile" | ||||
|         }, | ||||
|         { | ||||
|             "label": "buildTests", | ||||
|             "label": "Build Tests", | ||||
|             "command": "dotnet", | ||||
|             "type": "process", | ||||
|             "args": [ | ||||
|                 "build", | ||||
|                 "${workspaceFolder}/Tests/OI.Metrology.Tests.csproj", | ||||
|                 "/property:GenerateFullPaths=true", | ||||
|                 "/consoleloggerparameters:NoSummary" | ||||
|                 "${workspaceFolder}/Tests/OI.Metrology.Tests.csproj" | ||||
|             ], | ||||
|             "problemMatcher": "$msCompile" | ||||
|         }, | ||||
|         { | ||||
|             "label": "buildShared", | ||||
|             "label": "Build Shared", | ||||
|             "command": "dotnet", | ||||
|             "type": "process", | ||||
|             "args": [ | ||||
|                 "build", | ||||
|                 "${workspaceFolder}/Shared/OI.Metrology.Shared.csproj", | ||||
|                 "/property:GenerateFullPaths=true", | ||||
|                 "/consoleloggerparameters:NoSummary" | ||||
|                 "${workspaceFolder}/Shared/OI.Metrology.Shared.csproj" | ||||
|             ], | ||||
|             "problemMatcher": "$msCompile" | ||||
|         }, | ||||
|         { | ||||
|             "label": "publishServer", | ||||
|             "label": "Publish Server", | ||||
|             "command": "dotnet", | ||||
|             "type": "process", | ||||
|             "args": [ | ||||
|                 "publish", | ||||
|                 "${workspaceFolder}/Server/OI.Metrology.Server.csproj", | ||||
|                 "/property:GenerateFullPaths=true", | ||||
|                 "/consoleloggerparameters:NoSummary" | ||||
|                 "${workspaceFolder}/Server/OI.Metrology.Server.csproj" | ||||
|             ], | ||||
|             "problemMatcher": "$msCompile" | ||||
|         }, | ||||
|         { | ||||
|             "label": "testDebug", | ||||
|             "label": "Test Debug", | ||||
|             "command": "dotnet", | ||||
|             "type": "process", | ||||
|             "args": [ | ||||
|                 "test", | ||||
|                 "/property:GenerateFullPaths=true", | ||||
|                 "/consoleloggerparameters:NoSummary" | ||||
|                 "test" | ||||
|             ], | ||||
|             "problemMatcher": "$msCompile" | ||||
|         }, | ||||
|         { | ||||
|             "label": "testRelease", | ||||
|             "label": "Test Release", | ||||
|             "command": "dotnet", | ||||
|             "type": "process", | ||||
|             "args": [ | ||||
|                 "test", | ||||
|                 "/property:GenerateFullPaths=true", | ||||
|                 "/consoleloggerparameters:NoSummary", | ||||
|                 "-c", | ||||
|                 "Release" | ||||
|             ], | ||||
| @ -115,7 +103,7 @@ | ||||
|             "problemMatcher": "$msCompile" | ||||
|         }, | ||||
|         { | ||||
|             "label": "old-watch", | ||||
|             "label": "Old Watch", | ||||
|             "command": "dotnet", | ||||
|             "type": "process", | ||||
|             "args": [ | ||||
| @ -127,7 +115,7 @@ | ||||
|             "problemMatcher": "$msCompile" | ||||
|         }, | ||||
|         { | ||||
|             "label": "watchServer", | ||||
|             "label": "Watch Server", | ||||
|             "command": "dotnet", | ||||
|             "type": "process", | ||||
|             "args": [ | ||||
| @ -161,31 +149,27 @@ | ||||
|             } | ||||
|         }, | ||||
|         { | ||||
|             "label": "buildClientHub", | ||||
|             "label": "Build Client Hub", | ||||
|             "command": "dotnet", | ||||
|             "type": "process", | ||||
|             "args": [ | ||||
|                 "build", | ||||
|                 "${workspaceFolder}/ClientHub/OI.Metrology.ClientHub.csproj", | ||||
|                 "/property:GenerateFullPaths=true", | ||||
|                 "/consoleloggerparameters:NoSummary" | ||||
|                 "${workspaceFolder}/ClientHub/OI.Metrology.ClientHub.csproj" | ||||
|             ], | ||||
|             "problemMatcher": "$msCompile" | ||||
|         }, | ||||
|         { | ||||
|             "label": "publishClientHub", | ||||
|             "label": "Publish Client Hub", | ||||
|             "command": "dotnet", | ||||
|             "type": "process", | ||||
|             "args": [ | ||||
|                 "publish", | ||||
|                 "${workspaceFolder}/ClientHub/OI.Metrology.ClientHub.csproj", | ||||
|                 "/property:GenerateFullPaths=true", | ||||
|                 "/consoleloggerparameters:NoSummary" | ||||
|                 "${workspaceFolder}/ClientHub/OI.Metrology.ClientHub.csproj" | ||||
|             ], | ||||
|             "problemMatcher": "$msCompile" | ||||
|         }, | ||||
|         { | ||||
|             "label": "watchClientHub", | ||||
|             "label": "Watch Client Hub", | ||||
|             "command": "dotnet", | ||||
|             "type": "process", | ||||
|             "args": [ | ||||
|  | ||||
							
								
								
									
										8
									
								
								Archive/.vscode/tasks.json
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										8
									
								
								Archive/.vscode/tasks.json
									
									
									
									
										vendored
									
									
								
							| @ -7,9 +7,7 @@ | ||||
|             "type": "process", | ||||
|             "args": [ | ||||
|                 "build", | ||||
|                 "${workspaceFolder}/Archive.csproj", | ||||
|                 "/property:GenerateFullPaths=true", | ||||
|                 "/consoleloggerparameters:NoSummary" | ||||
|                 "${workspaceFolder}/Archive.csproj" | ||||
|             ], | ||||
|             "problemMatcher": "$msCompile" | ||||
|         }, | ||||
| @ -19,9 +17,7 @@ | ||||
|             "type": "process", | ||||
|             "args": [ | ||||
|                 "publish", | ||||
|                 "${workspaceFolder}/Archive.csproj", | ||||
|                 "/property:GenerateFullPaths=true", | ||||
|                 "/consoleloggerparameters:NoSummary" | ||||
|                 "${workspaceFolder}/Archive.csproj" | ||||
|             ], | ||||
|             "problemMatcher": "$msCompile" | ||||
|         }, | ||||
|  | ||||
							
								
								
									
										2
									
								
								Server/.vscode/launch.json
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								Server/.vscode/launch.json
									
									
									
									
										vendored
									
									
								
							| @ -8,7 +8,7 @@ | ||||
|             "name": ".NET Core Launch (web)", | ||||
|             "type": "coreclr", | ||||
|             "request": "launch", | ||||
|             "preLaunchTask": "build", | ||||
|             "preLaunchTask": "Build", | ||||
|             // If you have changed target frameworks, make sure to update the program path. | ||||
|             "program": "${workspaceFolder}/bin/Debug/net8.0/OI.Metrology.Server.dll", | ||||
|             "args": [], | ||||
|  | ||||
							
								
								
									
										5
									
								
								Server/.vscode/mklink.md
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								Server/.vscode/mklink.md
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,5 @@ | ||||
| # mklink | ||||
|  | ||||
| ```bash Thu Aug 29 2024 09:47:22 GMT-0700 (Mountain Standard Time) | ||||
| mklink /J "L:\DevOps\OpenInsight-Metrology-Viewer\OI-Metrology\Server\.vscode\.UserSecrets" "C:\Users\phares\AppData\Roaming\Microsoft\UserSecrets\b0a3891c-b775-422c-80ee-63a2f385045d" | ||||
| ``` | ||||
							
								
								
									
										7
									
								
								Server/.vscode/settings.json
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										7
									
								
								Server/.vscode/settings.json
									
									
									
									
										vendored
									
									
								
							| @ -1,4 +1,11 @@ | ||||
| { | ||||
|     "files.associations": { | ||||
|         "*.ffs_gui": "xml", | ||||
|         "*.hurl": "http", | ||||
|         "*.org": "ini", | ||||
|         "*.net": "ini", | ||||
|         "default": "ini" | ||||
|     }, | ||||
|     "cSpell.words": [ | ||||
|         "Infineon" | ||||
|     ] | ||||
|  | ||||
							
								
								
									
										480
									
								
								Server/.vscode/tasks.json
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										480
									
								
								Server/.vscode/tasks.json
									
									
									
									
										vendored
									
									
								
							| @ -1,60 +1,164 @@ | ||||
| { | ||||
|     "version": "2.0.0", | ||||
|     "inputs": [ | ||||
|         { | ||||
|             "default": "Development", | ||||
|             "description": "Which ASP Net Core Environment?", | ||||
|             "id": "ASPNETCORE_ENVIRONMENT", | ||||
|             "options": [ | ||||
|                 "Development", | ||||
|                 "Production" | ||||
|             ], | ||||
|             "type": "pickString" | ||||
|         }, | ||||
|         { | ||||
|             "default": "{AssemblyTitle}", | ||||
|             "description": "What Assembly Title?", | ||||
|             "id": "AssemblyTitle", | ||||
|             "type": "promptString" | ||||
|         }, | ||||
|         { | ||||
|             "default": "{Build.BuildId}", | ||||
|             "description": "Which Build BuildId?", | ||||
|             "id": "Build.BuildId", | ||||
|             "type": "promptString" | ||||
|         }, | ||||
|         { | ||||
|             "default": "{Build.Reason}", | ||||
|             "description": "Which Build Reason?", | ||||
|             "id": "Build.Reason", | ||||
|             "type": "promptString" | ||||
|         }, | ||||
|         { | ||||
|             "default": "{Build.Repository.Id}", | ||||
|             "description": "Which Build Repository Id?", | ||||
|             "id": "Build.Repository.Id", | ||||
|             "type": "promptString" | ||||
|         }, | ||||
|         { | ||||
|             "default": "{Build.Repository.Name}", | ||||
|             "description": "Which Build Repository Name?", | ||||
|             "id": "Build.Repository.Name", | ||||
|             "type": "promptString" | ||||
|         }, | ||||
|         { | ||||
|             "default": "{Build.SourceVersion}", | ||||
|             "description": "Which Build Source Version?", | ||||
|             "id": "Build.SourceVersion", | ||||
|             "type": "promptString" | ||||
|         }, | ||||
|         { | ||||
|             "default": "Debug", | ||||
|             "description": "Which Configuration?", | ||||
|             "id": "Configuration", | ||||
|             "options": [ | ||||
|                 "Debug", | ||||
|                 "Release" | ||||
|             ], | ||||
|             "type": "pickString" | ||||
|         }, | ||||
|         { | ||||
|             "default": "net8.0", | ||||
|             "description": "Which Core Version?", | ||||
|             "id": "CoreVersion", | ||||
|             "options": [ | ||||
|                 "net8.0" | ||||
|             ], | ||||
|             "type": "pickString" | ||||
|         }, | ||||
|         { | ||||
|             "default": "C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/MSBuild/Current/Bin/MSBuild.exe", | ||||
|             "description": "Which MS Build?", | ||||
|             "id": "MSBuild", | ||||
|             "type": "promptString" | ||||
|         }, | ||||
|         { | ||||
|             "default": "https://artifactory.intra.infineon.com/artifactory/api/nuget/ngt-fi-package-main-vir/", | ||||
|             "description": "Which Nuget Source?", | ||||
|             "id": "NugetSource", | ||||
|             "type": "promptString" | ||||
|         }, | ||||
|         { | ||||
|             "default": "win-x64", | ||||
|             "description": "Which Runtime?", | ||||
|             "id": "Runtime", | ||||
|             "options": [ | ||||
|                 "win-x64", | ||||
|                 "win-x32", | ||||
|                 "linux-x64", | ||||
|                 "linux-x32" | ||||
|             ], | ||||
|             "type": "pickString" | ||||
|         }, | ||||
|         { | ||||
|             "default": "L:/", | ||||
|             "description": "Which System DefaultWorkingDirectory?", | ||||
|             "id": "System.DefaultWorkingDirectory", | ||||
|             "options": [ | ||||
|                 "L:/", | ||||
|                 "D:/", | ||||
|                 "C:/" | ||||
|             ], | ||||
|             "type": "pickString" | ||||
|         }, | ||||
|         { | ||||
|             "default": "v4.8", | ||||
|             "description": "Which Core Target Framework Version?", | ||||
|             "id": "TargetFrameworkVersion", | ||||
|             "options": [ | ||||
|                 "v4.8" | ||||
|             ], | ||||
|             "type": "pickString" | ||||
|         }, | ||||
|         { | ||||
|             "default": "{UserSecretsId}", | ||||
|             "description": "Which Core User Secrets Id?", | ||||
|             "id": "UserSecretsId", | ||||
|             "type": "promptString" | ||||
|         } | ||||
|     ], | ||||
|     "tasks": [ | ||||
|         { | ||||
|             "label": "build", | ||||
|             "command": "dotnet", | ||||
|             "type": "process", | ||||
|             "args": [ | ||||
|                 "build", | ||||
|                 "${workspaceFolder}/OI.Metrology.Server.csproj", | ||||
|                 "/property:GenerateFullPaths=true", | ||||
|                 "/consoleloggerparameters:NoSummary" | ||||
|                 "build" | ||||
|             ], | ||||
|             "problemMatcher": "$msCompile" | ||||
|             "command": "dotnet", | ||||
|             "label": "Build", | ||||
|             "problemMatcher": "$msCompile", | ||||
|             "type": "process" | ||||
|         }, | ||||
|         { | ||||
|             "label": "buildTests", | ||||
|             "command": "dotnet", | ||||
|             "type": "process", | ||||
|             "args": [ | ||||
|                 "build", | ||||
|                 "${workspaceFolder}/../Tests/OI.Metrology.Tests.csproj", | ||||
|                 "/property:GenerateFullPaths=true", | ||||
|                 "/consoleloggerparameters:NoSummary" | ||||
|                 "${workspaceFolder}/../Tests/OI.Metrology.Tests.csproj" | ||||
|             ], | ||||
|             "problemMatcher": "$msCompile" | ||||
|             "command": "dotnet", | ||||
|             "label": "Build Tests", | ||||
|             "problemMatcher": "$msCompile", | ||||
|             "type": "process" | ||||
|         }, | ||||
|         { | ||||
|             "label": "testDebug", | ||||
|             "args": [ | ||||
|                 "test", | ||||
|                 "${workspaceFolder}/../Tests/OI.Metrology.Tests.csproj" | ||||
|             ], | ||||
|             "command": "dotnet", | ||||
|             "type": "process", | ||||
|             "label": "Test Debug", | ||||
|             "problemMatcher": "$msCompile", | ||||
|             "type": "process" | ||||
|         }, | ||||
|         { | ||||
|             "args": [ | ||||
|                 "test", | ||||
|                 "${workspaceFolder}/../Tests/OI.Metrology.Tests.csproj", | ||||
|                 "/property:GenerateFullPaths=true", | ||||
|                 "/consoleloggerparameters:NoSummary" | ||||
|             ], | ||||
|             "problemMatcher": "$msCompile" | ||||
|         }, | ||||
|         { | ||||
|             "label": "testRelease", | ||||
|             "command": "dotnet", | ||||
|             "type": "process", | ||||
|             "args": [ | ||||
|                 "test", | ||||
|                 "${workspaceFolder}/../Tests/OI.Metrology.Tests.csproj", | ||||
|                 "/property:GenerateFullPaths=true", | ||||
|                 "/consoleloggerparameters:NoSummary", | ||||
|                 "-c", | ||||
|                 "Release" | ||||
|             ], | ||||
|             "problemMatcher": "$msCompile" | ||||
|             "command": "dotnet", | ||||
|             "label": "Test Release", | ||||
|             "problemMatcher": "$msCompile", | ||||
|             "type": "process" | ||||
|         }, | ||||
|         { | ||||
|             "label": "Format", | ||||
|             "command": "dotnet", | ||||
|             "type": "process", | ||||
|             "args": [ | ||||
|                 "format", | ||||
|                 "--report", | ||||
| @ -64,27 +168,24 @@ | ||||
|                 "--severity", | ||||
|                 "warn" | ||||
|             ], | ||||
|             "problemMatcher": "$msCompile" | ||||
|             "command": "dotnet", | ||||
|             "label": "Format", | ||||
|             "problemMatcher": "$msCompile", | ||||
|             "type": "process" | ||||
|         }, | ||||
|         { | ||||
|             "label": "Format-Whitespace", | ||||
|             "command": "dotnet", | ||||
|             "type": "process", | ||||
|             "args": [ | ||||
|                 "format", | ||||
|                 "whitespace" | ||||
|             ], | ||||
|             "problemMatcher": "$msCompile" | ||||
|             "command": "dotnet", | ||||
|             "label": "Format Whitespace", | ||||
|             "problemMatcher": "$msCompile", | ||||
|             "type": "process" | ||||
|         }, | ||||
|         { | ||||
|             "label": "publish", | ||||
|             "command": "dotnet", | ||||
|             "type": "process", | ||||
|             "args": [ | ||||
|                 "publish", | ||||
|                 "${workspaceFolder}/OI.Metrology.Server.csproj", | ||||
|                 "/property:GenerateFullPaths=true", | ||||
|                 "/consoleloggerparameters:NoSummary", | ||||
|                 "--configuration", | ||||
|                 "Release", | ||||
|                 "--runtime", | ||||
| @ -93,17 +194,14 @@ | ||||
|                 "-o", | ||||
|                 "D:/web-sites/OI-Metrology/hh-3498d1da-_______-OI-Metrology-Release/Server" | ||||
|             ], | ||||
|             "problemMatcher": "$msCompile" | ||||
|             "command": "dotnet", | ||||
|             "label": "Publish", | ||||
|             "problemMatcher": "$msCompile", | ||||
|             "type": "process" | ||||
|         }, | ||||
|         { | ||||
|             "label": "Publish AOT", | ||||
|             "command": "dotnet", | ||||
|             "type": "process", | ||||
|             "args": [ | ||||
|                 "publish", | ||||
|                 "${workspaceFolder}/OI.Metrology.Server.csproj", | ||||
|                 "/property:GenerateFullPaths=true", | ||||
|                 "/consoleloggerparameters:NoSummary", | ||||
|                 "--configuration", | ||||
|                 "Release", | ||||
|                 "--runtime", | ||||
| @ -111,64 +209,280 @@ | ||||
|                 "-p:PublishAot=true", | ||||
|                 "/property:GenerateFullPaths=true" | ||||
|             ], | ||||
|             "problemMatcher": "$msCompile" | ||||
|             "command": "dotnet", | ||||
|             "label": "Publish AOT", | ||||
|             "problemMatcher": "$msCompile", | ||||
|             "type": "process" | ||||
|         }, | ||||
|         { | ||||
|             "label": "old-watch", | ||||
|             "command": "dotnet", | ||||
|             "type": "process", | ||||
|             "args": [ | ||||
|                 "watch", | ||||
|                 "run", | ||||
|                 "--project", | ||||
|                 "${workspaceFolder}/OI.Metrology.Server.csproj" | ||||
|                 "run" | ||||
|             ], | ||||
|             "problemMatcher": "$msCompile" | ||||
|             "command": "dotnet", | ||||
|             "label": "Old Watch", | ||||
|             "problemMatcher": "$msCompile", | ||||
|             "type": "process" | ||||
|         }, | ||||
|         { | ||||
|             "label": "watch", | ||||
|             "command": "dotnet", | ||||
|             "type": "process", | ||||
|             "args": [ | ||||
|                 "watch", | ||||
|                 "--launch-profile", | ||||
|                 "http", | ||||
|                 "run", | ||||
|                 "--project", | ||||
|                 "${workspaceFolder}/OI.Metrology.Server.csproj", | ||||
|                 "--verbose" | ||||
|             ], | ||||
|             "isBackground": true, | ||||
|             "command": "dotnet", | ||||
|             "dependsOn": [ | ||||
|                 "build" | ||||
|             ], | ||||
|             "isBackground": true, | ||||
|             "label": "Watch", | ||||
|             "problemMatcher": { | ||||
|                 "fileLocation": "relative", | ||||
|                 "pattern": { | ||||
|                     "regexp": "^([^\\s].*)\\((\\d+|\\d+,\\d+|\\d+,\\d+,\\d+,\\d+)\\):\\s+(error|warning|info)\\s+(TS\\d+)\\s*:\\s*(.*)$", | ||||
|                     "file": 1, | ||||
|                     "location": 2, | ||||
|                     "severity": 3, | ||||
|                     "code": 4, | ||||
|                     "message": 5 | ||||
|                 }, | ||||
|                 "background": { | ||||
|                     "activeOnStart": true, | ||||
|                     "beginsPattern": "^.*Shutdown requested.*", | ||||
|                     "endsPattern": "^.*Application started.*" | ||||
|                 }, | ||||
|                 "fileLocation": "relative", | ||||
|                 "pattern": { | ||||
|                     "code": 4, | ||||
|                     "file": 1, | ||||
|                     "location": 2, | ||||
|                     "message": 5, | ||||
|                     "regexp": "^([^\\s].*)\\((\\d+|\\d+,\\d+|\\d+,\\d+,\\d+,\\d+)\\):\\s+(error|warning|info)\\s+(TS\\d+)\\s*:\\s*(.*)$", | ||||
|                     "severity": 3 | ||||
|                 } | ||||
|             } | ||||
|             }, | ||||
|             "type": "process" | ||||
|         }, | ||||
|         { | ||||
|             "label": "File-Folder-Helper AOT s X Server", | ||||
|             "type": "shell", | ||||
|             "command": "L:/DevOps/Mesa_FI/File-Folder-Helper/bin/Release/net8.0/win-x64/publish/File-Folder-Helper.exe", | ||||
|             "args": [ | ||||
|                 "s", | ||||
|                 "X", | ||||
|                 "L:/DevOps/Mesa_FI/OI-Metrology Day-Helper-2024-01-08 L:/DevOps/Mesa_FI/OI-Metrology/Server" | ||||
|             ], | ||||
|             "problemMatcher": [] | ||||
|             "command": "L:/DevOps/Mesa_FI/File-Folder-Helper/bin/Release/net8.0/win-x64/publish/File-Folder-Helper.exe", | ||||
|             "label": "File-Folder-Helper AOT s X Server", | ||||
|             "problemMatcher": [], | ||||
|             "type": "shell" | ||||
|         }, | ||||
|         { | ||||
|             "command": "echo Assembly Title: ${input:AssemblyTitle} & echo Build Id: ${input:Build.BuildId} & echo Build Reason: ${input:Build.Reason} & echo Repo Id: ${input:Build.Repository.Id} & echo Repo Name: ${input:Build.Repository.Name} & echo Source Version: ${input:Build.SourceVersion} & echo Configuration: ${input:Configuration} & echo Core Version: ${input:CoreVersion} & echo Nuget Source: ${input:NugetSource} & echo Runtime: ${input:Runtime}", | ||||
|             "label": "Echo Check", | ||||
|             "problemMatcher": [], | ||||
|             "type": "shell" | ||||
|         }, | ||||
|         { | ||||
|             "command": "dotnet user-secrets init & dotnet user-secrets set BuildNumber ${input:Build.BuildId} & dotnet user-secrets set GitCommit ${input:Build.SourceVersion} & dotnet user-secrets list", | ||||
|             "label": "App - Safe storage of app secrets", | ||||
|             "problemMatcher": [], | ||||
|             "type": "shell" | ||||
|         }, | ||||
|         { | ||||
|             "args": [ | ||||
|                 "build", | ||||
|                 "--configuration", | ||||
|                 "${input:Configuration}", | ||||
|                 "--source", | ||||
|                 "${input:NugetSource}" | ||||
|             ], | ||||
|             "command": "dotnet", | ||||
|             "label": "App - Build", | ||||
|             "problemMatcher": "$msCompile", | ||||
|             "type": "process" | ||||
|         }, | ||||
|         { | ||||
|             "args": [ | ||||
|                 "build", | ||||
|                 "${workspaceFolder}/../Tests/OI.Metrology.Tests.csproj", | ||||
|                 "--configuration", | ||||
|                 "${input:Configuration}", | ||||
|                 "--source", | ||||
|                 "${input:NugetSource}" | ||||
|             ], | ||||
|             "command": "dotnet", | ||||
|             "label": "Tests - Build", | ||||
|             "problemMatcher": "$msCompile", | ||||
|             "type": "process" | ||||
|         }, | ||||
|         { | ||||
|             "args": [ | ||||
|                 "test", | ||||
|                 "${workspaceFolder}/../Tests/OI.Metrology.Tests.csproj", | ||||
|                 "--configuration", | ||||
|                 "${input:Configuration}" | ||||
|             ], | ||||
|             "command": "dotnet", | ||||
|             "label": "Tests - Test", | ||||
|             "problemMatcher": "$msCompile", | ||||
|             "type": "process" | ||||
|         }, | ||||
|         { | ||||
|             "args": [ | ||||
|                 "publish", | ||||
|                 "--configuration", | ||||
|                 "${input:Configuration}", | ||||
|                 "--runtime", | ||||
|                 "${input:Runtime}", | ||||
|                 "--self-contained" | ||||
|             ], | ||||
|             "command": "dotnet", | ||||
|             "label": "App - Publish", | ||||
|             "problemMatcher": "$msCompile", | ||||
|             "type": "process" | ||||
|         }, | ||||
|         { | ||||
|             "args": [ | ||||
|                 "publish", | ||||
|                 "--configuration", | ||||
|                 "${input:Configuration}", | ||||
|                 "--runtime", | ||||
|                 "${input:Runtime}", | ||||
|                 "-p:PublishAot=true" | ||||
|             ], | ||||
|             "command": "dotnet", | ||||
|             "label": "App - AOT Publish", | ||||
|             "problemMatcher": "$msCompile", | ||||
|             "type": "process" | ||||
|         }, | ||||
|         { | ||||
|             "command": "(robocopy /MIR \"bin/${input:Configuration}/${input:CoreVersion}/${input:Runtime}/publish\" \"D:/${input:CoreVersion}/${input:Runtime}/${input:Build.Repository.Name}/${input:Configuration}/${input:Build.BuildId}/${input:AssemblyTitle}\") ^& IF %ERRORLEVEL% LEQ 7 exit 0", | ||||
|             "label": "Copy Files to: D:/", | ||||
|             "problemMatcher": [], | ||||
|             "type": "shell" | ||||
|         }, | ||||
|         { | ||||
|             "args": [ | ||||
|                 "tool", | ||||
|                 "restore" | ||||
|             ], | ||||
|             "command": "dotnet", | ||||
|             "label": "Tool Restore", | ||||
|             "problemMatcher": [], | ||||
|             "type": "process" | ||||
|         }, | ||||
|         { | ||||
|             "args": [ | ||||
|                 "ReportGenerator", | ||||
|                 "-reports:${input:System.DefaultWorkingDirectory}/TestResults/**/coverage.cobertura.xml", | ||||
|                 "-targetDir:${input:Build.ArtifactStagingDirectory}/Coverage", | ||||
|                 "-reportTypes:Html_Dark" | ||||
|             ], | ||||
|             "command": "dotnet", | ||||
|             "label": "Report Generator", | ||||
|             "problemMatcher": [], | ||||
|             "type": "process" | ||||
|         }, | ||||
|         { | ||||
|             "args": [ | ||||
|                 "clean", | ||||
|                 "${workspaceFolder}/../Tests/OI.Metrology.Tests.csproj", | ||||
|                 "--configuration", | ||||
|                 "${input:Configuration}" | ||||
|             ], | ||||
|             "command": "dotnet", | ||||
|             "label": "Tests - Clean", | ||||
|             "problemMatcher": "$msCompile", | ||||
|             "type": "process" | ||||
|         }, | ||||
|         { | ||||
|             "args": [ | ||||
|                 "clean", | ||||
|                 "--configuration", | ||||
|                 "${input:Configuration}" | ||||
|             ], | ||||
|             "command": "dotnet", | ||||
|             "label": "App - Clean", | ||||
|             "problemMatcher": "$msCompile", | ||||
|             "type": "process" | ||||
|         }, | ||||
|         { | ||||
|             "command": "C:/Windows/system32/inetsrv/appcmd.exe stop apppool /apppool.name:${input:AssemblyTitle}.${input:Configuration} & exit 0", | ||||
|             "label": "Stop Pool", | ||||
|             "problemMatcher": [], | ||||
|             "type": "shell" | ||||
|         }, | ||||
|         { | ||||
|             "command": "C:/Windows/system32/inetsrv/appcmd.exe stop site /site.name:${input:AssemblyTitle}.${input:Configuration} & exit 0", | ||||
|             "label": "Stop Website", | ||||
|             "problemMatcher": [], | ||||
|             "type": "shell" | ||||
|         }, | ||||
|         { | ||||
|             "command": "rmdir D:/web-sites/${input:AssemblyTitle}.${input:Configuration} & exit 0", | ||||
|             "label": "Remove MKLink", | ||||
|             "problemMatcher": [], | ||||
|             "type": "shell" | ||||
|         }, | ||||
|         { | ||||
|             "command": "mklink /J \"D:\\web-sites\\${input:AssemblyTitle}.${input:Configuration}\" \"D:\\$(CoreVersion)\\$(Runtime)\\$(Build.Repository.Name)\\$(Configuration)\\$(Build.BuildId)\\$(AssemblyTitle)\"", | ||||
|             "label": "Create MKLink", | ||||
|             "problemMatcher": [], | ||||
|             "type": "shell" | ||||
|         }, | ||||
|         { | ||||
|             "command": "mkdir D:/web-sites/${input:AssemblyTitle}.${input:Configuration}/${input:AssemblyTitle}.${input:Configuration} & exit 0", | ||||
|             "label": "Make Directory", | ||||
|             "problemMatcher": [], | ||||
|             "type": "shell" | ||||
|         }, | ||||
|         { | ||||
|             "command": "(robocopy /IS /IT /IM \"%USERPROFILE%/AppData/Roaming/Microsoft/UserSecrets/$(UserSecretsId)\" \"D:/$(CoreVersion)/$(Runtime)/$(Build.Repository.Name)/$(Configuration)/$(Build.BuildId)/$(AssemblyTitle)\" secrets.json) ^& IF %ERRORLEVEL% LEQ 7 exit 0", | ||||
|             "label": "Replace User Secrets Id File", | ||||
|             "problemMatcher": [], | ||||
|             "type": "shell" | ||||
|         }, | ||||
|         { | ||||
|             "command": "(robocopy /IS /IT /IM \"%USERPROFILE%/AppData/Roaming/Microsoft/UserSecrets/$(UserSecretsId)\" \"D:/$(CoreVersion)/$(Runtime)/$(Build.Repository.Name)/$(Configuration)/$(Build.BuildId)/$(AssemblyTitle)\" web.config) ^& IF %ERRORLEVEL% LEQ 7 exit 0", | ||||
|             "label": "Replace Web Configuration File", | ||||
|             "problemMatcher": [], | ||||
|             "type": "shell" | ||||
|         }, | ||||
|         { | ||||
|             "command": "C:/Windows/system32/inetsrv/appcmd.exe start apppool /apppool.name:${input:AssemblyTitle}.${input:Configuration}", | ||||
|             "label": "Start Pool", | ||||
|             "problemMatcher": [], | ||||
|             "type": "shell" | ||||
|         }, | ||||
|         { | ||||
|             "command": "C:/Windows/system32/inetsrv/appcmd.exe start site /site.name:${input:AssemblyTitle}.${input:Configuration}", | ||||
|             "label": "Start Website", | ||||
|             "problemMatcher": [], | ||||
|             "type": "shell" | ||||
|         }, | ||||
|         { | ||||
|             "args": [ | ||||
|                 "App - AOT Publish", | ||||
|                 "Tool Restore", | ||||
|                 "Report Generator" | ||||
|             ], | ||||
|             "command": "echo", | ||||
|             "dependsOn": [ | ||||
|                 "Echo Check", | ||||
|                 "App - Safe storage of app secrets", | ||||
|                 "App - Build", | ||||
|                 "Tests - Build", | ||||
|                 "Tests - Test", | ||||
|                 "App - Publish", | ||||
|                 "Copy Files to: D:/", | ||||
|                 "Tests - Clean", | ||||
|                 "App - Clean", | ||||
|                 "Stop Pool", | ||||
|                 "Stop Website", | ||||
|                 "Remove MKLink", | ||||
|                 "Create MKLink", | ||||
|                 "Make Directory", | ||||
|                 "Replace User Secrets Id File", | ||||
|                 "Replace Web Configuration File", | ||||
|                 "Start Pool", | ||||
|                 "Start Website" | ||||
|             ], | ||||
|             "dependsOrder": "sequence", | ||||
|             "label": "Pipeline", | ||||
|             "problemMatcher": [], | ||||
|             "type": "shell" | ||||
|         } | ||||
|     ] | ||||
|     ], | ||||
|     "version": "2.0.0" | ||||
| } | ||||
| @ -1,4 +1,5 @@ | ||||
| using Microsoft.AspNetCore.Mvc; | ||||
| using OI.Metrology.Server.Models; | ||||
| using OI.Metrology.Shared.Models.Stateless; | ||||
|  | ||||
| namespace OI.Metrology.Server.ApiControllers; | ||||
| @ -8,9 +9,9 @@ namespace OI.Metrology.Server.ApiControllers; | ||||
| public class AppSettingsController : ControllerBase, IAppSettingsController<ActionResult> | ||||
| { | ||||
|  | ||||
|     private readonly IAppSettingsRepository<Models.Binder.AppSettings> _AppSettingsRepository; | ||||
|     private readonly IAppSettingsRepository<AppSettings> _AppSettingsRepository; | ||||
|  | ||||
|     public AppSettingsController(IAppSettingsRepository<Models.Binder.AppSettings> AppSettingsRepository) => _AppSettingsRepository = AppSettingsRepository; | ||||
|     public AppSettingsController(IAppSettingsRepository<AppSettings> AppSettingsRepository) => _AppSettingsRepository = AppSettingsRepository; | ||||
|  | ||||
|     [HttpGet(nameof(IAppSettingsController<ActionResult>.Action.App))] | ||||
|     public ActionResult GetAppSettings() => | ||||
|  | ||||
| @ -1,4 +1,5 @@ | ||||
| using System.Text.Json; | ||||
| using System.Text.Json.Serialization; | ||||
|  | ||||
| namespace OI.Metrology.Server.Models; | ||||
|  | ||||
| @ -36,8 +37,75 @@ public record AppSettings(string ApiFileShare, | ||||
|  | ||||
|     public override string ToString() | ||||
|     { | ||||
|         string result = JsonSerializer.Serialize(this, new JsonSerializerOptions() { WriteIndented = true }); | ||||
|         string result = JsonSerializer.Serialize(this, AppSettingsSourceGenerationContext.Default.AppSettings); | ||||
|         return result; | ||||
|     } | ||||
|  | ||||
|     private static void Verify(AppSettings appSettings) | ||||
|     { | ||||
|         if (string.IsNullOrEmpty(appSettings.Company)) | ||||
|             throw new Exception("Company name must have a value!"); | ||||
|         if (string.IsNullOrEmpty(appSettings.WorkingDirectoryName)) | ||||
|             throw new Exception("Working directory name must have a value!"); | ||||
|     } | ||||
|  | ||||
|     public static AppSettings Get(IConfigurationRoot configurationRoot) | ||||
|     { | ||||
|         AppSettings result; | ||||
|         AppSettings? appSettings = configurationRoot.Get<AppSettings>(); | ||||
| #pragma warning restore IL3050, IL2026 | ||||
|         if (appSettings is null | ||||
|             || appSettings?.Company is null) | ||||
|         { | ||||
|             List<string> paths = []; | ||||
|             foreach (IConfigurationProvider configurationProvider in configurationRoot.Providers) | ||||
|             { | ||||
|                 if (configurationProvider is not Microsoft.Extensions.Configuration.Json.JsonConfigurationProvider jsonConfigurationProvider) | ||||
|                     continue; | ||||
|                 if (jsonConfigurationProvider.Source.FileProvider is not Microsoft.Extensions.FileProviders.PhysicalFileProvider physicalFileProvider) | ||||
|                     continue; | ||||
|                 paths.Add(physicalFileProvider.Root); | ||||
|             } | ||||
|             throw new NotSupportedException($"Not found!{Environment.NewLine}{string.Join(Environment.NewLine, paths.Distinct())}"); | ||||
|         } | ||||
|         result = new(appSettings.ApiFileShare, | ||||
|                      appSettings.ApiLoggingContentTypes, | ||||
|                      appSettings.ApiLoggingPathPrefixes, | ||||
|                      appSettings.ApiLogPath, | ||||
|                      appSettings.ApiUrl, | ||||
|                      appSettings.BuildNumber, | ||||
|                      appSettings.Company, | ||||
|                      appSettings.ConnectionString, | ||||
|                      appSettings.EcCharacterizationSi, | ||||
|                      appSettings.EcMesaFileShareCharacterizationSi, | ||||
|                      appSettings.EcMesaFileShareMetrologySi, | ||||
|                      appSettings.EcMetrologySi, | ||||
|                      appSettings.GitCommitSeven, | ||||
|                      appSettings.InboundApiAllowedIPList, | ||||
|                      appSettings.IqsColumns, | ||||
|                      appSettings.IqsFileSegments, | ||||
|                      appSettings.IqsKey, | ||||
|                      appSettings.IqsRed, | ||||
|                      appSettings.IqsYellow, | ||||
|                      appSettings.IsDevelopment, | ||||
|                      appSettings.IsStaging, | ||||
|                      appSettings.MockRoot, | ||||
|                      appSettings.MonAResource, | ||||
|                      appSettings.MonASite, | ||||
|                      appSettings.OpenInsightApplicationProgrammingInterface, | ||||
|                      appSettings.TableToPath, | ||||
|                      appSettings.URLs, | ||||
|                      appSettings.WaferCounterDestinationDirectory, | ||||
|                      appSettings.WaferCounterTwoFileSecondsWait, | ||||
|                      appSettings.WorkingDirectoryName); | ||||
|         Verify(result); | ||||
|         return result; | ||||
|     } | ||||
|  | ||||
| } | ||||
|  | ||||
| [JsonSourceGenerationOptions(WriteIndented = true)] | ||||
| [JsonSerializable(typeof(AppSettings))] | ||||
| public partial class AppSettingsSourceGenerationContext : JsonSerializerContext | ||||
| { | ||||
| } | ||||
| @ -1,2 +0,0 @@ | ||||
| [*.cs] | ||||
| csharp_preserve_single_line_statements = true | ||||
| @ -1,148 +0,0 @@ | ||||
| using System.Text.Json; | ||||
| using System.Text.Json.Serialization; | ||||
|  | ||||
| namespace OI.Metrology.Server.Models.Binder; | ||||
|  | ||||
| public class AppSettings | ||||
| { | ||||
|  | ||||
|     public string? ApiFileShare { get; set; } | ||||
|     public string? ApiLoggingContentTypes { get; set; } | ||||
|     public string? ApiLoggingPathPrefixes { get; set; } | ||||
|     public string? ApiLogPath { get; set; } | ||||
|     public string? ApiUrl { get; set; } | ||||
|     public string? BuildNumber { get; set; } | ||||
|     public string? Company { get; set; } | ||||
|     public string? ConnectionString { get; set; } | ||||
|     public string? EcCharacterizationSi { get; set; } | ||||
|     public string? EcMesaFileShareCharacterizationSi { get; set; } | ||||
|     public string? EcMesaFileShareMetrologySi { get; set; } | ||||
|     public string? EcMetrologySi { get; set; } | ||||
|     public string? GitCommitSeven { get; set; } | ||||
|     public string? InboundApiAllowedIPList { get; set; } | ||||
|     public string? IqsColumns { get; set; } | ||||
|     public string[]? IqsFileSegments { get; set; } | ||||
|     public string? IqsKey { get; set; } | ||||
|     public string? IqsRed { get; set; } | ||||
|     public string? IqsYellow { get; set; } | ||||
|     public bool? IsDevelopment { get; set; } | ||||
|     public bool? IsStaging { get; set; } | ||||
|     public string? MockRoot { get; set; } | ||||
|     public string? MonAResource { get; set; } | ||||
|     public string? MonASite { get; set; } | ||||
|     public string? OpenInsightApplicationProgrammingInterface { get; set; } | ||||
|     public Dictionary<string, string>? TableToPath { get; set; } | ||||
|     public string? URLs { get; set; } | ||||
|     public string? WaferCounterDestinationDirectory { get; set; } | ||||
|     public int? WaferCounterTwoFileSecondsWait { get; set; } | ||||
|     public string? WorkingDirectoryName { get; set; } | ||||
|  | ||||
|     public override string ToString() | ||||
|     { | ||||
|         string result = JsonSerializer.Serialize(this, new JsonSerializerOptions() { WriteIndented = true }); | ||||
|         return result; | ||||
|     } | ||||
|  | ||||
|     private static void PreVerify(IConfigurationRoot configurationRoot, AppSettings? appSettings) | ||||
|     { | ||||
|         if (appSettings?.ApiFileShare is null) | ||||
|         { | ||||
|             List<string> paths = new(); | ||||
|             foreach (IConfigurationProvider configurationProvider in configurationRoot.Providers) | ||||
|             { | ||||
|                 if (configurationProvider is not Microsoft.Extensions.Configuration.Json.JsonConfigurationProvider jsonConfigurationProvider) | ||||
|                     continue; | ||||
|                 if (jsonConfigurationProvider.Source.FileProvider is not Microsoft.Extensions.FileProviders.PhysicalFileProvider physicalFileProvider) | ||||
|                     continue; | ||||
|                 paths.Add(physicalFileProvider.Root); | ||||
|             } | ||||
|             throw new NotSupportedException($"Not found!{Environment.NewLine}{string.Join(Environment.NewLine, paths.Distinct())}"); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     private static Models.AppSettings Get(AppSettings? appSettings) | ||||
|     { | ||||
|         Models.AppSettings result; | ||||
|         if (appSettings is null) throw new NullReferenceException(nameof(appSettings)); | ||||
|         if (appSettings.ApiFileShare is null) throw new NullReferenceException(nameof(ApiFileShare)); | ||||
|         if (appSettings.ApiLoggingContentTypes is null) throw new NullReferenceException(nameof(ApiLoggingContentTypes)); | ||||
|         if (appSettings.ApiLoggingPathPrefixes is null) throw new NullReferenceException(nameof(ApiLoggingPathPrefixes)); | ||||
|         if (appSettings.ApiLogPath is null) throw new NullReferenceException(nameof(ApiLogPath)); | ||||
|         if (appSettings.ApiUrl is null) throw new NullReferenceException(nameof(ApiUrl)); | ||||
|         if (appSettings.BuildNumber is null) throw new NullReferenceException(nameof(BuildNumber)); | ||||
|         if (appSettings.Company is null) throw new NullReferenceException(nameof(Company)); | ||||
|         if (appSettings.ConnectionString is null) throw new NullReferenceException(nameof(ConnectionString)); | ||||
|         if (appSettings.EcCharacterizationSi is null) throw new NullReferenceException(nameof(EcCharacterizationSi)); | ||||
|         if (appSettings.EcMesaFileShareCharacterizationSi is null) throw new NullReferenceException(nameof(EcMesaFileShareCharacterizationSi)); | ||||
|         if (appSettings.EcMesaFileShareMetrologySi is null) throw new NullReferenceException(nameof(EcMesaFileShareMetrologySi)); | ||||
|         if (appSettings.EcMetrologySi is null) throw new NullReferenceException(nameof(EcMetrologySi)); | ||||
|         if (appSettings.GitCommitSeven is null) throw new NullReferenceException(nameof(GitCommitSeven)); | ||||
|         if (appSettings.InboundApiAllowedIPList is null) throw new NullReferenceException(nameof(InboundApiAllowedIPList)); | ||||
|         if (appSettings.IqsColumns is null) throw new NullReferenceException(nameof(IqsColumns)); | ||||
|         if (appSettings.IqsFileSegments is null) throw new NullReferenceException(nameof(IqsFileSegments)); | ||||
|         if (appSettings.IqsKey is null) throw new NullReferenceException(nameof(IqsKey)); | ||||
|         if (appSettings.IqsRed is null) throw new NullReferenceException(nameof(IqsRed)); | ||||
|         if (appSettings.IqsYellow is null) throw new NullReferenceException(nameof(IqsYellow)); | ||||
|         if (appSettings.IsDevelopment is null) throw new NullReferenceException(nameof(IsDevelopment)); | ||||
|         if (appSettings.IsStaging is null) throw new NullReferenceException(nameof(IsStaging)); | ||||
|         if (appSettings.MockRoot is null) throw new NullReferenceException(nameof(MockRoot)); | ||||
|         if (appSettings.MonAResource is null) throw new NullReferenceException(nameof(MonAResource)); | ||||
|         if (appSettings.MonASite is null) throw new NullReferenceException(nameof(MonASite)); | ||||
|         if (appSettings.OpenInsightApplicationProgrammingInterface is null) throw new NullReferenceException(nameof(OpenInsightApplicationProgrammingInterface)); | ||||
|         if (appSettings.URLs is null) throw new NullReferenceException(nameof(URLs)); | ||||
|         if (appSettings.TableToPath is null) throw new NullReferenceException(nameof(TableToPath)); | ||||
|         if (appSettings.WaferCounterDestinationDirectory is null) throw new NullReferenceException(nameof(WaferCounterDestinationDirectory)); | ||||
|         if (appSettings.WaferCounterTwoFileSecondsWait is null) throw new NullReferenceException(nameof(WaferCounterTwoFileSecondsWait)); | ||||
|         if (appSettings.WorkingDirectoryName is null) throw new NullReferenceException(nameof(WorkingDirectoryName)); | ||||
|         result = new( | ||||
|             appSettings.ApiFileShare, | ||||
|             appSettings.ApiLoggingContentTypes, | ||||
|             appSettings.ApiLoggingPathPrefixes, | ||||
|             appSettings.ApiLogPath, | ||||
|             appSettings.ApiUrl, | ||||
|             appSettings.BuildNumber, | ||||
|             appSettings.Company, | ||||
|             appSettings.ConnectionString, | ||||
|             appSettings.EcCharacterizationSi, | ||||
|             appSettings.EcMesaFileShareCharacterizationSi, | ||||
|             appSettings.EcMesaFileShareMetrologySi, | ||||
|             appSettings.EcMetrologySi, | ||||
|             appSettings.GitCommitSeven, | ||||
|             appSettings.InboundApiAllowedIPList, | ||||
|             appSettings.IqsColumns, | ||||
|             appSettings.IqsFileSegments, | ||||
|             appSettings.IqsKey, | ||||
|             appSettings.IqsRed, | ||||
|             appSettings.IqsYellow, | ||||
|             appSettings.IsDevelopment.Value, | ||||
|             appSettings.IsStaging.Value, | ||||
|             appSettings.MockRoot, | ||||
|             appSettings.MonAResource, | ||||
|             appSettings.MonASite, | ||||
|             appSettings.OpenInsightApplicationProgrammingInterface, | ||||
|             appSettings.TableToPath, | ||||
|             appSettings.URLs, | ||||
|             appSettings.WaferCounterDestinationDirectory, | ||||
|             appSettings.WaferCounterTwoFileSecondsWait.Value, | ||||
|             appSettings.WorkingDirectoryName); | ||||
|         return result; | ||||
|     } | ||||
|  | ||||
|     public static Models.AppSettings Get(IConfigurationRoot configurationRoot) | ||||
|     { | ||||
|         Models.AppSettings result; | ||||
| #pragma warning disable IL3050, IL2026 | ||||
|         AppSettings? appSettings = configurationRoot.Get<AppSettings>(); | ||||
| #pragma warning restore IL3050, IL2026 | ||||
|         PreVerify(configurationRoot, appSettings); | ||||
|         result = Get(appSettings); | ||||
|         return result; | ||||
|     } | ||||
|  | ||||
| } | ||||
|  | ||||
| [JsonSourceGenerationOptions(WriteIndented = true)] | ||||
| [JsonSerializable(typeof(AppSettings))] | ||||
| internal partial class BinderAppSettingsSourceGenerationContext : JsonSerializerContext | ||||
| { | ||||
| } | ||||
| @ -28,19 +28,19 @@ | ||||
|         <PackageReference Include="Dapper" Version="2.1.44" /> | ||||
|         <PackageReference Include="EntityFramework" Version="6.5.1" /> | ||||
|         <PackageReference Include="jQuery" Version="3.7.1" /> | ||||
|         <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.7" /> | ||||
|         <PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="8.0.0" /> | ||||
|         <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" /> | ||||
|         <PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.0" /> | ||||
|         <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" /> | ||||
|         <PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="8.0.0" /> | ||||
|         <PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" /> | ||||
|         <PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" /> | ||||
|         <PackageReference Include="Microsoft.Extensions.Logging.EventLog" Version="8.0.0" /> | ||||
|         <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.10" /> | ||||
|         <PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="8.0.1" /> | ||||
|         <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.1" /> | ||||
|         <PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.1" /> | ||||
|         <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1" /> | ||||
|         <PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="8.0.1" /> | ||||
|         <PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.1" /> | ||||
|         <PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.1" /> | ||||
|         <PackageReference Include="Microsoft.Extensions.Logging.EventLog" Version="8.0.1" /> | ||||
|         <PackageReference Include="Newtonsoft.Json" Version="13.0.3" /> | ||||
|         <PackageReference Include="Swashbuckle.AspNetCore" Version="6.6.2" /> | ||||
|         <PackageReference Include="Swashbuckle.AspNetCore" Version="6.8.1" /> | ||||
|         <PackageReference Include="System.Data.SqlClient" Version="4.8.6" /> | ||||
|         <PackageReference Include="System.Drawing.Common" Version="8.0.7" /> | ||||
|         <PackageReference Include="System.Drawing.Common" Version="8.0.10" /> | ||||
|     </ItemGroup> | ||||
|     <ItemGroup> | ||||
|         <ProjectReference Include="..\Shared\OI.Metrology.Shared.csproj" /> | ||||
|  | ||||
| @ -43,7 +43,7 @@ public class Program | ||||
|         (string assemblyName, WebApplicationOptions _) = Get(args); | ||||
|         WebApplicationBuilder webApplicationBuilder = WebApplication.CreateBuilder(args); | ||||
|         _ = webApplicationBuilder.Configuration.AddUserSecrets<Program>(); | ||||
|         AppSettings appSettings = Models.Binder.AppSettings.Get(webApplicationBuilder.Configuration); | ||||
|         AppSettings appSettings = AppSettings.Get(webApplicationBuilder.Configuration); | ||||
|         if (string.IsNullOrEmpty(appSettings.Company)) | ||||
|             throw new Exception("Company name must have a value!"); | ||||
|         if (string.IsNullOrEmpty(appSettings.WorkingDirectoryName)) | ||||
| @ -78,7 +78,7 @@ public class Program | ||||
|             _ = webApplicationBuilder.Services.AddSingleton<IServiceShopOrderRepository, ServiceShopOrderRepository>(); | ||||
|             _ = webApplicationBuilder.Services.AddSingleton<ISpreadingResistanceProfileService, SpreadingResistanceProfileService>(); | ||||
|             _ = webApplicationBuilder.Services.AddSingleton<IDbConnectionFactory, SQLDbConnectionFactory>(_ => sqlDbConnectionFactory); | ||||
|             _ = webApplicationBuilder.Services.AddSingleton<IAppSettingsRepository<Models.Binder.AppSettings>>(_ => appSettingsRepository); | ||||
|             _ = webApplicationBuilder.Services.AddSingleton<IAppSettingsRepository<AppSettings>>(_ => appSettingsRepository); | ||||
|  | ||||
|             _ = webApplicationBuilder.Services.AddSwaggerGen(); | ||||
|             _ = webApplicationBuilder.Services.AddSession(sessionOptions => | ||||
|  | ||||
| @ -3,27 +3,20 @@ using OI.Metrology.Shared.Models.Stateless; | ||||
|  | ||||
| namespace OI.Metrology.Server.Repository; | ||||
|  | ||||
| public class AppSettingsRepository : IAppSettingsRepository<Models.Binder.AppSettings> | ||||
| public class AppSettingsRepository : IAppSettingsRepository<AppSettings> | ||||
| { | ||||
|  | ||||
|     private readonly AppSettings _AppSettings; | ||||
|  | ||||
|     public AppSettingsRepository(AppSettings appSettings) => _AppSettings = appSettings; | ||||
|  | ||||
|     internal Models.Binder.AppSettings GetAppSettings() | ||||
|     internal AppSettings GetAppSettings() | ||||
|     { | ||||
|         Models.Binder.AppSettings result = new() | ||||
|         { | ||||
|             BuildNumber = _AppSettings.BuildNumber, | ||||
|             Company = _AppSettings.Company, | ||||
|             GitCommitSeven = _AppSettings.GitCommitSeven, | ||||
|             IsDevelopment = _AppSettings.IsDevelopment, | ||||
|             IsStaging = _AppSettings.IsStaging, | ||||
|         }; | ||||
|         AppSettings result = _AppSettings; | ||||
|         return result; | ||||
|     } | ||||
|  | ||||
|     Models.Binder.AppSettings IAppSettingsRepository<Models.Binder.AppSettings>.GetAppSettings() => GetAppSettings(); | ||||
|     AppSettings IAppSettingsRepository<AppSettings>.GetAppSettings() => GetAppSettings(); | ||||
|  | ||||
|     internal string GetBuildNumberAndGitCommitSeven() | ||||
|     { | ||||
| @ -45,8 +38,8 @@ public class AppSettingsRepository : IAppSettingsRepository<Models.Binder.AppSet | ||||
| #endif | ||||
|     } | ||||
|  | ||||
|     string IAppSettingsRepository<Models.Binder.AppSettings>.GetBuildNumberAndGitCommitSeven() => GetBuildNumberAndGitCommitSeven(); | ||||
|     string IAppSettingsRepository<AppSettings>.GetBuildNumberAndGitCommitSeven() => GetBuildNumberAndGitCommitSeven(); | ||||
|  | ||||
|     void IAppSettingsRepository<Models.Binder.AppSettings>.VerifyConnectionStrings() => VerifyConnectionStrings(); | ||||
|     void IAppSettingsRepository<AppSettings>.VerifyConnectionStrings() => VerifyConnectionStrings(); | ||||
|  | ||||
| } | ||||
| @ -2,6 +2,7 @@ using OI.Metrology.Server.Models; | ||||
| using OI.Metrology.Shared.DataModels; | ||||
| using OI.Metrology.Shared.Models; | ||||
| using OI.Metrology.Shared.Models.Stateless; | ||||
| using System.Collections.ObjectModel; | ||||
| using System.Data; | ||||
| using System.Globalization; | ||||
| using System.Text; | ||||
| @ -29,9 +30,16 @@ public class ExportRepository : IExportRepository | ||||
|         _RepositoryName = nameof(ExportRepository)[..^10]; | ||||
|     } | ||||
|  | ||||
|     private static string[] Get() | ||||
|     private static string[] Get(HeaderCommon headerCommon) | ||||
|     { | ||||
|         DateTime dateTime = DateTime.Now; | ||||
|         DateTime dateTime; | ||||
|         if (headerCommon.ID < 1) | ||||
|             dateTime = DateTime.Now; | ||||
|         else | ||||
|         { | ||||
|             DateTimeOffset dateTimeOffset = DateTimeOffset.UnixEpoch.AddSeconds(headerCommon.ID).ToLocalTime(); | ||||
|             dateTime = new(dateTimeOffset.Ticks); | ||||
|         } | ||||
|         DateTime lastWeekDateTime = dateTime.AddDays(-7); | ||||
|         Calendar calendar = new CultureInfo("en-US").Calendar; | ||||
|         string weekOfYear = $"{dateTime:yyyy}_Week_{calendar.GetWeekOfYear(dateTime, CalendarWeekRule.FirstDay, DayOfWeek.Sunday):00}"; | ||||
| @ -39,20 +47,20 @@ public class ExportRepository : IExportRepository | ||||
|         return new string[] { weekOfYear, lastWeekOfYear }; | ||||
|     } | ||||
|  | ||||
|     private NginxFileSystemSortable[] GetNginxFileSystemSortableCollection(HeaderCommon headerCommon, HttpClient httpClient, string endsWith) | ||||
|     private NginxFileSystemSortable[] GetNginxFileSystemSortableCollection(HeaderCommon headerCommon, HttpClient httpClient, string[] endsWithCollection) | ||||
|     { | ||||
|         List<NginxFileSystemSortable> results = new(); | ||||
|         Uri uri; | ||||
|         string[] weeks = Get(); | ||||
|         List<NginxFileSystemSortable> nginxFileSystemSortableCollection; | ||||
|         string[] weeks = Get(headerCommon); | ||||
|         ReadOnlyCollection<NginxFileSystemSortable> collection; | ||||
|         foreach (string weekYear in weeks) | ||||
|         { | ||||
|             if (headerCommon.ID < 1) | ||||
|                 uri = _FileShareRepository.Append(new Uri(_AppSettings.EcMesaFileShareMetrologySi), "Archive", "API", weekYear, $"-{headerCommon.PSN}", $"-{headerCommon.Reactor}", $"-{headerCommon.RDS}"); | ||||
|             else | ||||
|                 uri = _FileShareRepository.Append(new Uri(_AppSettings.EcMesaFileShareMetrologySi), "Archive", "API", weekYear, $"-{headerCommon.PSN}", $"-{headerCommon.Reactor}", $"-{headerCommon.RDS}", $"-{headerCommon.ID}"); | ||||
|             nginxFileSystemSortableCollection = _FileShareRepository.GetNginxFileSystemSortableCollection(httpClient, uri, endsWith); | ||||
|             results.AddRange(nginxFileSystemSortableCollection); | ||||
|             collection = _FileShareRepository.GetNginxFileSystemSortableCollection(httpClient, uri, endsWithCollection); | ||||
|             results.AddRange(collection); | ||||
|         } | ||||
|         return results.OrderByDescending(l => l.DateTime).ToArray(); | ||||
|     } | ||||
| @ -78,7 +86,7 @@ public class ExportRepository : IExportRepository | ||||
|     { | ||||
|         string result; | ||||
|         HttpClient httpClient = _HttpClientFactory.CreateClient(); | ||||
|         NginxFileSystemSortable[] nginxFileSystemSortableCollection = GetNginxFileSystemSortableCollection(headerCommon, httpClient, ".txt"); | ||||
|         NginxFileSystemSortable[] nginxFileSystemSortableCollection = GetNginxFileSystemSortableCollection(headerCommon, httpClient, [".txt"]); | ||||
|         result = GetLines(httpClient, nginxFileSystemSortableCollection); | ||||
|         return result; | ||||
|     } | ||||
| @ -95,7 +103,7 @@ public class ExportRepository : IExportRepository | ||||
|         const string ticks = "Ticks"; | ||||
|         JsonProperty[] jsonProperties; | ||||
|         HttpClient httpClient = _HttpClientFactory.CreateClient(); | ||||
|         NginxFileSystemSortable[] nginxFileSystemSortableCollection = GetNginxFileSystemSortableCollection(headerCommon, httpClient, ".json"); | ||||
|         NginxFileSystemSortable[] nginxFileSystemSortableCollection = GetNginxFileSystemSortableCollection(headerCommon, httpClient, [".json"]); | ||||
|         foreach (NginxFileSystemSortable nginxFileSystemSortable in nginxFileSystemSortableCollection) | ||||
|         { | ||||
|             json = GetLines(httpClient, nginxFileSystemSortableCollection); | ||||
| @ -136,7 +144,7 @@ public class ExportRepository : IExportRepository | ||||
|         string json; | ||||
|         HeaderCommon? hc; | ||||
|         HttpClient httpClient = _HttpClientFactory.CreateClient(); | ||||
|         NginxFileSystemSortable[] nginxFileSystemSortableCollection = GetNginxFileSystemSortableCollection(headerCommon, httpClient, ".json"); | ||||
|         NginxFileSystemSortable[] nginxFileSystemSortableCollection = GetNginxFileSystemSortableCollection(headerCommon, httpClient, [".json"]); | ||||
|         foreach (NginxFileSystemSortable nginxFileSystemSortable in nginxFileSystemSortableCollection) | ||||
|         { | ||||
|             json = GetLines(httpClient, nginxFileSystemSortableCollection); | ||||
| @ -157,7 +165,7 @@ public class ExportRepository : IExportRepository | ||||
|     { | ||||
|         string result; | ||||
|         HttpClient httpClient = _HttpClientFactory.CreateClient(); | ||||
|         NginxFileSystemSortable[] nginxFileSystemSortableCollection = GetNginxFileSystemSortableCollection(headerCommon, httpClient, ".pdsf"); | ||||
|         NginxFileSystemSortable[] nginxFileSystemSortableCollection = GetNginxFileSystemSortableCollection(headerCommon, httpClient, [".pdsf"]); | ||||
|         result = GetLines(httpClient, nginxFileSystemSortableCollection); | ||||
|         return result; | ||||
|     } | ||||
|  | ||||
| @ -1,5 +1,7 @@ | ||||
| using OI.Metrology.Shared.DataModels; | ||||
| using OI.Metrology.Shared.Models; | ||||
| using OI.Metrology.Shared.Models.Stateless; | ||||
| using System.Collections.ObjectModel; | ||||
| using System.Text.Json; | ||||
| using System.Web; | ||||
|  | ||||
| @ -78,7 +80,7 @@ public class FileShareRepository : IFileShareRepository | ||||
|         return result; | ||||
|     } | ||||
|  | ||||
|     List<NginxFileSystemSortable> IFileShareRepository.GetNginxFileSystemSortableCollection(HttpClient httpClient, Uri uri, string? endsWith) | ||||
|     ReadOnlyCollection<NginxFileSystemSortable> IFileShareRepository.GetNginxFileSystemSortableCollection(HttpClient httpClient, Uri uri, string[] endsWithCollection) | ||||
|     { | ||||
|         List<NginxFileSystemSortable> results = new(); | ||||
|         Task<HttpResponseMessage> httpResponseMessage = httpClient.GetAsync(uri); | ||||
| @ -92,15 +94,18 @@ public class FileShareRepository : IFileShareRepository | ||||
|             List<NginxFileSystemSortable> nginxFileSystemSortableCollection = NginxFileSystemSortable.Convert(fileShareRepository, uri, nginxFileSystemCollection); | ||||
|             foreach (NginxFileSystemSortable nginxFileSystemSortable in nginxFileSystemSortableCollection.OrderByDescending(l => l.DateTime)) | ||||
|             { | ||||
|                 if (!string.IsNullOrEmpty(endsWith) && !nginxFileSystemSortable.Name.EndsWith(endsWith)) | ||||
|                 if (!endsWithCollection.Any(l => string.IsNullOrEmpty(l) && !nginxFileSystemSortable.Name.EndsWith(l))) | ||||
|                     continue; | ||||
|                 results.Add(nginxFileSystemSortable); | ||||
|             } | ||||
|         } | ||||
|         return results; | ||||
|         return new(results); | ||||
|     } | ||||
|  | ||||
|     List<CharacterizationInfo> IFileShareRepository.GetArchiveData(CharacterizationParameters archiveParameters) => | ||||
|     ReadOnlyCollection<CharacterizationInfo> IFileShareRepository.GetArchiveData(CharacterizationParameters archiveParameters) => | ||||
|         throw new NotImplementedException(); | ||||
|  | ||||
|     ReadOnlyCollection<ToolTypeNameId> IFileShareRepository.GetEquipmentIds() => | ||||
|         throw new NotImplementedException(); | ||||
|  | ||||
| } | ||||
							
								
								
									
										203
									
								
								Server/server-pipeline.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										203
									
								
								Server/server-pipeline.yml
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,203 @@ | ||||
| trigger: | ||||
|   branches: | ||||
|     include: | ||||
|       - master | ||||
|   paths: | ||||
|     include: | ||||
|       - Server | ||||
|  | ||||
| variables: | ||||
|   runtime: 'win-x64' | ||||
|   coreVersion: 'net8.0' | ||||
|   nugetSource: 'https://artifactory.intra.infineon.com/artifactory/api/nuget/ngt-fi-package-main-vir/' | ||||
|  | ||||
| stages: | ||||
|   - stage: Development | ||||
|     displayName: Development | ||||
|     pool: | ||||
|       name: 'OpenInsight Metrology Viewer' | ||||
|       demands: OpenInsight-Metrology-Viewer-Server-Development | ||||
|     variables: | ||||
|       ASPNETCORE_ENVIRONMENT: 'Development' | ||||
|       assemblyTitle: 'OI.Metrology.Server' | ||||
|       configuration: 'Debug' | ||||
|       userSecretsId: 'b0a3891c-b775-422c-80ee-63a2f385045d' | ||||
|     jobs: | ||||
|       - job: DebugDotnet | ||||
|         steps: | ||||
|           - script: | | ||||
|               echo Assembly Title: $(AssemblyTitle) | ||||
|               echo Build Id: $(Build.BuildId) | ||||
|               echo Build Reason: $(Build.Reason) | ||||
|               echo Repo Id: $(Build.Repository.Id) | ||||
|               echo Repo Name: $(Build.Repository.Name) | ||||
|               echo Source Version: $(Build.SourceVersion) | ||||
|               echo Configuration: $(Configuration) | ||||
|               echo Core Version: $(CoreVersion) | ||||
|               echo Nuget Source: $(NugetSource) | ||||
|               echo Runtime: $(Runtime) | ||||
|               echo UserSecretsId: $(UserSecretsId) | ||||
|             displayName: 'Echo Check' | ||||
|  | ||||
|           - script: | | ||||
|               dotnet user-secrets init | ||||
|               dotnet user-secrets set BuildNumber $(Build.BuildId) | ||||
|               dotnet user-secrets set GitCommit $(Build.SourceVersion) | ||||
|               dotnet user-secrets list | ||||
|             workingDirectory: Server | ||||
|             displayName: 'App - Safe storage of app secrets' | ||||
|  | ||||
|           - script: dotnet build --configuration $(Configuration) --source $(NugetSource) | ||||
|             workingDirectory: Server | ||||
|             displayName: 'App - Build' | ||||
|  | ||||
|           - script: dotnet build --configuration $(Configuration) --source $(NugetSource) | ||||
|             workingDirectory: Tests | ||||
|             displayName: 'Tests - Build' | ||||
|  | ||||
|           - script: dotnet test --configuration $(Configuration) | ||||
|             workingDirectory: Tests | ||||
|             displayName: 'Tests - Test' | ||||
|  | ||||
|           - script: dotnet publish --configuration $(Configuration) --runtime $(Runtime) --self-contained | ||||
|             workingDirectory: Server | ||||
|             displayName: 'App - Publish' | ||||
|  | ||||
|           - script: dotnet publish --configuration $(Configuration) --runtime $(Runtime) -p:PublishAot=true | ||||
|             workingDirectory: Server | ||||
|             displayName: 'App - AOT Publish' | ||||
|             enabled: false | ||||
|  | ||||
|           - task: CopyFiles@2 | ||||
|             displayName: 'Copy Files to: D:\' | ||||
|             inputs: | ||||
|               Contents: '*' | ||||
|               SourceFolder: 'Server\bin\$(Configuration)\$(CoreVersion)\$(Runtime)\publish' | ||||
|               TargetFolder: 'D:\$(CoreVersion)\$(Runtime)\$(Build.Repository.Name)\$(Configuration)\$(Build.BuildId)\$(AssemblyTitle)' | ||||
|               OverWrite: true | ||||
|  | ||||
|           - script: dotnet clean --configuration $(Configuration) | ||||
|             workingDirectory: Tests | ||||
|             displayName: 'Tests - Clean' | ||||
|  | ||||
|           - script: dotnet clean --configuration $(Configuration) | ||||
|             workingDirectory: Server | ||||
|             displayName: 'App - Clean' | ||||
|  | ||||
|           - script: C:/Windows/system32/inetsrv/appcmd.exe stop apppool /apppool.name:$(AssemblyTitle).$(Configuration) | ||||
|             workingDirectory: Server | ||||
|             displayName: 'Stop Pool' | ||||
|             continueOnError: true | ||||
|  | ||||
|           - script: C:/Windows/system32/inetsrv/appcmd.exe stop site /site.name:$(AssemblyTitle).$(Configuration) | ||||
|             workingDirectory: Server | ||||
|             displayName: 'Stop Website' | ||||
|             continueOnError: true | ||||
|  | ||||
|           - script: rmdir "D:\web-sites\$(AssemblyTitle).$(Configuration)" | ||||
|             workingDirectory: Server | ||||
|             displayName: 'Remove MKLink' | ||||
|             continueOnError: true | ||||
|  | ||||
|           - script: mklink /J "D:\web-sites\$(AssemblyTitle).$(Configuration)" "D:\$(CoreVersion)\$(Runtime)\$(Build.Repository.Name)\$(Configuration)\$(Build.BuildId)\$(AssemblyTitle)" | ||||
|             workingDirectory: Server | ||||
|             displayName: 'Create MKLink' | ||||
|  | ||||
|           - script: mkdir "D:\web-sites\$(AssemblyTitle).$(Configuration)\$(AssemblyTitle).$(Configuration)" | ||||
|             workingDirectory: Server | ||||
|             displayName: 'Make Directory' | ||||
|             continueOnError: true | ||||
|  | ||||
|           - script: (robocopy /E /IS /IT /IM "%USERPROFILE%/AppData/Roaming/Microsoft/UserSecrets/$(UserSecretsId)" "D:\$(CoreVersion)\$(Runtime)\$(Build.Repository.Name)\$(Configuration)\$(Build.BuildId)\$(AssemblyTitle)" secrets.json) ^& IF %ERRORLEVEL% LEQ 7 exit 0 | ||||
|             workingDirectory: Server | ||||
|             displayName: 'Replace User Secrets Id File' | ||||
|  | ||||
|           - script: (robocopy /E /IS /IT /IM "%USERPROFILE%/AppData/Roaming/Microsoft/UserSecrets/$(UserSecretsId)" "D:\$(CoreVersion)\$(Runtime)\$(Build.Repository.Name)\$(Configuration)\$(Build.BuildId)\$(AssemblyTitle)" web.config) ^& IF %ERRORLEVEL% LEQ 7 exit 0 | ||||
|             workingDirectory: Server | ||||
|             displayName: 'Replace Web Configuration File' | ||||
|  | ||||
|           - script: C:/Windows/system32/inetsrv/appcmd.exe start apppool /apppool.name:$(AssemblyTitle).$(Configuration) | ||||
|             workingDirectory: Server | ||||
|             displayName: 'Start Pool' | ||||
|  | ||||
|           - script: C:/Windows/system32/inetsrv/appcmd.exe start site /site.name:$(AssemblyTitle).$(Configuration) | ||||
|             workingDirectory: Server | ||||
|             displayName: 'Start Website' | ||||
|  | ||||
|           - script: hurl.exe server-development.hurl --verbose | ||||
|             workingDirectory: Tests | ||||
|             displayName: 'Test Website' | ||||
|  | ||||
|   - stage: Release | ||||
|     displayName: Release | ||||
|     pool: | ||||
|       name: 'OpenInsight Metrology Viewer' | ||||
|       demands: OpenInsight-Metrology-Viewer-Server | ||||
|     variables: | ||||
|       ASPNETCORE_ENVIRONMENT: 'Production' | ||||
|       assemblyTitle: 'OI.Metrology.Server' | ||||
|       configuration: 'Release' | ||||
|     jobs: | ||||
|       - job: ReleaseDotnet | ||||
|         steps: | ||||
|           - script: | | ||||
|               echo Assembly Title: $(AssemblyTitle) | ||||
|               echo Build Id: $(Build.BuildId) | ||||
|               echo Build Reason: $(Build.Reason) | ||||
|               echo Repo Id: $(Build.Repository.Id) | ||||
|               echo Repo Name: $(Build.Repository.Name) | ||||
|               echo Source Version: $(Build.SourceVersion) | ||||
|               echo Configuration: $(Configuration) | ||||
|               echo Core Version: $(CoreVersion) | ||||
|               echo Nuget Source: $(NugetSource) | ||||
|               echo Runtime: $(Runtime) | ||||
|             displayName: 'Echo Check' | ||||
|  | ||||
|           - script: | | ||||
|               dotnet user-secrets init | ||||
|               dotnet user-secrets set BuildNumber $(Build.BuildId) | ||||
|               dotnet user-secrets set GitCommit $(Build.SourceVersion) | ||||
|               dotnet user-secrets list | ||||
|             workingDirectory: Server | ||||
|             displayName: 'App - Safe storage of app secrets' | ||||
|  | ||||
|           - script: dotnet build --configuration $(Configuration) --source $(NugetSource) | ||||
|             workingDirectory: Server | ||||
|             displayName: 'App - Build' | ||||
|  | ||||
|           - script: dotnet build --configuration $(Configuration) --source $(NugetSource) | ||||
|             workingDirectory: Tests | ||||
|             displayName: 'Tests - Build' | ||||
|  | ||||
|           - script: dotnet test --configuration $(Configuration) | ||||
|             workingDirectory: Tests | ||||
|             displayName: 'Tests - Test' | ||||
|  | ||||
|           - script: dotnet publish --configuration $(Configuration) --runtime $(Runtime) --self-contained | ||||
|             workingDirectory: Server | ||||
|             displayName: 'App - Publish' | ||||
|  | ||||
|           - script: dotnet publish --configuration $(Configuration) --runtime $(Runtime) -p:PublishAot=true | ||||
|             workingDirectory: Server | ||||
|             displayName: 'App - AOT Publish' | ||||
|             enabled: false | ||||
|  | ||||
|           - task: CopyFiles@2 | ||||
|             displayName: 'Copy Files to: D:\' | ||||
|             inputs: | ||||
|               Contents: '*' | ||||
|               SourceFolder: 'Server\bin\$(Configuration)\$(CoreVersion)\$(Runtime)\publish' | ||||
|               TargetFolder: 'D:\$(CoreVersion)\$(Runtime)\$(Build.Repository.Name)\$(Configuration)\$(Build.BuildId)\$(AssemblyTitle)' | ||||
|               OverWrite: true | ||||
|  | ||||
|           - script: dotnet clean --configuration $(Configuration) | ||||
|             workingDirectory: Tests | ||||
|             displayName: 'Tests - Clean' | ||||
|  | ||||
|           - script: dotnet clean --configuration $(Configuration) | ||||
|             workingDirectory: Server | ||||
|             displayName: 'App - Clean' | ||||
|  | ||||
|           - script: 'echo $(Build.SourceVersion)-$(Build.BuildId)>bin_x_x_\$(Configuration)\$(CoreVersion)\win-x64\$(Build.Repository.Name).txt' | ||||
|             displayName: 'Force Fail' | ||||
|             enabled: false | ||||
							
								
								
									
										36
									
								
								Shared/DataModels/WaferCounterArchive.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								Shared/DataModels/WaferCounterArchive.cs
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,36 @@ | ||||
| using System.Text.Json.Serialization; | ||||
|  | ||||
| namespace OI.Metrology.Shared.DataModels; | ||||
|  | ||||
| public class WaferCounterArchive | ||||
| { | ||||
|  | ||||
|     public long ID { get; set; } | ||||
|     public DateTime InsertDate { get; set; } | ||||
|     public Guid AttachmentID { get; set; } | ||||
|     public string? Title { get; set; } | ||||
|     public DateTime Date { get; set; } | ||||
|     public long ToolTypeID { get; set; } | ||||
|     public string? ToolTypeName { get; set; } | ||||
|  | ||||
|     public string? MesEntity { get; set; } | ||||
|  | ||||
|     public string? Employee { get; set; } | ||||
|     public string? Layer { get; set; } | ||||
|     public string? PSN { get; set; } | ||||
|     public string? RDS { get; set; } | ||||
|     public string? Reactor { get; set; } | ||||
|     public string? Recipe { get; set; } | ||||
|     public string? Zone { get; set; } | ||||
|  | ||||
|     public string? SlotMap { get; set; } | ||||
|     public string? Text { get; set; } | ||||
|     public int? Total { get; set; } | ||||
|  | ||||
| } | ||||
|  | ||||
| [JsonSourceGenerationOptions(WriteIndented = true, NumberHandling = JsonNumberHandling.AllowReadingFromString)] | ||||
| [JsonSerializable(typeof(WaferCounterArchive))] | ||||
| public partial class WaferCounterArchiveSourceGenerationContext : JsonSerializerContext | ||||
| { | ||||
| } | ||||
| @ -13,4 +13,4 @@ public record CharacterizationParameters([property: JsonPropertyName("area")] st | ||||
| [JsonSerializable(typeof(CharacterizationParameters))] | ||||
| public partial class CharacterizationParametersSourceGenerationContext : JsonSerializerContext | ||||
| { | ||||
| } | ||||
| } | ||||
							
								
								
									
										17
									
								
								Shared/Models/PollValue.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								Shared/Models/PollValue.cs
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,17 @@ | ||||
| using System.Text.Json.Serialization; | ||||
|  | ||||
| namespace OI.Metrology.Shared.Models; | ||||
|  | ||||
| public record PollValue(string? Json, | ||||
|                         [property: JsonPropertyName("id")] int? Id, | ||||
|                         [property: JsonPropertyName("page")] string? Page, | ||||
|                         string? QueryString, | ||||
|                         string? RemoteIpAddress, | ||||
|                         [property: JsonPropertyName("time")] long? Time, | ||||
|                         [property: JsonPropertyName("value")] int? Value); | ||||
|  | ||||
| [JsonSourceGenerationOptions(WriteIndented = true, NumberHandling = JsonNumberHandling.AllowReadingFromString)] | ||||
| [JsonSerializable(typeof(PollValue))] | ||||
| public partial class PollValueSourceGenerationContext : JsonSerializerContext | ||||
| { | ||||
| } | ||||
| @ -1,3 +1,6 @@ | ||||
| using OI.Metrology.Shared.DataModels; | ||||
| using System.Collections.ObjectModel; | ||||
|  | ||||
| namespace OI.Metrology.Shared.Models.Stateless; | ||||
|  | ||||
| public interface IFileShareRepository | ||||
| @ -7,9 +10,10 @@ public interface IFileShareRepository | ||||
|     void MoveFile(string from, string to); | ||||
|     Uri Append(Uri uri, params string[] paths); | ||||
|     void FileWrite(string path, string contents); | ||||
|     ReadOnlyCollection<ToolTypeNameId> GetEquipmentIds(); | ||||
|     HttpResponseMessage ReadFile(HttpClient httpClient, Uri uri); | ||||
|     void CopyFile(HttpClient httpClient, string from, string to); | ||||
|     void MoveFile(HttpClient httpClient, string from, string to); | ||||
|     List<CharacterizationInfo> GetArchiveData(CharacterizationParameters characterizationParameters); | ||||
|     List<NginxFileSystemSortable> GetNginxFileSystemSortableCollection(HttpClient httpClient, Uri uri, string? endsWith); | ||||
|     ReadOnlyCollection<CharacterizationInfo> GetArchiveData(CharacterizationParameters characterizationParameters); | ||||
|     ReadOnlyCollection<NginxFileSystemSortable> GetNginxFileSystemSortableCollection(HttpClient httpClient, Uri uri, string[] endsWithCollection); | ||||
| } | ||||
| @ -29,7 +29,7 @@ | ||||
|         <DefineConstants>Linux</DefineConstants> | ||||
|     </PropertyGroup> | ||||
|     <ItemGroup> | ||||
|         <PackageReference Include="System.Text.Json" Version="8.0.0" /> | ||||
|         <PackageReference Include="System.Text.Json" Version="9.0.7" /> | ||||
|         <PackageReference Include="Newtonsoft.Json" Version="13.0.3" /> | ||||
|         <PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" /> | ||||
|     </ItemGroup> | ||||
|  | ||||
							
								
								
									
										141
									
								
								Static/.vscode/tasks.json
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										141
									
								
								Static/.vscode/tasks.json
									
									
									
									
										vendored
									
									
								
							| @ -1,28 +1,129 @@ | ||||
| { | ||||
|     "version": "2.0.0", | ||||
|     "tasks": [ | ||||
|     "inputs": [ | ||||
|         { | ||||
|             "type": "shell", | ||||
|             "label": "MakeDirctory", | ||||
|             "command": "mkdir", | ||||
|             "args": [ | ||||
|                 "D:\\web-sites\\OI-Metrology\\pp-6737ddfb-_______-OI-Metrology-Release" | ||||
|             "default": "Development", | ||||
|             "description": "Which ASP Net Core Environment?", | ||||
|             "id": "ASPNETCORE_ENVIRONMENT", | ||||
|             "options": [ | ||||
|                 "Development", | ||||
|                 "Production" | ||||
|             ], | ||||
|             "type": "pickString" | ||||
|         }, | ||||
|         { | ||||
|             "type": "shell", | ||||
|             "label": "CopySite", | ||||
|             "command": "robocopy", | ||||
|             "args": [ | ||||
|                 "L:\\DevOps\\Mesa_FI\\OI-Metrology\\Static", | ||||
|                 "D:\\web-sites\\OI-Metrology\\pp-6737ddfb-_______-OI-Metrology-Release\\Static", | ||||
|                 "/E", | ||||
|                 "/MT:6", | ||||
|                 "/NFL", | ||||
|                 "/NDL", | ||||
|                 "/NJH", | ||||
|                 "/NJS" | ||||
|             "default": "{AssemblyTitle}", | ||||
|             "description": "What Assembly Title?", | ||||
|             "id": "AssemblyTitle", | ||||
|             "type": "promptString" | ||||
|         }, | ||||
|         { | ||||
|             "default": "{Build.BuildId}", | ||||
|             "description": "Which Build BuildId?", | ||||
|             "id": "Build.BuildId", | ||||
|             "type": "promptString" | ||||
|         }, | ||||
|         { | ||||
|             "default": "{Build.Reason}", | ||||
|             "description": "Which Build Reason?", | ||||
|             "id": "Build.Reason", | ||||
|             "type": "promptString" | ||||
|         }, | ||||
|         { | ||||
|             "default": "{Build.Repository.Id}", | ||||
|             "description": "Which Build Repository Id?", | ||||
|             "id": "Build.Repository.Id", | ||||
|             "type": "promptString" | ||||
|         }, | ||||
|         { | ||||
|             "default": "{Build.Repository.Name}", | ||||
|             "description": "Which Build Repository Name?", | ||||
|             "id": "Build.Repository.Name", | ||||
|             "type": "promptString" | ||||
|         }, | ||||
|         { | ||||
|             "default": "{Build.SourceVersion}", | ||||
|             "description": "Which Build Source Version?", | ||||
|             "id": "Build.SourceVersion", | ||||
|             "type": "promptString" | ||||
|         }, | ||||
|         { | ||||
|             "default": "Static", | ||||
|             "description": "Which Configuration?", | ||||
|             "id": "Configuration", | ||||
|             "options": [ | ||||
|                 "Debug", | ||||
|                 "Release", | ||||
|                 "Static" | ||||
|             ], | ||||
|             "type": "pickString" | ||||
|         }, | ||||
|         { | ||||
|             "default": "net8.0", | ||||
|             "description": "Which Core Version?", | ||||
|             "id": "CoreVersion", | ||||
|             "options": [ | ||||
|                 "net8.0" | ||||
|             ], | ||||
|             "type": "pickString" | ||||
|         }, | ||||
|         { | ||||
|             "default": "C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/MSBuild/Current/Bin/MSBuild.exe", | ||||
|             "description": "Which MS Build?", | ||||
|             "id": "MSBuild", | ||||
|             "type": "promptString" | ||||
|         }, | ||||
|         { | ||||
|             "default": "https://artifactory.intra.infineon.com/artifactory/api/nuget/ngt-fi-package-main-vir/", | ||||
|             "description": "Which Nuget Source?", | ||||
|             "id": "NugetSource", | ||||
|             "type": "promptString" | ||||
|         }, | ||||
|         { | ||||
|             "default": "win-x64", | ||||
|             "description": "Which Runtime?", | ||||
|             "id": "Runtime", | ||||
|             "options": [ | ||||
|                 "win-x64", | ||||
|                 "win-x32", | ||||
|                 "linux-x64", | ||||
|                 "linux-x32" | ||||
|             ], | ||||
|             "type": "pickString" | ||||
|         }, | ||||
|         { | ||||
|             "default": "L:/", | ||||
|             "description": "Which System DefaultWorkingDirectory?", | ||||
|             "id": "System.DefaultWorkingDirectory", | ||||
|             "options": [ | ||||
|                 "L:/", | ||||
|                 "D:/", | ||||
|                 "C:/" | ||||
|             ], | ||||
|             "type": "pickString" | ||||
|         }, | ||||
|         { | ||||
|             "default": "v4.8", | ||||
|             "description": "Which Core Target Framework Version?", | ||||
|             "id": "TargetFrameworkVersion", | ||||
|             "options": [ | ||||
|                 "v4.8" | ||||
|             ], | ||||
|             "type": "pickString" | ||||
|         }, | ||||
|         { | ||||
|             "default": "{UserSecretsId}", | ||||
|             "description": "Which Core User Secrets Id?", | ||||
|             "id": "UserSecretsId", | ||||
|             "type": "promptString" | ||||
|         } | ||||
|     ] | ||||
|     ], | ||||
|     "tasks": [ | ||||
|         { | ||||
|             "command": "(robocopy /MIR \"../Static\" \"D:/${input:Configuration}/${input:Build.Repository.Name}/${input:Build.Repository.Id}/${input:AssemblyTitle}\") ^& IF %ERRORLEVEL% LEQ 7 exit 0", | ||||
|             "label": "Copy Files to: D:/", | ||||
|             "problemMatcher": [], | ||||
|             "type": "shell" | ||||
|         } | ||||
|     ], | ||||
|     "version": "2.0.0" | ||||
| } | ||||
| @ -50,7 +50,7 @@ | ||||
|                     <li><a href="/export.html">Export</a></li> | ||||
|                     <li><a href="https://oi-metrology-viewer-archive.mes.infineon.com/" target="_blank">Archive</a></li> | ||||
|                     <li><a href="https://goto.infineon.com/oiwizard" target="_blank">OI Web Services</a></li> | ||||
|                     <li><a href="/mes.html" target="_blank">FI Backlog</a></li> | ||||
|                     <li><a href="https://goto.infineon.com/mesareportingservices" target="_blank">Reporting Services</a></li> | ||||
|                 </ul> | ||||
|                 <p class="navbar-text navbar-right"> | ||||
|                       | ||||
| @ -147,7 +147,7 @@ | ||||
|  | ||||
|         <hr /> | ||||
|         <footer> | ||||
|             <p>© 2024 - Infineon Technologies</p> | ||||
|             <p>© 2025 - Infineon Technologies</p> | ||||
|         </footer> | ||||
|     </div> | ||||
|  | ||||
|  | ||||
| @ -50,7 +50,7 @@ | ||||
|                     <li><a href="/export.html">Export</a></li> | ||||
|                     <li><a href="https://oi-metrology-viewer-archive.mes.infineon.com/" target="_blank">Archive</a></li> | ||||
|                     <li><a href="https://goto.infineon.com/oiwizard" target="_blank">OI Web Services</a></li> | ||||
|                     <li><a href="/mes.html" target="_blank">FI Backlog</a></li> | ||||
|                     <li><a href="https://goto.infineon.com/mesareportingservices" target="_blank">Reporting Services</a></li> | ||||
|                 </ul> | ||||
|                 <p class="navbar-text navbar-right"> | ||||
|                       | ||||
| @ -147,7 +147,7 @@ | ||||
|  | ||||
|         <hr /> | ||||
|         <footer> | ||||
|             <p>© 2024 - Infineon Technologies</p> | ||||
|             <p>© 2025 - Infineon Technologies</p> | ||||
|         </footer> | ||||
|     </div> | ||||
|  | ||||
|  | ||||
| @ -50,7 +50,7 @@ | ||||
|                     <li><a href="/export.html">Export</a></li> | ||||
|                     <li><a href="https://oi-metrology-viewer-archive.mes.infineon.com/" target="_blank">Archive</a></li> | ||||
|                     <li><a href="https://goto.infineon.com/oiwizard" target="_blank">OI Web Services</a></li> | ||||
|                     <li><a href="/mes.html" target="_blank">FI Backlog</a></li> | ||||
|                     <li><a href="https://goto.infineon.com/mesareportingservices" target="_blank">Reporting Services</a></li> | ||||
|                 </ul> | ||||
|                 <p class="navbar-text navbar-right"> | ||||
|                       | ||||
| @ -147,7 +147,7 @@ | ||||
|  | ||||
|         <hr /> | ||||
|         <footer> | ||||
|             <p>© 2024 - Infineon Technologies</p> | ||||
|             <p>© 2025 - Infineon Technologies</p> | ||||
|         </footer> | ||||
|     </div> | ||||
|  | ||||
|  | ||||
| @ -50,7 +50,7 @@ | ||||
|                     <li><a href="/export.html">Export</a></li> | ||||
|                     <li><a href="https://oi-metrology-viewer-archive.mes.infineon.com/" target="_blank">Archive</a></li> | ||||
|                     <li><a href="https://goto.infineon.com/oiwizard" target="_blank">OI Web Services</a></li> | ||||
|                     <li><a href="/mes.html" target="_blank">FI Backlog</a></li> | ||||
|                     <li><a href="https://goto.infineon.com/mesareportingservices" target="_blank">Reporting Services</a></li> | ||||
|                 </ul> | ||||
|                 <p class="navbar-text navbar-right"> | ||||
|                       | ||||
| @ -147,7 +147,7 @@ | ||||
|  | ||||
|         <hr /> | ||||
|         <footer> | ||||
|             <p>© 2024 - Infineon Technologies</p> | ||||
|             <p>© 2025 - Infineon Technologies</p> | ||||
|         </footer> | ||||
|     </div> | ||||
|  | ||||
|  | ||||
| @ -50,7 +50,7 @@ | ||||
|                     <li><a href="/export.html">Export</a></li> | ||||
|                     <li><a href="https://oi-metrology-viewer-archive.mes.infineon.com/" target="_blank">Archive</a></li> | ||||
|                     <li><a href="https://goto.infineon.com/oiwizard" target="_blank">OI Web Services</a></li> | ||||
|                     <li><a href="/mes.html" target="_blank">FI Backlog</a></li> | ||||
|                     <li><a href="https://goto.infineon.com/mesareportingservices" target="_blank">Reporting Services</a></li> | ||||
|                 </ul> | ||||
|                 <p class="navbar-text navbar-right"> | ||||
|                       | ||||
| @ -147,7 +147,7 @@ | ||||
|  | ||||
|         <hr /> | ||||
|         <footer> | ||||
|             <p>© 2024 - Infineon Technologies</p> | ||||
|             <p>© 2025 - Infineon Technologies</p> | ||||
|         </footer> | ||||
|     </div> | ||||
|  | ||||
|  | ||||
| @ -50,7 +50,7 @@ | ||||
|                     <li><a href="/export.html">Export</a></li> | ||||
|                     <li><a href="https://oi-metrology-viewer-archive.mes.infineon.com/" target="_blank">Archive</a></li> | ||||
|                     <li><a href="https://goto.infineon.com/oiwizard" target="_blank">OI Web Services</a></li> | ||||
|                     <li><a href="/mes.html" target="_blank">FI Backlog</a></li> | ||||
|                     <li><a href="https://goto.infineon.com/mesareportingservices" target="_blank">Reporting Services</a></li> | ||||
|                 </ul> | ||||
|                 <p class="navbar-text navbar-right"> | ||||
|                       | ||||
| @ -147,7 +147,7 @@ | ||||
|  | ||||
|         <hr /> | ||||
|         <footer> | ||||
|             <p>© 2024 - Infineon Technologies</p> | ||||
|             <p>© 2025 - Infineon Technologies</p> | ||||
|         </footer> | ||||
|     </div> | ||||
|  | ||||
|  | ||||
| @ -50,7 +50,7 @@ | ||||
|                     <li><a href="/export.html">Export</a></li> | ||||
|                     <li><a href="https://oi-metrology-viewer-archive.mes.infineon.com/" target="_blank">Archive</a></li> | ||||
|                     <li><a href="https://goto.infineon.com/oiwizard" target="_blank">OI Web Services</a></li> | ||||
|                     <li><a href="/mes.html" target="_blank">FI Backlog</a></li> | ||||
|                     <li><a href="https://goto.infineon.com/mesareportingservices" target="_blank">Reporting Services</a></li> | ||||
|                 </ul> | ||||
|                 <p class="navbar-text navbar-right"> | ||||
|                       | ||||
| @ -147,7 +147,7 @@ | ||||
|  | ||||
|         <hr /> | ||||
|         <footer> | ||||
|             <p>© 2024 - Infineon Technologies</p> | ||||
|             <p>© 2025 - Infineon Technologies</p> | ||||
|         </footer> | ||||
|     </div> | ||||
|  | ||||
|  | ||||
| @ -50,7 +50,7 @@ | ||||
|                     <li><a href="/export.html">Export</a></li> | ||||
|                     <li><a href="https://oi-metrology-viewer-archive.mes.infineon.com/" target="_blank">Archive</a></li> | ||||
|                     <li><a href="https://goto.infineon.com/oiwizard" target="_blank">OI Web Services</a></li> | ||||
|                     <li><a href="/mes.html" target="_blank">FI Backlog</a></li> | ||||
|                     <li><a href="https://goto.infineon.com/mesareportingservices" target="_blank">Reporting Services</a></li> | ||||
|                 </ul> | ||||
|                 <p class="navbar-text navbar-right"> | ||||
|                       | ||||
| @ -147,7 +147,7 @@ | ||||
|  | ||||
|         <hr /> | ||||
|         <footer> | ||||
|             <p>© 2024 - Infineon Technologies</p> | ||||
|             <p>© 2025 - Infineon Technologies</p> | ||||
|         </footer> | ||||
|     </div> | ||||
|  | ||||
|  | ||||
| @ -50,7 +50,7 @@ | ||||
|                     <li><a href="/export.html">Export</a></li> | ||||
|                     <li><a href="https://oi-metrology-viewer-archive.mes.infineon.com/" target="_blank">Archive</a></li> | ||||
|                     <li><a href="https://goto.infineon.com/oiwizard" target="_blank">OI Web Services</a></li> | ||||
|                     <li><a href="/mes.html" target="_blank">FI Backlog</a></li> | ||||
|                     <li><a href="https://goto.infineon.com/mesareportingservices" target="_blank">Reporting Services</a></li> | ||||
|                 </ul> | ||||
|                 <p class="navbar-text navbar-right"> | ||||
|                       | ||||
| @ -147,7 +147,7 @@ | ||||
|  | ||||
|         <hr /> | ||||
|         <footer> | ||||
|             <p>© 2024 - Infineon Technologies</p> | ||||
|             <p>© 2025 - Infineon Technologies</p> | ||||
|         </footer> | ||||
|     </div> | ||||
|  | ||||
|  | ||||
| @ -49,7 +49,7 @@ | ||||
|                     <li><a href="/export.html">Export</a></li> | ||||
|                     <li><a href="https://oi-metrology-viewer-archive.mes.infineon.com/" target="_blank">Archive</a></li> | ||||
|                     <li><a href="https://goto.infineon.com/oiwizard" target="_blank">OI Web Services</a></li> | ||||
|                     <li><a href="/mes.html" target="_blank">FI Backlog</a></li> | ||||
|                     <li><a href="https://goto.infineon.com/mesareportingservices" target="_blank">Reporting Services</a></li> | ||||
|                 </ul> | ||||
|                 <p class="navbar-text navbar-right"> | ||||
|                       | ||||
| @ -74,7 +74,7 @@ | ||||
|         </div> | ||||
|         <hr /> | ||||
|         <footer> | ||||
|             <p>© 2024 - Infineon Technologies</p> | ||||
|             <p>© 2025 - Infineon Technologies</p> | ||||
|         </footer> | ||||
|     </div> | ||||
|  | ||||
|  | ||||
| @ -50,7 +50,7 @@ | ||||
|                     <li><a href="/export.html" class="alert-info">Export</a></li> | ||||
|                     <li><a href="https://oi-metrology-viewer-archive.mes.infineon.com/" target="_blank">Archive</a></li> | ||||
|                     <li><a href="https://goto.infineon.com/oiwizard" target="_blank">OI Web Services</a></li> | ||||
|                     <li><a href="/mes.html" target="_blank">FI Backlog</a></li> | ||||
|                     <li><a href="https://goto.infineon.com/mesareportingservices" target="_blank">Reporting Services</a></li> | ||||
|                 </ul> | ||||
|                 <p class="navbar-text navbar-right"> | ||||
|                       | ||||
|  | ||||
							
								
								
									
										
											BIN
										
									
								
								Static/favicon.ico
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Static/favicon.ico
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 2.0 KiB | 
| @ -6,25 +6,25 @@ | ||||
|     <meta name="viewport" content="width=device-width" /> | ||||
|     <title>File(s)</title> | ||||
|  | ||||
|     <script src="/js/modernizr-3.6.0-custom.js?no-cache=2024-06-18-10-54" type="text/javascript"></script> | ||||
|     <script src="/js/modernizr-3.6.0-custom.js?no-cache=2024-10-04-08-34" type="text/javascript"></script> | ||||
|  | ||||
|     <link href="/styles/bootstrap.min.css?no-cache=2024-06-18-10-54" rel="stylesheet" /> | ||||
|     <link href="/igniteui/css/themes/bootstrap3/default/infragistics.theme.css?no-cache=2024-06-18-10-54" | ||||
|     <link href="/styles/bootstrap.min.css?no-cache=2024-10-04-08-34" rel="stylesheet" /> | ||||
|     <link href="/igniteui/css/themes/bootstrap3/default/infragistics.theme.css?no-cache=2024-10-04-08-34" | ||||
|         rel="stylesheet" /> | ||||
|     <link href="/igniteui/css/structure/infragistics.css?no-cache=2024-06-18-10-54" rel="stylesheet" /> | ||||
|     <link href="/styles/site-server.css?no-cache=2024-06-18-10-54" rel="stylesheet" /> | ||||
|     <link href="/styles/index.css?no-cache=2024-06-18-10-54" rel="stylesheet" /> | ||||
|     <link href="/igniteui/css/structure/infragistics.css?no-cache=2024-10-04-08-34" rel="stylesheet" /> | ||||
|     <link href="/styles/site-server.css?no-cache=2024-10-04-08-34" rel="stylesheet" /> | ||||
|     <link href="/styles/files.css?no-cache=2024-10-04-08-34" rel="stylesheet" /> | ||||
|  | ||||
|     <script src="/js/jquery-3.6.0.min.js?no-cache=2024-06-18-10-54" type="text/javascript"></script> | ||||
|     <script src="/js/jquery-ui.min.js?no-cache=2024-06-18-10-54" type="text/javascript"></script> | ||||
|     <script src="/igniteui/js/infragistics.core.js?no-cache=2024-06-18-10-54" type="text/javascript"></script> | ||||
|     <script src="/igniteui/js/infragistics.lob.js?no-cache=2024-06-18-10-54" type="text/javascript"></script> | ||||
|     <script src="/igniteui/js/infragistics.dv.js?no-cache=2024-06-18-10-54" type="text/javascript"></script> | ||||
|     <script src="/js/jquery-3.6.0.min.js?no-cache=2024-10-04-08-34" type="text/javascript"></script> | ||||
|     <script src="/js/jquery-ui.min.js?no-cache=2024-10-04-08-34" type="text/javascript"></script> | ||||
|     <script src="/igniteui/js/infragistics.core.js?no-cache=2024-10-04-08-34" type="text/javascript"></script> | ||||
|     <script src="/igniteui/js/infragistics.lob.js?no-cache=2024-10-04-08-34" type="text/javascript"></script> | ||||
|     <script src="/igniteui/js/infragistics.dv.js?no-cache=2024-10-04-08-34" type="text/javascript"></script> | ||||
|  | ||||
|     <script src="/js/chart-4.3.0.min.js" type="module"></script> | ||||
|  | ||||
|     <script src="/js/common.js?no-cache=2024-06-18-10-54" type="text/javascript"></script> | ||||
|     <script src="/js/site-server.js?no-cache=2024-06-18-10-54" type="text/javascript"></script> | ||||
|     <script src="/js/common.js?no-cache=2024-10-04-08-34" type="text/javascript"></script> | ||||
|     <script src="/js/site-server.js?no-cache=2024-10-04-08-34" type="text/javascript"></script> | ||||
| </head> | ||||
|  | ||||
| <body> | ||||
| @ -50,7 +50,7 @@ | ||||
|                     <li><a href="/export.html">Export</a></li> | ||||
|                     <li><a href="https://oi-metrology-viewer-archive.mes.infineon.com/" target="_blank">Archive</a></li> | ||||
|                     <li><a href="https://goto.infineon.com/oiwizard" target="_blank">OI Web Services</a></li> | ||||
|                     <li><a href="/mes.html" target="_blank">FI Backlog</a></li> | ||||
|                     <li><a href="https://goto.infineon.com/mesareportingservices" target="_blank">Reporting Services</a></li> | ||||
|                 </ul> | ||||
|                 <p class="navbar-text navbar-right"> | ||||
|                       | ||||
| @ -64,7 +64,7 @@ | ||||
|  | ||||
|         <form class="form-inline mb-4"> | ||||
|             <div class="form-group"> | ||||
|                 <label for="ToolType">Tool Type</label> | ||||
|                 <label for="ToolType">Tool</label> | ||||
|                 <div class="form-control" id="ToolType"></div> | ||||
|             </div> | ||||
|             <div class="form-group"> | ||||
| @ -94,7 +94,7 @@ | ||||
|             </div> | ||||
|         </form> | ||||
|  | ||||
|         <div style="height: 300px;" id="HeaderGridDiv"> | ||||
|         <div style="height: 500px;" id="HeaderGridDiv"> | ||||
|             <span id="ToolTypeID" hidden></span> | ||||
|             <table id="HeaderGrid"></table> | ||||
|         </div> | ||||
| @ -103,59 +103,27 @@ | ||||
|             <div class="col-xs-1"> | ||||
|                 <input type="button" class="btn" id="GetDataButton" value="Get Data" disabled /> | ||||
|             </div> | ||||
|             <div class="col-xs-1"> | ||||
|                 <input type="button" class="btn" id="ReviewButton" value="Review" disabled /> | ||||
|             </div> | ||||
|             <div class="col-xs-1"> | ||||
|                 <input type="button" class="btn" id="RecipeParametersButton" value="Parameters" disabled /> | ||||
|             </div> | ||||
|             <div class="col-xs-1"> | ||||
|                 <input type="button" class="btn" id="ViewButton" value="View" disabled /> | ||||
|             </div> | ||||
|             <div class="col-xs-1"> | ||||
|                 <input type="button" class="btn" id="PinButton" value="Pin" disabled /> | ||||
|             </div> | ||||
|         </div> | ||||
|  | ||||
|         <div id="DetailsDiv" hidden> | ||||
|  | ||||
|             <span id="HeaderId" hidden></span> | ||||
|             <span id="HeaderAttachmentId" hidden></span> | ||||
|             <div style="padding-bottom: 20px;" id="DetailsGridDiv"> | ||||
|                 <table id="DetailsGrid"></table> | ||||
|             </div> | ||||
|  | ||||
|             <div id="ExportDiv" style="margin-top: 10px;" hidden> | ||||
|                 <input type="button" value="Send to OpenInsight" id="OIExportButton" /> | ||||
|                 <span id="OIExportResult" style="margin-left: 10px; font-weight: bold; color: #366b02;"></span> | ||||
|             </div> | ||||
|  | ||||
|             <p style="margin-top: 20px;"> | ||||
|                 <iframe id="DataAttachmentFrame" style="height:900px; border-width:thin; margin-right: 10px;" | ||||
|                     hidden></iframe> | ||||
|                 <iframe id="HeaderAttachmentFrame" style="height:900px; border-width:thin;" hidden></iframe> | ||||
|                   | ||||
|             <div id="DataAttachmentDiv" hidden> | ||||
|                 <canvas id="DataAttachmentCanvas"></canvas> | ||||
|             </div> | ||||
|             <div id="HeaderAttachmentDiv" hidden> | ||||
|                 <canvas id="HeaderAttachmentCanvas"></canvas> | ||||
|             </div> | ||||
|             </p> | ||||
|  | ||||
|         </div> | ||||
|  | ||||
|         <hr /> | ||||
|         <footer> | ||||
|             <p>© 2024 - Infineon Technologies</p> | ||||
|             <p>© 2025 - Infineon Technologies</p> | ||||
|         </footer> | ||||
|     </div> | ||||
|  | ||||
|     <div id="MessageModal"></div> | ||||
|  | ||||
|     <script src="/js/bootstrap.min.js?no-cache=2024-06-18-10-54" type="text/javascript"></script> | ||||
|     <script src="/js/respond.min.js?no-cache=2024-06-18-10-54" type="text/javascript"></script> | ||||
|     <script src="/js/files.js?no-cache=2024-06-18-10-54" type="text/javascript"></script> | ||||
|     <script src="/js/bootstrap.min.js?no-cache=2024-10-04-08-34" type="text/javascript"></script> | ||||
|     <script src="/js/respond.min.js?no-cache=2024-10-04-08-34" type="text/javascript"></script> | ||||
|     <script src="/js/files.js?no-cache=2024-10-04-08-34" type="text/javascript"></script> | ||||
| </body> | ||||
|  | ||||
| </html> | ||||
| @ -50,7 +50,7 @@ | ||||
|                     <li><a href="/export.html">Export</a></li> | ||||
|                     <li><a href="https://oi-metrology-viewer-archive.mes.infineon.com/" target="_blank">Archive</a></li> | ||||
|                     <li><a href="https://goto.infineon.com/oiwizard" target="_blank">OI Web Services</a></li> | ||||
|                     <li><a href="/mes.html" target="_blank">FI Backlog</a></li> | ||||
|                     <li><a href="https://goto.infineon.com/mesareportingservices" target="_blank">Reporting Services</a></li> | ||||
|                 </ul> | ||||
|                 <p class="navbar-text navbar-right"> | ||||
|                       | ||||
| @ -147,7 +147,7 @@ | ||||
|  | ||||
|         <hr /> | ||||
|         <footer> | ||||
|             <p>© 2024 - Infineon Technologies</p> | ||||
|             <p>© 2025 - Infineon Technologies</p> | ||||
|         </footer> | ||||
|     </div> | ||||
|  | ||||
|  | ||||
| @ -1,10 +1,5 @@ | ||||
| $(document).ready(function () { | ||||
|  | ||||
|     const queryString = window.location.search; | ||||
|     const urlParams = new URLSearchParams(queryString); | ||||
|     const initialHeaderId = urlParams.get('headerid'); | ||||
|     const initialToolTypeID = urlParams.get('tooltypeid'); | ||||
|     const initialHeaderAttachmentId = urlParams.get('headerattachmentid'); | ||||
|     initFiles("https://oi-metrology-viewer-prod.mes.infineon.com:4433/api", "https://oi-metrology-viewer-prod.mes.infineon.com", initialToolTypeID, initialHeaderId, initialHeaderAttachmentId); | ||||
|     initFiles("https://oi-metrology-viewer-prod.mes.infineon.com:4438/api", "https://oi-metrology-viewer-prod.mes.infineon.com", "https://eaf-prod.mes.infineon.com:4439"); | ||||
|  | ||||
| }); | ||||
							
								
								
									
										161
									
								
								Static/js/leo.js
									
									
									
									
									
								
							
							
						
						
									
										161
									
								
								Static/js/leo.js
									
									
									
									
									
								
							| @ -1,161 +0,0 @@ | ||||
| function compareFunction(a, b) { | ||||
|     return a.Priority[0] - b.Priority[0] || a.TimeCriticality[0] - b.TimeCriticality[0] || b.State[0] - a.State[0] || a.Id - b.Id; | ||||
| } | ||||
|  | ||||
| function showOne(rowData) { | ||||
|     if (rowData == null) | ||||
|         return; | ||||
|     var data = []; | ||||
|     data.push({ name: "ADO Edit", value: '<a target="_blank" href="https://tfs.intra.infineon.com/tfs/FactoryIntegration/ART%20SPS/_workitems/edit/' + rowData["Id"] + '">' + rowData["Id"] + '</a>' }); | ||||
|     for (const property in rowData) { | ||||
|         if (rowData[property] == null) | ||||
|             continue; | ||||
|         data.push({ name: property, value: rowData[property].toString() }); | ||||
|     } | ||||
|     $("#AllGrid").igGrid({ | ||||
|         autoGenerateColumns: true, | ||||
|         dataSource: data, | ||||
|         width: "100%", | ||||
|         showHeader: false, | ||||
|     }); | ||||
| } | ||||
|  | ||||
| function loadOne() { | ||||
|     var selectedRow = $("#HeaderGrid").data("igGridSelection").selectedRow(); | ||||
|     if (selectedRow == null) | ||||
|         return; | ||||
|     var rowData = $("#HeaderGrid").data("igGrid").dataSource.dataView()[selectedRow.index]; | ||||
|     showOne(rowData); | ||||
| } | ||||
|  | ||||
| function detailSelectionChangedRunInfo(evt, ui) { | ||||
|     if (ui.row.index === 0) | ||||
|         return; | ||||
|     var rowData = ui.owner.grid.dataSource.dataView()[ui.row.index]; | ||||
|     showOne(rowData); | ||||
| } | ||||
|  | ||||
| function getState(state) { | ||||
|     var result; | ||||
|     if (state == null) | ||||
|         result = "9-Null"; | ||||
|     else if (state === "New") | ||||
|         result = `1-${state}`; | ||||
|     else if (state === "Active") | ||||
|         result = `2-${state}`; | ||||
|     else if (state === "Resolved") | ||||
|         result = `3-${state}`; | ||||
|     else if (state === "Closed") | ||||
|         result = `4-${state}`; | ||||
|     else if (state === "Removed") | ||||
|         result = `5-${state}`; | ||||
|     else | ||||
|         result = `8-${state}`; | ||||
|     return result; | ||||
| } | ||||
|  | ||||
| function getPriority(workItemType, priority) { | ||||
|     var result; | ||||
|     if (workItemType === "Bug") | ||||
|         result = "0-Bug"; | ||||
|     else if (priority == null || priority === 0) | ||||
|         result = "9-Null"; | ||||
|     else if (priority === 1) | ||||
|         result = `${priority}-High`; | ||||
|     else if (priority === 2) | ||||
|         result = `${priority}-Med`; | ||||
|     else if (priority === 3) | ||||
|         result = `${priority}-Low`; | ||||
|     else if (priority === 4) | ||||
|         result = `${priority}-TBD`; | ||||
|     else | ||||
|         result = "8-Not"; | ||||
|     return result; | ||||
| } | ||||
|  | ||||
| function getTimeCriticality(workItemType, timeCriticality) { | ||||
|     var result; | ||||
|     if (workItemType === "Bug") | ||||
|         result = "0-Bug"; | ||||
|     else if (timeCriticality == null || timeCriticality === 0) | ||||
|         result = "9-Null"; | ||||
|     else if (timeCriticality === 1) | ||||
|         result = `${timeCriticality}-QSM`; | ||||
|     else if (timeCriticality === 2) | ||||
|         result = `${timeCriticality}-Qual`; | ||||
|     else if (timeCriticality === 3) | ||||
|         result = `${timeCriticality}-Eff`; | ||||
|     else | ||||
|         result = "8-Not"; | ||||
|     return result; | ||||
| } | ||||
|  | ||||
| function getWorkItems(data) { | ||||
|     var workItems = []; | ||||
|     var workItem; | ||||
|     for (var i = data.length - 1; i > -1; i--) { | ||||
|         workItem = data[i]; | ||||
|         if (workItem.AreaPath !== 'ART SPS\\LEO') | ||||
|             continue; | ||||
|         if (workItem.Tags != null && workItem.Tags.includes("Ignore")) | ||||
|             continue; | ||||
|         if (workItem.WorkItemType !== 'Feature' && workItem.WorkItemType !== 'Bug') | ||||
|             continue; | ||||
|         workItem["State"] = getState(workItem["State"]) | ||||
|         workItem["Priority"] = getPriority(workItem["WorkItemType"], workItem["Priority"]) | ||||
|         workItem["TimeCriticality"] = getTimeCriticality(workItem["WorkItemType"], workItem["TimeCriticality"]) | ||||
|         workItems.push(workItem); | ||||
|     } | ||||
|     workItems.sort(compareFunction); | ||||
|     return workItems; | ||||
| } | ||||
|  | ||||
| function initIndex(url) { | ||||
|     $.getJSON(url, { _: new Date().getTime() }, function (data) { | ||||
|         var workItems = getWorkItems(data); | ||||
|         console.log(data.length); | ||||
|         if (data.length > 0) | ||||
|             console.log(data[0]); | ||||
|         $("#HeaderGrid").igGrid({ | ||||
|             autoGenerateColumns: false, | ||||
|             dataSource: workItems, | ||||
|             height: "100%", | ||||
|             primaryKey: "Id", | ||||
|             width: "100%", | ||||
|             columns: [ | ||||
|                 { key: "Id", dataType: "number" }, | ||||
|                 { key: "Requester", dataType: "string" }, | ||||
|                 { headerText: "Assigned To", key: "AssignedTo", dataType: "string" }, | ||||
|                 { key: "Title", dataType: "string", width: "20%" }, | ||||
|                 { headerText: "System(s)", key: "Tags", dataType: "string" }, | ||||
|                 { key: "Priority", dataType: "string" }, | ||||
|                 { headerText: "Qual/Eff", key: "TimeCriticality", dataType: "string" }, | ||||
|                 { key: "State", dataType: "string" }, | ||||
|                 { headerText: "Effort in Days", key: "Effort", dataType: "number" }, | ||||
|                 { headerText: "UAT as of", key: "ResolvedDate", dataType: "date", format: "date" }, | ||||
|                 { headerText: "CMP Date", key: "ClosedDate", dataType: "date", format: "date" }, | ||||
|                 { headerText: "Target", key: "TargetDate", dataType: "date", format: "date" }, | ||||
|                 { key: "AreaPath", dataType: "string", hidden: true }, | ||||
|                 { key: "AssignedTo", dataType: "string", hidden: true }, | ||||
|                 { key: "BusinessValue", dataType: "number", hidden: true }, | ||||
|                 { key: "ChangedDate", dataType: "string", hidden: true }, | ||||
|                 { key: "CommentCount", dataType: "number", hidden: true }, | ||||
|                 { key: "CreatedDate", dataType: "string", hidden: true }, | ||||
|                 { key: "Description", dataType: "string", hidden: true }, | ||||
|                 { key: "IterationPath", dataType: "string", hidden: true }, | ||||
|                 { key: "Revision", dataType: "number", hidden: true }, | ||||
|                 { key: "RiskReductionMinusOpportunityEnablement", dataType: "string", hidden: true }, | ||||
|                 { key: "StartDate", dataType: "string", hidden: true }, | ||||
|                 { key: "WorkItemType", dataType: "string", hidden: true }, | ||||
|                 { key: "WeightedShortestJobFirst", dataType: "number", hidden: true }, | ||||
|             ], | ||||
|             features: [ | ||||
|                 { name: "Sorting", type: "local" }, | ||||
|                 { name: "Filtering", type: "local" }, | ||||
|                 { name: "Selection", mode: "row", multipleSelection: false, rowSelectionChanging: detailSelectionChangedRunInfo }, | ||||
|                 { name: "Paging", type: "local", recordCountKey: "TotalRows", pageSize: 10, pageSizeUrlKey: "pageSize", "pageIndexUrlKey": "page", showPageSizeDropDown: true }, | ||||
|             ], | ||||
|         }); | ||||
|     }); | ||||
|     $("#HeaderGrid").on("dblclick", "tr", loadOne); | ||||
| } | ||||
							
								
								
									
										161
									
								
								Static/js/mes.js
									
									
									
									
									
								
							
							
						
						
									
										161
									
								
								Static/js/mes.js
									
									
									
									
									
								
							| @ -1,161 +0,0 @@ | ||||
| function compareFunction(a, b) { | ||||
|     return a.Priority[0] - b.Priority[0] || a.TimeCriticality[0] - b.TimeCriticality[0] || b.State[0] - a.State[0] || a.Id - b.Id; | ||||
| } | ||||
|  | ||||
| function showOne(rowData) { | ||||
|     if (rowData == null) | ||||
|         return; | ||||
|     var data = []; | ||||
|     data.push({ name: "Edit in ADO", value: '<a target="_blank" href="https://tfs.intra.infineon.com/tfs/FactoryIntegration/ART%20SPS/_workitems/edit/' + rowData["Id"] + '">Edit in ADO ' + rowData["Id"] + '</a>' }); | ||||
|     for (const property in rowData) { | ||||
|         if (rowData[property] == null) | ||||
|             continue; | ||||
|         data.push({ name: property, value: rowData[property].toString() }); | ||||
|     } | ||||
|     $("#AllGrid").igGrid({ | ||||
|         autoGenerateColumns: true, | ||||
|         dataSource: data, | ||||
|         width: "100%", | ||||
|         showHeader: false, | ||||
|     }); | ||||
| } | ||||
|  | ||||
| function loadOne() { | ||||
|     var selectedRow = $("#HeaderGrid").data("igGridSelection").selectedRow(); | ||||
|     if (selectedRow == null) | ||||
|         return; | ||||
|     var rowData = $("#HeaderGrid").data("igGrid").dataSource.dataView()[selectedRow.index]; | ||||
|     showOne(rowData); | ||||
| } | ||||
|  | ||||
| function detailSelectionChangedRunInfo(evt, ui) { | ||||
|     if (ui.row.index === 0) | ||||
|         return; | ||||
|     var rowData = ui.owner.grid.dataSource.dataView()[ui.row.index]; | ||||
|     showOne(rowData); | ||||
| } | ||||
|  | ||||
| function getState(state) { | ||||
|     var result; | ||||
|     if (state == null) | ||||
|         result = "9-Null"; | ||||
|     else if (state === "New") | ||||
|         result = `1-${state}`; | ||||
|     else if (state === "Active") | ||||
|         result = `2-${state}`; | ||||
|     else if (state === "Resolved") | ||||
|         result = `3-${state}`; | ||||
|     else if (state === "Closed") | ||||
|         result = `4-${state}`; | ||||
|     else if (state === "Removed") | ||||
|         result = `5-${state}`; | ||||
|     else | ||||
|         result = `8-${state}`; | ||||
|     return result; | ||||
| } | ||||
|  | ||||
| function getPriority(workItemType, priority) { | ||||
|     var result; | ||||
|     if (workItemType === "Bug") | ||||
|         result = "0-Bug"; | ||||
|     else if (priority == null || priority === 0) | ||||
|         result = "9-Null"; | ||||
|     else if (priority === 1) | ||||
|         result = `${priority}-High`; | ||||
|     else if (priority === 2) | ||||
|         result = `${priority}-Med`; | ||||
|     else if (priority === 3) | ||||
|         result = `${priority}-Low`; | ||||
|     else if (priority === 4) | ||||
|         result = `${priority}-TBD`; | ||||
|     else | ||||
|         result = "8-Not"; | ||||
|     return result; | ||||
| } | ||||
|  | ||||
| function getTimeCriticality(workItemType, timeCriticality) { | ||||
|     var result; | ||||
|     if (workItemType === "Bug") | ||||
|         result = "0-Bug"; | ||||
|     else if (timeCriticality == null || timeCriticality === 0) | ||||
|         result = "9-Null"; | ||||
|     else if (timeCriticality === 1) | ||||
|         result = `${timeCriticality}-QSM`; | ||||
|     else if (timeCriticality === 2) | ||||
|         result = `${timeCriticality}-Qual`; | ||||
|     else if (timeCriticality === 3) | ||||
|         result = `${timeCriticality}-Eff`; | ||||
|     else | ||||
|         result = "8-Not"; | ||||
|     return result; | ||||
| } | ||||
|  | ||||
| function getWorkItems(data) { | ||||
|     var workItems = []; | ||||
|     var workItem; | ||||
|     for (var i = data.length - 1; i > -1; i--) { | ||||
|         workItem = data[i]; | ||||
|         if (workItem.AreaPath !== 'ART SPS\\MES') | ||||
|             continue; | ||||
|         if (workItem.Tags != null && workItem.Tags.includes("Ignore")) | ||||
|             continue; | ||||
|         if (workItem.WorkItemType !== 'Feature' && workItem.WorkItemType !== 'Bug') | ||||
|             continue; | ||||
|         workItem["State"] = getState(workItem["State"]) | ||||
|         workItem["Priority"] = getPriority(workItem["WorkItemType"], workItem["Priority"]) | ||||
|         workItem["TimeCriticality"] = getTimeCriticality(workItem["WorkItemType"], workItem["TimeCriticality"]) | ||||
|         workItems.push(workItem); | ||||
|     } | ||||
|     workItems.sort(compareFunction); | ||||
|     return workItems; | ||||
| } | ||||
|  | ||||
| function initIndex(url) { | ||||
|     $.getJSON(url, { _: new Date().getTime() }, function (data) { | ||||
|         var workItems = getWorkItems(data); | ||||
|         console.log(data.length); | ||||
|         if (data.length > 0) | ||||
|             console.log(data[0]); | ||||
|         $("#HeaderGrid").igGrid({ | ||||
|             autoGenerateColumns: false, | ||||
|             dataSource: workItems, | ||||
|             height: "100%", | ||||
|             primaryKey: "Id", | ||||
|             width: "100%", | ||||
|             columns: [ | ||||
|                 { key: "Id", dataType: "number" }, | ||||
|                 { key: "Requester", dataType: "string" }, | ||||
|                 { headerText: "Assigned To", key: "AssignedTo", dataType: "string" }, | ||||
|                 { key: "Title", dataType: "string", width: "20%" }, | ||||
|                 { headerText: "System(s)", key: "Tags", dataType: "string" }, | ||||
|                 { key: "Priority", dataType: "string" }, | ||||
|                 { headerText: "Qual/Eff", key: "TimeCriticality", dataType: "string" }, | ||||
|                 { key: "State", dataType: "string" }, | ||||
|                 { headerText: "Effort in Days", key: "Effort", dataType: "number" }, | ||||
|                 { headerText: "UAT as of", key: "ResolvedDate", dataType: "date", format: "date" }, | ||||
|                 { headerText: "CMP Date", key: "ClosedDate", dataType: "date", format: "date" }, | ||||
|                 { headerText: "Target", key: "TargetDate", dataType: "date", format: "date" }, | ||||
|                 { key: "AreaPath", dataType: "string", hidden: true }, | ||||
|                 { key: "AssignedTo", dataType: "string", hidden: true }, | ||||
|                 { key: "BusinessValue", dataType: "number", hidden: true }, | ||||
|                 { key: "ChangedDate", dataType: "string", hidden: true }, | ||||
|                 { key: "CommentCount", dataType: "number", hidden: true }, | ||||
|                 { key: "CreatedDate", dataType: "string", hidden: true }, | ||||
|                 { key: "Description", dataType: "string", hidden: true }, | ||||
|                 { key: "IterationPath", dataType: "string", hidden: true }, | ||||
|                 { key: "Revision", dataType: "number", hidden: true }, | ||||
|                 { key: "RiskReductionMinusOpportunityEnablement", dataType: "string", hidden: true }, | ||||
|                 { key: "StartDate", dataType: "string", hidden: true }, | ||||
|                 { key: "WorkItemType", dataType: "string", hidden: true }, | ||||
|                 { key: "WeightedShortestJobFirst", dataType: "number", hidden: true }, | ||||
|             ], | ||||
|             features: [ | ||||
|                 { name: "Sorting", type: "local" }, | ||||
|                 { name: "Filtering", type: "local" }, | ||||
|                 { name: "Selection", mode: "row", multipleSelection: false, rowSelectionChanging: detailSelectionChangedRunInfo }, | ||||
|                 { name: "Paging", type: "local", recordCountKey: "TotalRows", pageSize: 10, pageSizeUrlKey: "pageSize", "pageIndexUrlKey": "page", showPageSizeDropDown: true }, | ||||
|             ], | ||||
|         }); | ||||
|     }); | ||||
|     $("#HeaderGrid").on("dblclick", "tr", loadOne); | ||||
| } | ||||
| @ -2,12 +2,14 @@ var _chart = null; | ||||
| var _CdeId = null; | ||||
| var _apiUrl = null; | ||||
| var _BioRadId = null; | ||||
| var _Collection = []; | ||||
| var _toolType = null; | ||||
| var _StaticUrl = null; | ||||
| var _workMaterial = {}; | ||||
| var _initialHeaderId = null; | ||||
| var _toolTypeMetaData = null; | ||||
| var _initialHeaderAttachmentId = null; | ||||
| var _EcMesaFileShareCharacterizationSi = null; | ||||
|  | ||||
| async function loadRunInfoAwaitingDisposition() { | ||||
|   var row = $("#grid").igGrid("selectedRow"); | ||||
| @ -169,6 +171,34 @@ function loadHeaderGridRunInfo() { | ||||
|   }); | ||||
| } | ||||
|  | ||||
| function loadHeaderGridFiles() { | ||||
|   var toolTypeName = $("#ToolType").igCombo("text"); | ||||
|   $("#ToolTypeID").text(""); | ||||
|   hideDetailsDivRunInfo(); | ||||
|   disableHeaderButtonsRunInfo(); | ||||
|   $("#HeaderId").text(""); | ||||
|   $("#HeaderAttachmentId").text(""); | ||||
|   var gridCreated = $("#HeaderGrid").data("igGrid"); | ||||
|   if (gridCreated) | ||||
|     $("#HeaderGrid").igGrid("destroy"); | ||||
|   $.ajax({ | ||||
|     type: "GET", | ||||
|     url: _EcMesaFileShareCharacterizationSi + "/Archive/" + toolTypeName + ".json", | ||||
|     success: function (r) { | ||||
|       if ((r.Results == null) || (r.Results.ToolType == null) || (r.Results.Metadata == null)) | ||||
|         ShowErrorMessage("Invalid tool-type: " + toolTypeName); | ||||
|       else { | ||||
|         _toolType = r.Results.ToolType; | ||||
|         _toolTypeMetaData = r.Results.Metadata; | ||||
|         requestHeaderDataFiles(); | ||||
|       } | ||||
|     }, | ||||
|     error: function (e) { | ||||
|       DisplayWSMessage("error", "There was an error getting tool-type info by archive.", e); | ||||
|     } | ||||
|   }); | ||||
| } | ||||
|  | ||||
| function disableHeaderButtonsRunInfo() { | ||||
|   $("#GetDataButton").prop("disabled", true); | ||||
|   $("#ReviewButton").prop("disabled", true); | ||||
| @ -632,6 +662,39 @@ function copySelected(attachmentID, title, data) { | ||||
|   copy(allText); | ||||
| } | ||||
|  | ||||
| function copySelectedB(attachmentID, title, collection) { | ||||
|   var allText = ""; | ||||
|   var headerText = ""; | ||||
|   var selectedRow = $("#HeaderGrid").data("igGridSelection").selectedRow(); | ||||
|   if (selectedRow !== null) { | ||||
|     var rowData = $("#HeaderGrid").data("igGrid").dataSource.dataView()[selectedRow.index]; | ||||
|     for (const property in rowData) { | ||||
|       if (property === "ID" || property === attachmentID || property === title) | ||||
|         continue; | ||||
|       allText = allText + property + '\t'; | ||||
|       headerText = headerText + rowData[property] + '\t'; | ||||
|     } | ||||
|   } | ||||
|   for (var i = 0; i < collection.length; i++) { | ||||
|     if (i === 0) { | ||||
|       for (const property in collection[i]) { | ||||
|         if (property === "ID" || property === "InsertDate" || property === attachmentID || property === title) | ||||
|           continue; | ||||
|         allText = allText + property + '\t'; | ||||
|       } | ||||
|       allText = allText + '\r'; | ||||
|     } | ||||
|     allText = allText + headerText; | ||||
|     for (const property in collection[i]) { | ||||
|       if (property === "ID" || property === "InsertDate" || property === attachmentID || property === title) | ||||
|         continue; | ||||
|       allText = allText + collection[i][property] + '\t'; | ||||
|     } | ||||
|     allText = allText + '\r'; | ||||
|   } | ||||
|   copy(allText); | ||||
| } | ||||
|  | ||||
| function loadDetailsRunInfo() { | ||||
|   showDetailsDivRunInfo(); | ||||
|   loadHeaderAttachmentRunInfo(); | ||||
| @ -667,7 +730,7 @@ function loadDetailsRunInfo() { | ||||
|     } | ||||
|   } | ||||
|   $.getJSON(detailsURL, function (data) { | ||||
|     var gridParms = { | ||||
|     var gridParams = { | ||||
|       autoGenerateColumns: false, | ||||
|       primaryKey: "ID", | ||||
|       features: [ | ||||
| @ -682,21 +745,96 @@ function loadDetailsRunInfo() { | ||||
|       dataBound: markAsReviewedRunInfo, | ||||
|     }; | ||||
|     if ((_toolType != null) && (_toolType.DataGridAttributes != null)) { | ||||
|       jQuery.extend(gridParms, JSON.parse(_toolType.DataGridAttributes)); | ||||
|       jQuery.extend(gridParams, JSON.parse(_toolType.DataGridAttributes)); | ||||
|     } | ||||
|     $("#DetailsGrid").igGrid(gridParms); | ||||
|     $("#DetailsGrid").igGrid(gridParams); | ||||
|     if ($("#chkCopyOnGet").is(':checked')) { | ||||
|       copySelected(attachmentID, title, data); | ||||
|     } | ||||
|   }); | ||||
| } | ||||
|  | ||||
| function loadDetailsGridFiles() { | ||||
|   showDetailsDivRunInfo(); | ||||
|   loadHeaderAttachmentRunInfo(); | ||||
|   var collection = []; | ||||
|   var gridCreated = $("#DetailsGrid").data("igGrid"); | ||||
|   if (gridCreated) | ||||
|     $("#DetailsGrid").igGrid("destroy"); | ||||
|   var title = "Title"; | ||||
|   var attachmentID = "AttachmentID"; | ||||
|   var gridColumns = [ | ||||
|     { key: "ID", dataType: "number", hidden: true }, | ||||
|     { key: attachmentID, dataType: "string", hidden: true }, | ||||
|     { key: title, dataType: "string", hidden: true }, | ||||
|   ]; | ||||
|   var selectedRow = $("#HeaderGrid").data("igGridSelection").selectedRow(); | ||||
|   if (selectedRow == null) | ||||
|     return; | ||||
|   var rowData = $("#HeaderGrid").data("igGrid").dataSource.dataView()[selectedRow.index]; | ||||
|   for (var i = 0; i < _Collection.length; i++) { | ||||
|     if (_Collection[i].Details == null || _Collection[i].ID !== rowData.ID || _Collection[i].ArchiveLot !== rowData.ArchiveLot) | ||||
|       continue; | ||||
|     for (var j = 0; j < _Collection[i].Details.length; j++) { | ||||
|       _Collection[i].Details[j]['ID'] = j; | ||||
|       collection.push(_Collection[i].Details[j]); | ||||
|     } | ||||
|   } | ||||
|   if (collection.length === 0) { | ||||
|     gridColumns.push({ | ||||
|       key: "No Data", | ||||
|       headerText: "No Data", | ||||
|       width: "150px", | ||||
|     }); | ||||
|   } | ||||
|   else { | ||||
|     for (var i = 0; i < _toolTypeMetaData.length; i++) { | ||||
|       var f = _toolTypeMetaData[i]; | ||||
|       if ((f.Header == false) && (f.GridDisplayOrder > 0)) { | ||||
|         var col = { | ||||
|           key: f.ApiName, | ||||
|           headerText: f.DisplayTitle, | ||||
|           width: "150px", | ||||
|         }; | ||||
|         if (f.GridAttributes != null) | ||||
|           jQuery.extend(col, JSON.parse(f.GridAttributes)); | ||||
|         if (col.formatter != null) { | ||||
|           if (col.formatter == "boolToYesNo") | ||||
|             col.formatter = boolToYesNo; | ||||
|           else | ||||
|             col.formatter = null; | ||||
|         } | ||||
|         gridColumns.push(col); | ||||
|       } | ||||
|     } | ||||
|   } | ||||
|   var gridParams = { | ||||
|     autoGenerateColumns: false, | ||||
|     primaryKey: "ID", | ||||
|     features: [ | ||||
|       { name: "Selection", mode: "row" }, | ||||
|       { name: "Resizing" }, | ||||
|       { name: "Sorting", type: "local" } | ||||
|     ], | ||||
|     columns: gridColumns, | ||||
|     dataSource: collection, | ||||
|     dataSourceType: 'json' | ||||
|   }; | ||||
|   if ((_toolType != null) && (_toolType.DataGridAttributes != null)) { | ||||
|     jQuery.extend(gridParams, JSON.parse(_toolType.DataGridAttributes)); | ||||
|   } | ||||
|   $("#DetailsGrid").igGrid(gridParams); | ||||
|   if ($("#chkCopyOnGet").is(':checked')) { | ||||
|     copySelectedB(attachmentID, title, collection); | ||||
|   } | ||||
| } | ||||
|  | ||||
| function requestHeaderDataRunInfo() { | ||||
|   var startDate = $("#StartDate").igDatePicker("value"); | ||||
|   var startTime = $("#StartTime").igTimePicker("value"); | ||||
|   var endDate = $("#EndDate").igDatePicker("value"); | ||||
|   var endTime = $("#EndTime").igTimePicker("value"); | ||||
|   var parms = { | ||||
|   var params = { | ||||
|     datebegin: new Date( | ||||
|       startDate.getFullYear(), startDate.getMonth(), startDate.getDate(), | ||||
|       startTime.getHours(), startTime.getMinutes(), startTime.getSeconds()).toISOString(), | ||||
| @ -707,7 +845,7 @@ function requestHeaderDataRunInfo() { | ||||
|   var headerId = 0; | ||||
|   if (_initialHeaderId > 0) { | ||||
|     headerId = _initialHeaderId; | ||||
|     parms.headerid = headerId; | ||||
|     params.headerid = headerId; | ||||
|     $("#HeaderId").text(headerId); | ||||
|     $("#HeaderAttachmentId").text(_initialHeaderAttachmentId); | ||||
|     _initialHeaderId = -1; | ||||
| @ -716,7 +854,7 @@ function requestHeaderDataRunInfo() { | ||||
|     $("#PinButton").hide(); | ||||
|   else | ||||
|     $("#PinButton").show(); | ||||
|   var headerURL = _apiUrl + "/tooltypes/" + _toolType.ID + "/headers?" + $.param(parms); | ||||
|   var headerURL = _apiUrl + "/tooltypes/" + _toolType.ID + "/headers?" + $.param(params); | ||||
|   var gridColumns = [ | ||||
|     { key: "ID", dataType: "number", hidden: true }, | ||||
|     { key: "AttachmentID", dataType: "string", hidden: true }, | ||||
| @ -741,7 +879,7 @@ function requestHeaderDataRunInfo() { | ||||
|       gridColumns.push(col); | ||||
|     } | ||||
|   } | ||||
|   var gridParms = { | ||||
|   var gridParams = { | ||||
|     autoGenerateColumns: false, | ||||
|     primaryKey: "ID", | ||||
|     height: "100%", | ||||
| @ -758,14 +896,100 @@ function requestHeaderDataRunInfo() { | ||||
|     responseDataKey: "Results", | ||||
|   }; | ||||
|   if ((_toolType != null) && (_toolType.HeaderGridAttributes != null)) { | ||||
|     jQuery.extend(gridParms, JSON.parse(_toolType.HeaderGridAttributes)); | ||||
|     jQuery.extend(gridParams, JSON.parse(_toolType.HeaderGridAttributes)); | ||||
|   } | ||||
|   $("#HeaderGrid").igGrid(gridParms); | ||||
|   $("#HeaderGrid").igGrid(gridParams); | ||||
|   if (headerId > 0) { | ||||
|     loadDetailsRunInfo(); | ||||
|   } | ||||
| } | ||||
|  | ||||
| function clearArray(array) { | ||||
|   if (array !== null) { | ||||
|     while (array.length > 0) { | ||||
|       array.pop(); | ||||
|     } | ||||
|   } | ||||
| } | ||||
|  | ||||
| function requestHeaderDataFiles() { | ||||
|   clearArray(_Collection); | ||||
|   var toolTypeName = $("#ToolType").igCombo("text"); | ||||
|   var startDate = $("#StartDate").igDatePicker("value"); | ||||
|   var startTime = $("#StartTime").igTimePicker("value"); | ||||
|   var endDate = $("#EndDate").igDatePicker("value"); | ||||
|   var endTime = $("#EndTime").igTimePicker("value"); | ||||
|   var segments = toolTypeName.split('-'); | ||||
|   var params = { | ||||
|     area: segments.length === 2 ? segments[0] : null, | ||||
|     'end-time': new Date( | ||||
|       endDate.getFullYear(), endDate.getMonth(), endDate.getDate(), | ||||
|       endTime.getHours(), endTime.getMinutes(), endTime.getSeconds()).toISOString(), | ||||
|     'equipment-id': toolTypeName, | ||||
|     'search-pattern': segments.length === 2 ? '*.pdsf' : '*.json', | ||||
|     'start-time': new Date( | ||||
|       startDate.getFullYear(), startDate.getMonth(), startDate.getDate(), | ||||
|       startTime.getHours(), startTime.getMinutes(), startTime.getSeconds()).toISOString(), | ||||
|     'wafer-size': segments.length === 2 ? segments[1] : null, | ||||
|   } | ||||
|   var headerURL = _apiUrl + "/v1/file-share/archive-data/?" + $.param(params); | ||||
|   var gridColumns = [ | ||||
|     { key: "ID", dataType: "number", hidden: true }, | ||||
|     { key: "ArchiveLot", dataType: "string", hidden: true }, | ||||
|     { key: "ArchiveLastWriteTime", dataType: "date", hidden: true }, | ||||
|     { key: "AttachmentID", dataType: "string", hidden: true }, | ||||
|     { key: "Title", dataType: "string", hidden: true }, | ||||
|   ]; | ||||
|   for (var i = 0; i < _toolTypeMetaData.length; i++) { | ||||
|     var f = _toolTypeMetaData[i]; | ||||
|     if ((f.Header == true) && (f.GridDisplayOrder > 0)) { | ||||
|       var col = { | ||||
|         key: f.ApiName, | ||||
|         headerText: f.DisplayTitle, | ||||
|         width: "150px", | ||||
|       }; | ||||
|       if (f.GridAttributes != null) | ||||
|         jQuery.extend(col, JSON.parse(f.GridAttributes)); | ||||
|       if (col.formatter != null) { | ||||
|         if (col.formatter == "boolToYesNo") | ||||
|           col.formatter = boolToYesNo; | ||||
|         else | ||||
|           col.formatter = null; | ||||
|       } | ||||
|       gridColumns.push(col); | ||||
|     } | ||||
|   } | ||||
|   $.getJSON(headerURL, function (data) { | ||||
|     var singleton; | ||||
|     for (var i = 0; i < data.length; i++) { | ||||
|       singleton = JSON.parse(data[i].lines.join(' ')); | ||||
|       singleton['ID'] = i; | ||||
|       singleton['ArchiveLot'] = data[i].lot; | ||||
|       singleton['ArchiveLastWriteTime'] = data[i].lastWriteTime; | ||||
|       _Collection.push(singleton); | ||||
|     } | ||||
|     var gridParams = { | ||||
|       autoGenerateColumns: false, | ||||
|       height: "100%", | ||||
|       width: "100%", | ||||
|       features: [ | ||||
|         { name: "Paging", type: "local", recordCountKey: "TotalRows", pageSize: 100, pageSizeList: [50, 100, 250, 500], pageSizeUrlKey: "pageSize", "pageIndexUrlKey": "page" }, | ||||
|         { name: "Selection", mode: "row", rowSelectionChanged: headerSelectionChangedRunInfo }, | ||||
|         { name: "Filtering", type: "local" }, | ||||
|         { name: 'Resizing' }, | ||||
|         { name: "Sorting", type: "local" } | ||||
|       ], | ||||
|       columns: gridColumns, | ||||
|       dataSource: _Collection, | ||||
|       responseDataKey: "Results", | ||||
|     }; | ||||
|     if ((_toolType != null) && (_toolType.HeaderGridAttributes != null)) { | ||||
|       jQuery.extend(gridParams, JSON.parse(_toolType.HeaderGridAttributes)); | ||||
|     } | ||||
|     $("#HeaderGrid").igGrid(gridParams); | ||||
|   }); | ||||
| } | ||||
|  | ||||
| function reviewButtonRunInfo() { | ||||
|   var toolTypeId = $("#ToolTypeID").text(); | ||||
|   var headerId = parseInt($("#HeaderId").text()); | ||||
| @ -816,19 +1040,19 @@ function recipeParametersButtonRunInfo() { | ||||
|     $.getJSON('https://oi-prod-ec-api.mes.infineon.com:4433/api/oiWizard/materials/rds/' + jsonObject.RDS, function (data) { | ||||
|       $("#RecipeParametersButton").prop("disabled", false); | ||||
|       var text = ""; | ||||
|       var seperator = '\t'; | ||||
|       var separator = '\t'; | ||||
|       for (var i = 0; i < data.rds.rdsLayers.length; i++) { | ||||
|         text = text | ||||
|           + data.rds.rdsLayers[i].EpiTime | ||||
|           + seperator + data.rds.rdsLayers[i].EpiH2Flow | ||||
|           + seperator + data.rds.rdsLayers[i].TCSFlow | ||||
|           + seperator + data.rds.rdsLayers[i].DiluentAdjParam | ||||
|           + seperator + data.rds.rdsLayers[i].EpiH2Flow | ||||
|           + seperator + data.rds.rdsLayers[i].DopantFlow | ||||
|           + seperator + data.rds.rdsLayers[i].FOffset | ||||
|           + seperator + data.rds.rdsLayers[i].SOffset | ||||
|           + seperator + data.rds.rdsLayers[i].ROffset | ||||
|           + seperator + data.rds.rdsLayers[i].SuscEtch; | ||||
|           + separator + data.rds.rdsLayers[i].EpiH2Flow | ||||
|           + separator + data.rds.rdsLayers[i].TCSFlow | ||||
|           + separator + data.rds.rdsLayers[i].DiluentAdjParam | ||||
|           + separator + data.rds.rdsLayers[i].EpiH2Flow | ||||
|           + separator + data.rds.rdsLayers[i].DopantFlow | ||||
|           + separator + data.rds.rdsLayers[i].FOffset | ||||
|           + separator + data.rds.rdsLayers[i].SOffset | ||||
|           + separator + data.rds.rdsLayers[i].ROffset | ||||
|           + separator + data.rds.rdsLayers[i].SuscEtch; | ||||
|       } | ||||
|       $("#textareaClipboard").val(text); | ||||
|       $("#ModalBodyGrid").igGrid({ | ||||
| @ -889,14 +1113,14 @@ function viewButtonRunInfo() { | ||||
|     $.getJSON(detailsURL, function (data) { | ||||
|       var obj = {}; | ||||
|       var text = ""; | ||||
|       var seperator = jsonObject.RDS.length < 6 ? '\r' : '\t'; | ||||
|       for (var i = 0; i < data.Results.length && (jsonObject.RDS.length < 6 || i < 9); i++) { | ||||
|         if (data.Results[i].Thickness) { | ||||
|           text = text + data.Results[i].Thickness + seperator; | ||||
|       var separator = jsonObject.RDS.length < 6 ? '\r' : '\t'; | ||||
|       for (var i = 0; i < data.Results.length; i++) { | ||||
|         if (data.Results[i].Thickness && data.Results[i].Position && parseInt(data.Results[i].Position) > 0) { | ||||
|           text = text + data.Results[i].Thickness + separator; | ||||
|           obj['Point' + (i + 1)] = data.Results[i].Thickness; | ||||
|         } | ||||
|         else if (data.Results[i].Rs) { | ||||
|           text = text + data.Results[i].Rs + seperator; | ||||
|         else if (data.Results[i].Rs && data.Results[i].Position && parseInt(data.Results[i].Position) > 0) { | ||||
|           text = text + data.Results[i].Rs + separator; | ||||
|           obj['Point' + (i + 1)] = data.Results[i].Rs; | ||||
|         } | ||||
|       } | ||||
| @ -968,18 +1192,18 @@ function pinButtonRunInfo() { | ||||
|             responseDataKey: "Results", | ||||
|           }); | ||||
|           var text = ""; | ||||
|           var seperator = '\t'; | ||||
|           var separator = '\t'; | ||||
|           for (var i = 0; i < data.Results.length; i++) { | ||||
|             text = text | ||||
|               + data.Results[i].Point1 | ||||
|               + seperator + data.Results[i].Point2 | ||||
|               + seperator + data.Results[i].Point3 | ||||
|               + seperator + data.Results[i].Point4 | ||||
|               + seperator + data.Results[i].Point5 | ||||
|               + seperator + data.Results[i].Point6 | ||||
|               + seperator + data.Results[i].Point7 | ||||
|               + seperator + data.Results[i].Point8 | ||||
|               + seperator + data.Results[i].Point9; | ||||
|               + separator + data.Results[i].Point2 | ||||
|               + separator + data.Results[i].Point3 | ||||
|               + separator + data.Results[i].Point4 | ||||
|               + separator + data.Results[i].Point5 | ||||
|               + separator + data.Results[i].Point6 | ||||
|               + separator + data.Results[i].Point7 | ||||
|               + separator + data.Results[i].Point8 | ||||
|               + separator + data.Results[i].Point9; | ||||
|           } | ||||
|           $("#textareaClipboard").val(text); | ||||
|           $("#ModalBodyGrid").igGrid({ | ||||
| @ -1274,43 +1498,29 @@ function restartButton() { | ||||
|   clearWorkMaterial(); | ||||
| }; | ||||
|  | ||||
| function initFiles(apiUrl, staticUrl, initialToolTypeID, initialHeaderId, initialHeaderAttachmentId) { | ||||
| function initFiles(apiUrl, staticUrl, ecMesaFileShareCharacterizationSi) { | ||||
|   _apiUrl = apiUrl; | ||||
|   _initialHeaderId = "" | ||||
|   _StaticUrl = staticUrl; | ||||
|   _initialHeaderId = initialHeaderId === null ? "" : initialHeaderId; | ||||
|   _initialHeaderAttachmentId = initialHeaderAttachmentId === null ? "" : initialHeaderAttachmentId; | ||||
|   $.getJSON(_apiUrl + '/tooltypes', function (data) { | ||||
|     for (var i = 0; i < data.Results.length; i++) { | ||||
|       if (data.Results[i].ToolTypeName === "CDE") { | ||||
|         _CdeId = data.Results[i].ID; | ||||
|       } | ||||
|       else if (data.Results[i].ToolTypeName === "BioRad") { | ||||
|         _BioRadId = data.Results[i].ID; | ||||
|       } | ||||
|     } | ||||
|   _initialHeaderAttachmentId = ""; | ||||
|   _EcMesaFileShareCharacterizationSi = ecMesaFileShareCharacterizationSi; | ||||
|   $.getJSON(_apiUrl + '/v1/file-share/equipment-ids', function (data) { | ||||
|     $("#ToolType").igCombo({ | ||||
|       dataSource: data, | ||||
|       responseDataKey: "Results", | ||||
|       textKey: "ToolTypeName", | ||||
|       valueKey: "ID", | ||||
|       textKey: "toolTypeName", | ||||
|       valueKey: "id", | ||||
|       mode: "dropdown", | ||||
|       width: 150, | ||||
|       itemsRendered: function (evt, ui) { | ||||
|         loadHeaderGridRunInfo(); | ||||
|       itemsRendered: function () { | ||||
|         loadHeaderGridFiles(); | ||||
|       }, | ||||
|       selectionChanged: loadHeaderGridRunInfo, | ||||
|       initialSelectedItems: [{ value: initialToolTypeID === null ? 1 : initialToolTypeID }] | ||||
|       selectionChanged: loadHeaderGridFiles, | ||||
|     }); | ||||
|   }); | ||||
|   setInitialDateTimesRunInfo(6 * 60 * 60 * 1000); | ||||
|   $("#HeaderGrid").on("dblclick", "tr", loadDetailsRunInfo); | ||||
|   $("#LoadHeadersButton").click(loadHeaderGridRunInfo); | ||||
|   $("#GetDataButton").click(loadDetailsRunInfo); | ||||
|   $("#ReviewButton").click(reviewButtonRunInfo); | ||||
|   $("#RecipeParametersButton").click(recipeParametersButtonRunInfo); | ||||
|   $("#ViewButton").click(viewButtonRunInfo); | ||||
|   $("#PinButton").click(pinButtonRunInfo); | ||||
|   $("#OIExportButton").click(oiExportButtonRunInfo); | ||||
|   $("#HeaderGrid").on("dblclick", "tr", loadDetailsGridFiles); | ||||
|   $("#LoadHeadersButton").click(loadHeaderGridFiles); | ||||
|   $("#GetDataButton").click(loadDetailsGridFiles); | ||||
|   setInterval(function () { | ||||
|     if ($("#chkAutoRefresh").is(':checked')) { | ||||
|       setInitialDateTimesRunInfo(null); | ||||
|  | ||||
| @ -1,43 +0,0 @@ | ||||
| <!DOCTYPE html> | ||||
| <html> | ||||
|  | ||||
| <head> | ||||
|     <meta charset="utf-8" /> | ||||
|     <meta name="viewport" content="width=device-width" /> | ||||
|     <title>FI Backlog HiRel (Leominster)</title> | ||||
|     <link href="/igniteui/css/themes/bootstrap3/default/infragistics.theme.css?v=2024-09-07-08-19" rel="stylesheet" /> | ||||
|     <link href="/igniteui/css/structure/infragistics.css?v=2024-09-07-08-19" rel="stylesheet" /> | ||||
|     <script src="/js/jquery-3.6.0.min.js?v=2024-09-07-08-19" type="text/javascript"></script> | ||||
|     <script src="/js/jquery-ui.min.js?v=2024-09-07-08-19" type="text/javascript"></script> | ||||
|     <script src="/js/leo.js?v=2024-09-07-08-19" type="text/javascript"></script> | ||||
|     <script src="/igniteui/js/infragistics.core.js?v=2024-09-07-08-19" type="text/javascript"></script> | ||||
|     <script src="/igniteui/js/infragistics.lob.js?v=2024-09-07-08-19" type="text/javascript"></script> | ||||
|     <script src="/igniteui/js/infragistics.dv.js?v=2024-09-07-08-19" type="text/javascript"></script> | ||||
| </head> | ||||
| <body> | ||||
|     <div style="float: right;"> | ||||
|         <a target="_blank" href="/json/Feature.html">Feature(s)</a> | ||||
|     </div> | ||||
|  | ||||
|     <h2>FI Backlog HiRel (Leominster)</h2> | ||||
|  | ||||
|     <div style="height: 550px;" id="HeaderGridDiv"> | ||||
|         <table id="HeaderGrid"></table> | ||||
|     </div> | ||||
|  | ||||
|     <br />  | ||||
|  | ||||
|     <div id="AllGridDiv"> | ||||
|         <table id="AllGrid"></table> | ||||
|     </div> | ||||
|      | ||||
|     <script> | ||||
|      | ||||
|         $(document).ready(function () {     | ||||
|             initIndex("/json/work-items.json?v=2024-09-07-08-19");     | ||||
|         }); | ||||
|      | ||||
|     </script> | ||||
| </body> | ||||
|  | ||||
| </html> | ||||
| @ -1,43 +0,0 @@ | ||||
| <!DOCTYPE html> | ||||
| <html> | ||||
|  | ||||
| <head> | ||||
|     <meta charset="utf-8" /> | ||||
|     <meta name="viewport" content="width=device-width" /> | ||||
|     <title>FI Backlog Mesa</title> | ||||
|     <link href="/igniteui/css/themes/bootstrap3/default/infragistics.theme.css?v=2024-09-07-08-19" rel="stylesheet" /> | ||||
|     <link href="/igniteui/css/structure/infragistics.css?v=2024-09-07-08-19" rel="stylesheet" /> | ||||
|     <script src="/js/jquery-3.6.0.min.js?v=2024-09-07-08-19" type="text/javascript"></script> | ||||
|     <script src="/js/jquery-ui.min.js?v=2024-09-07-08-19" type="text/javascript"></script> | ||||
|     <script src="/js/mes.js?v=2024-09-07-08-19" type="text/javascript"></script> | ||||
|     <script src="/igniteui/js/infragistics.core.js?v=2024-09-07-08-19" type="text/javascript"></script> | ||||
|     <script src="/igniteui/js/infragistics.lob.js?v=2024-09-07-08-19" type="text/javascript"></script> | ||||
|     <script src="/igniteui/js/infragistics.dv.js?v=2024-09-07-08-19" type="text/javascript"></script> | ||||
| </head> | ||||
| <body> | ||||
|     <div style="float: right;"> | ||||
|         <a target="_blank" href="/json/Feature.html">Feature(s)</a> | ||||
|     </div> | ||||
|  | ||||
|     <h2>FI Backlog Mesa</h2> | ||||
|  | ||||
|     <div style="height: 550px;" id="HeaderGridDiv"> | ||||
|         <table id="HeaderGrid"></table> | ||||
|     </div> | ||||
|  | ||||
|     <br />  | ||||
|  | ||||
|     <div id="AllGridDiv"> | ||||
|         <table id="AllGrid"></table> | ||||
|     </div> | ||||
|      | ||||
|     <script> | ||||
|      | ||||
|         $(document).ready(function () {     | ||||
|             initIndex("/json/work-items.json?v=2024-09-07-08-19");     | ||||
|         }); | ||||
|      | ||||
|     </script> | ||||
| </body> | ||||
|  | ||||
| </html> | ||||
| @ -50,7 +50,7 @@ | ||||
|                     <li><a href="/export.html">Export</a></li> | ||||
|                     <li><a href="https://oi-metrology-viewer-archive.mes.infineon.com/" target="_blank">Archive</a></li> | ||||
|                     <li><a href="https://goto.infineon.com/oiwizard" target="_blank">OI Web Services</a></li> | ||||
|                     <li><a href="/mes.html" target="_blank">FI Backlog</a></li> | ||||
|                     <li><a href="https://goto.infineon.com/mesareportingservices" target="_blank">Reporting Services</a></li> | ||||
|                 </ul> | ||||
|                 <p class="navbar-text navbar-right"> | ||||
|                       | ||||
| @ -84,7 +84,7 @@ | ||||
|         </table> | ||||
|         <hr /> | ||||
|         <footer> | ||||
|             <p>© 2024 - Infineon Technologies</p> | ||||
|             <p>© 2025 - Infineon Technologies</p> | ||||
|         </footer> | ||||
|     </div> | ||||
|  | ||||
|  | ||||
							
								
								
									
										47
									
								
								Static/static-pipeline.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										47
									
								
								Static/static-pipeline.yml
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,47 @@ | ||||
| trigger: | ||||
|   branches: | ||||
|     include: | ||||
|       - master | ||||
|   paths: | ||||
|     include: | ||||
|       - Static | ||||
|  | ||||
| stages: | ||||
|   - stage: Static | ||||
|     displayName: Static | ||||
|     pool: | ||||
|       name: 'OpenInsight Metrology Viewer' | ||||
|       demands: OpenInsight-Metrology-Viewer-Wafer-Counter-Static | ||||
|     variables: | ||||
|       assemblyTitle: 'OI.Metrology.Wafer.Static' | ||||
|       configuration: 'Static' | ||||
|     jobs: | ||||
|       - job: Static | ||||
|         steps: | ||||
|           - script: | | ||||
|               echo Assembly Title: $(AssemblyTitle) | ||||
|               echo Build Id: $(Build.BuildId) | ||||
|               echo Build Reason: $(Build.Reason) | ||||
|               echo Repo Id: $(Build.Repository.Id) | ||||
|               echo Repo Name: $(Build.Repository.Name) | ||||
|               echo Source Version: $(Build.SourceVersion) | ||||
|               echo Configuration: $(Configuration) | ||||
|             displayName: 'Echo Check' | ||||
|  | ||||
|           - script: (robocopy /MIR \"..\Static\" \"D:\$(Configuration)\$(Build.Repository.Name)\$(Build.Repository.Id)\$(AssemblyTitle)\") ^& IF %ERRORLEVEL% LEQ 7 exit 0 | ||||
|             workingDirectory: Static | ||||
|             displayName: 'Robocopy' | ||||
|  | ||||
|           - script: rmdir "D:\web-sites\$(AssemblyTitle).$(Configuration)" | ||||
|             workingDirectory: Static | ||||
|             displayName: 'Remove MKLink' | ||||
|             continueOnError: true | ||||
|  | ||||
|           - script: mklink /J "D:\web-sites\$(AssemblyTitle).$(Configuration)" "D:\$(Configuration)\$(Build.Repository.Name)\$(Build.Repository.Id)\$(AssemblyTitle)" | ||||
|             workingDirectory: Static | ||||
|             displayName: 'Create MKLink' | ||||
|  | ||||
|           - script: mkdir "D:\web-sites\$(AssemblyTitle).$(Configuration)\$(AssemblyTitle).$(Configuration)" | ||||
|             workingDirectory: Static | ||||
|             displayName: 'Make Directory' | ||||
|             continueOnError: true | ||||
							
								
								
									
										12
									
								
								Static/styles/files.css
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								Static/styles/files.css
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,12 @@ | ||||
| #HeaderGridDiv, | ||||
| #DetailsGridDiv { | ||||
|     font-size: 12px; | ||||
| } | ||||
|  | ||||
| #HeaderGrid { | ||||
|     font-family: monospace; | ||||
| } | ||||
|  | ||||
| #DetailsGrid { | ||||
|     font-family: monospace; | ||||
| } | ||||
							
								
								
									
										11
									
								
								Tests/.vscode/api-metrology-viewer-dev.http
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								Tests/.vscode/api-metrology-viewer-dev.http
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,11 @@ | ||||
| ### | ||||
| POST http://localhost:5126/api/inbound/cde | ||||
| Accept: application/json | ||||
|  | ||||
| ### | ||||
| GET http://localhost:5126/api/export/headers | ||||
| Accept: application/json | ||||
|  | ||||
| ### | ||||
| POST http://localhost:5003/api/inbound/SRP | ||||
| Accept: application/json | ||||
							
								
								
									
										33
									
								
								Tests/.vscode/api-metrology-viewer.http
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								Tests/.vscode/api-metrology-viewer.http
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,33 @@ | ||||
| ### | ||||
| GET https://oi-metrology-viewer-prod.mes.infineon.com:4433/api/tooltypes | ||||
| Accept: application/json | ||||
|  | ||||
| ### | ||||
| GET https://oi-metrology-viewer-prod.mes.infineon.com:4433/api/export/export | ||||
| Accept: application/json | ||||
|  | ||||
| ### | ||||
| POST http://oi-metrology-viewer-prod.mes.infineon.com:4433/api/inbound/SRP | ||||
| Accept: application/json | ||||
|  | ||||
| ### | ||||
| GET https://oi-metrology-viewer-prod.mes.infineon.com:4433/api/export/pdsf | ||||
| Accept: application/json | ||||
|  | ||||
| { "PSN": "5131", "Reactor": "23", "RDS": "631836", "ID": 1710783849 } | ||||
|  | ||||
| ### | ||||
| GET https://oi-metrology-viewer-prod.mes.infineon.com:4433/api/export/logistics | ||||
| Accept: application/json | ||||
|  | ||||
| { "PSN": "5131", "Reactor": "23", "RDS": "631836", "ID": 1710783849 } | ||||
|  | ||||
| ### | ||||
| GET https://oi-metrology-viewer-prod.mes.infineon.com:4433/api/export/processDataStandardFormat | ||||
| Accept: application/json | ||||
|  | ||||
| { "PSN": "5131", "Reactor": "23", "RDS": "631836", "ID": 1710783849 } | ||||
|  | ||||
| ### | ||||
| GET https://oi-metrology-viewer-prod.mes.infineon.com:4433/api/export/headers | ||||
| Accept: application/json | ||||
							
								
								
									
										19
									
								
								Tests/.vscode/api-v1-InfinityQS.http
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								Tests/.vscode/api-v1-InfinityQS.http
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,19 @@ | ||||
| ### | ||||
| GET https://oi-metrology-viewer-prod.mes.infineon.com:4433/api/InfinityQS/1677273357/header | ||||
| Accept: application/json | ||||
|  | ||||
| ### | ||||
| GET https://oi-metrology-viewer-prod.mes.infineon.com:4433/api/InfinityQS/1677273357/events | ||||
| Accept: application/json | ||||
|  | ||||
| ### | ||||
| GET https://oi-metrology-viewer-prod.mes.infineon.com:4433/api/InfinityQS/1677273357/descriptors | ||||
| Accept: application/json | ||||
|  | ||||
| ### | ||||
| GET https://oi-metrology-viewer-prod.mes.infineon.com:4433/api/InfinityQS/1677273357/data | ||||
| Accept: application/json | ||||
|  | ||||
| ### | ||||
| GET https://oi-metrology-viewer-prod.mes.infineon.com:4433/api/InfinityQS/commandText/?sub_group_id=1677273357&process=61&job=CDE5&part=5012&lot=575908&date_time=2023-02-24 14:15:00 | ||||
| Accept: application/json | ||||
							
								
								
									
										23
									
								
								Tests/.vscode/api-v1-wafer-counter.http
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								Tests/.vscode/api-v1-wafer-counter.http
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,23 @@ | ||||
|  | ||||
| @host = https://oi-metrology-viewer-prod.mes.infineon.com:4438/api/v1/file-share/archive-data/?area=FQA&equipment-id=FQA-8INCH&search-pattern=*.wc&wafer-size=8INCH | ||||
| @hostB = https://oi-metrology-viewer-prod.mes.infineon.com:4437/api/v1 | ||||
| @hostC = https://oi-metrology-viewer-prod.mes.infineon.com:4438/api/v1 | ||||
| @waferSize = 6INCH | ||||
| @area = FQA | ||||
| @cassID = Test | ||||
|  | ||||
| ### | ||||
| GET {{host}}/archive-data/?area=FQA&equipment-id=FQA-8INCH&search-pattern=*.wc&wafer-size=8INCH | ||||
| Accept: application/json | ||||
|  | ||||
| ### | ||||
| GET {{host}}/archive-data/?area=FQA&equipment-id=FQA-8INCH&search-pattern=*.wc&wafer-size=8INCH | ||||
| Accept: application/json | ||||
|  | ||||
| ### | ||||
| GET {{hostC}}/WaferCounter/{{waferSize}}/last-quantity-and-slot-map/?area={{area}}&text={{cassID}} | ||||
| Accept: application/json | ||||
|  | ||||
| ### | ||||
| GET {{hostB}}/file-share/equipment-ids | ||||
| Accept: application/json | ||||
							
								
								
									
										21
									
								
								Tests/.vscode/api-v2-InfinityQS.http
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								Tests/.vscode/api-v2-InfinityQS.http
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,21 @@ | ||||
| @host = https://oi-metrology-viewer-prod.mes.infineon.com/api/InfinityQSV2 | ||||
|  | ||||
| ### | ||||
| GET {{host}}/1677273357/header | ||||
| Accept: application/json | ||||
|  | ||||
| ### | ||||
| GET {{host}}/1677273357/events | ||||
| Accept: application/json | ||||
|  | ||||
| ### | ||||
| GET {{host}}/1677273357/descriptors | ||||
| Accept: application/json | ||||
|  | ||||
| ### | ||||
| GET {{host}}/1677273357/data | ||||
| Accept: application/json | ||||
|  | ||||
| ### | ||||
| GET {{host}}/1677273357/commandText/?process=61&job=CDE5&part=5012&lot=575908&date_time=2023-02-24 14:15:00 | ||||
| Accept: application/json | ||||
							
								
								
									
										20
									
								
								Tests/.vscode/api-v3-InfinityQS.http
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								Tests/.vscode/api-v3-InfinityQS.http
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,20 @@ | ||||
| @host = https://oi-metrology-viewer-prod.mes.infineon.com/api/InfinityQSV3 | ||||
|  | ||||
| ### | ||||
| GET {{host}}/61/product-data-average-sum-of-defects-process-mean-process-sigma?recipe=8IN_IFX_ROTR | ||||
| Accept: application/json | ||||
|  | ||||
| ### | ||||
| GET {{host}}/epi-pro-temp-verificatio | ||||
| Accept: application/json | ||||
|  | ||||
| ### | ||||
| GET {{host}}/epi-pro-temp-verification-row | ||||
| Accept: application/json | ||||
|  | ||||
| ### | ||||
| GET {{host}}/111/header | ||||
| Accept: application/json | ||||
|  | ||||
| ### | ||||
| GET https://oi-metrology-viewer-prod.mes.infineon.com/api/InfinityQSV3/1756084021/header | ||||
							
								
								
									
										32
									
								
								Tests/.vscode/api-v4-InfinityQS.http
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								Tests/.vscode/api-v4-InfinityQS.http
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,32 @@ | ||||
| @host = http://metrology-viewer-prod.mes.infineon.com:5002/api/v4/InfinityQS | ||||
| @hostB = https://oi-metrology-viewer-prod.mes.infineon.com:4435/api/v4/InfinityQS | ||||
| @hostE = https://oi-metrology-viewer-prod.mes.infineon.com:4433/api/t1ooltypes | ||||
| @hostF = https://oi-metrology-viewer-prod.mes.infineon.com:4433/api/v4/InfinityQS | ||||
|  | ||||
| ### | ||||
| GET {{host}}/reactors | ||||
| Accept: application/json | ||||
|  | ||||
| ### | ||||
| GET {{host}}/4589/production-specification | ||||
| Accept: application/json | ||||
|  | ||||
| ### | ||||
| GET {{host}}/engineering-spc-review | ||||
| Accept: application/json | ||||
|  | ||||
| ### | ||||
| GET {{hostB}}/58/last-group-id-with-value/?part=4840&test=1228920625 | ||||
| Accept: application/json | ||||
|  | ||||
| ### | ||||
| GET {{hostE}}/-1/headertitles | ||||
| Accept: application/json | ||||
|  | ||||
| ### | ||||
| GET {{hostF}}/epi-pro-temp-verification | ||||
| Accept: text/html | ||||
|  | ||||
| ### | ||||
| GET {{hostF}}/epi-pro-temp-verification-rows | ||||
| Accept: application/json | ||||
							
								
								
									
										6
									
								
								Tests/.vscode/mklink.md
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								Tests/.vscode/mklink.md
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,6 @@ | ||||
| # mklink | ||||
|  | ||||
| ```bash Thu Aug 29 2024 09:47:22 GMT-0700 (Mountain Standard Time) | ||||
| mklink /J "L:\DevOps\OpenInsight-Metrology-Viewer\OI-Metrology\Tests\.vscode\.UserSecrets-Server" "C:\Users\phares\AppData\Roaming\Microsoft\UserSecrets\b0a3891c-b775-422c-80ee-63a2f385045d" | ||||
| mklink /J "L:\DevOps\OpenInsight-Metrology-Viewer\OI-Metrology\Tests\.vscode\.UserSecrets-Wafer-Counter" "C:\Users\phares\AppData\Roaming\Microsoft\UserSecrets\2a0acd34-8f61-47a3-8818-73fa8fe04902" | ||||
| ``` | ||||
							
								
								
									
										27
									
								
								Tests/.vscode/settings.json
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										27
									
								
								Tests/.vscode/settings.json
									
									
									
									
										vendored
									
									
								
							| @ -1,6 +1,31 @@ | ||||
| { | ||||
|     "files.associations": { | ||||
|         "*.ffs_gui": "xml", | ||||
|         "*.hurl": "http", | ||||
|         "*.org": "ini", | ||||
|         "*.net": "ini", | ||||
|         "default": "ini" | ||||
|     }, | ||||
|     "coverage-gutters.coverageBaseDir": "../.vscode/TestResults/**", | ||||
|     "cSpell.words": [ | ||||
|         "datebegin" | ||||
|         "appsettings", | ||||
|         "BIORAD", | ||||
|         "datebegin", | ||||
|         "dateend", | ||||
|         "Dispo", | ||||
|         "headerid", | ||||
|         "headertitles", | ||||
|         "infineon", | ||||
|         "markasawaiting", | ||||
|         "markasreviewed", | ||||
|         "mesfs", | ||||
|         "messa", | ||||
|         "Newtonsoft", | ||||
|         "pdsf", | ||||
|         "RESIMAPCDE", | ||||
|         "ROTR", | ||||
|         "SGRP", | ||||
|         "Tencor", | ||||
|         "TSNO" | ||||
|     ] | ||||
| } | ||||
							
								
								
									
										47
									
								
								Tests/.vscode/tasks.json
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										47
									
								
								Tests/.vscode/tasks.json
									
									
									
									
										vendored
									
									
								
							| @ -2,43 +2,57 @@ | ||||
|     "version": "2.0.0", | ||||
|     "tasks": [ | ||||
|         { | ||||
|             "label": "build", | ||||
|             "label": "Build", | ||||
|             "command": "dotnet", | ||||
|             "type": "process", | ||||
|             "args": [ | ||||
|                 "build", | ||||
|                 "${workspaceFolder}/OI.Metrology.Tests.csproj", | ||||
|                 "/property:GenerateFullPaths=true", | ||||
|                 "/consoleloggerparameters:NoSummary" | ||||
|                 "build" | ||||
|             ], | ||||
|             "problemMatcher": "$msCompile" | ||||
|         }, | ||||
|         { | ||||
|             "label": "testDebug", | ||||
|             "label": "Test Debug", | ||||
|             "command": "dotnet", | ||||
|             "type": "process", | ||||
|             "args": [ | ||||
|                 "test", | ||||
|                 "${workspaceFolder}/OI.Metrology.Tests.csproj", | ||||
|                 "/property:GenerateFullPaths=true", | ||||
|                 "/consoleloggerparameters:NoSummary" | ||||
|                 "--settings:test.runsettings" | ||||
|             ], | ||||
|             "problemMatcher": "$msCompile" | ||||
|         }, | ||||
|         { | ||||
|             "label": "testRelease", | ||||
|             "label": "Test Debug with Settings", | ||||
|             "command": "dotnet", | ||||
|             "type": "process", | ||||
|             "args": [ | ||||
|                 "test", | ||||
|                 "--settings:Settings.xml" | ||||
|             ], | ||||
|             "problemMatcher": "$msCompile" | ||||
|         }, | ||||
|         { | ||||
|             "label": "Test Release", | ||||
|             "command": "dotnet", | ||||
|             "type": "process", | ||||
|             "args": [ | ||||
|                 "test", | ||||
|                 "${workspaceFolder}/OI.Metrology.Tests.csproj", | ||||
|                 "/property:GenerateFullPaths=true", | ||||
|                 "/consoleloggerparameters:NoSummary", | ||||
|                 "-c", | ||||
|                 "Release" | ||||
|             ], | ||||
|             "problemMatcher": "$msCompile" | ||||
|         }, | ||||
|         { | ||||
|             "label": "Test Release with Settings", | ||||
|             "command": "dotnet", | ||||
|             "type": "process", | ||||
|             "args": [ | ||||
|                 "test", | ||||
|                 "-c", | ||||
|                 "Release", | ||||
|                 "--settings:Settings.xml" | ||||
|             ], | ||||
|             "problemMatcher": "$msCompile" | ||||
|         }, | ||||
|         { | ||||
|             "label": "Format", | ||||
|             "command": "dotnet", | ||||
| @ -55,7 +69,7 @@ | ||||
|             "problemMatcher": "$msCompile" | ||||
|         }, | ||||
|         { | ||||
|             "label": "Format-Whitespace", | ||||
|             "label": "Format Whitespace", | ||||
|             "command": "dotnet", | ||||
|             "type": "process", | ||||
|             "args": [ | ||||
| @ -65,14 +79,11 @@ | ||||
|             "problemMatcher": "$msCompile" | ||||
|         }, | ||||
|         { | ||||
|             "label": "publish", | ||||
|             "label": "Publish", | ||||
|             "command": "dotnet", | ||||
|             "type": "process", | ||||
|             "args": [ | ||||
|                 "publish", | ||||
|                 "${workspaceFolder}/../Server/OI.Metrology.Server.csproj", | ||||
|                 "/property:GenerateFullPaths=true", | ||||
|                 "/consoleloggerparameters:NoSummary", | ||||
|                 "--configuration", | ||||
|                 "Release", | ||||
|                 "--runtime", | ||||
|  | ||||
							
								
								
									
										21
									
								
								Tests/BaseTestClass.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								Tests/BaseTestClass.cs
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,21 @@ | ||||
| using System.Diagnostics; | ||||
|  | ||||
| namespace OI.Metrology.Tests; | ||||
|  | ||||
| public class BaseTestClass | ||||
| { | ||||
|  | ||||
|     private static int _FailedTests; | ||||
|     private readonly int _Threshold = 5; | ||||
|  | ||||
|     protected void IncrementFailedTests() | ||||
|     { | ||||
|         if (++_FailedTests >= _Threshold) | ||||
|         { | ||||
|             for (int i = 0; i < 10; i++) | ||||
|                 Thread.Sleep(500); | ||||
|             Process.GetCurrentProcess().Kill(); | ||||
|         } | ||||
|     } | ||||
|  | ||||
| } | ||||
| @ -26,15 +26,15 @@ | ||||
|         <DefineConstants>Linux</DefineConstants> | ||||
|     </PropertyGroup> | ||||
|     <ItemGroup> | ||||
|         <PackageReference Include="coverlet.collector" Version="6.0.2" /> | ||||
|         <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" /> | ||||
|         <PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.0" /> | ||||
|         <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" /> | ||||
|         <PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" /> | ||||
|         <PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.8" /> | ||||
|         <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.0" /> | ||||
|         <PackageReference Include="MSTest.TestAdapter" Version="3.5.2" /> | ||||
|         <PackageReference Include="MSTest.TestFramework" Version="3.5.2" /> | ||||
|         <PackageReference Include="coverlet.collector" Version="6.0.4" /> | ||||
|         <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.1" /> | ||||
|         <PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.1" /> | ||||
|         <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1" /> | ||||
|         <PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.1" /> | ||||
|         <PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.12" /> | ||||
|         <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" /> | ||||
|         <PackageReference Include="MSTest.TestAdapter" Version="3.7.2" /> | ||||
|         <PackageReference Include="MSTest.TestFramework" Version="3.7.2" /> | ||||
|     </ItemGroup> | ||||
|     <ItemGroup> | ||||
|         <ProjectReference Include="..\Shared\OI.Metrology.Shared.csproj" /> | ||||
|  | ||||
							
								
								
									
										9
									
								
								Tests/Settings.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								Tests/Settings.xml
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,9 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <RunSettings> | ||||
|   <MSTest> | ||||
|     <Parallelize> | ||||
|       <Workers>0</Workers> | ||||
|       <Scope>MethodLevel</Scope> | ||||
|     </Parallelize> | ||||
|   </MSTest> | ||||
| </RunSettings> | ||||
| @ -8,14 +8,14 @@ using System.Net.Http.Json; | ||||
| namespace OI.Metrology.Tests; | ||||
|  | ||||
| [TestClass] | ||||
| public class UnitAwaitingDispoController | ||||
| public class UnitAwaitingDispoController : BaseTestClass | ||||
| { | ||||
|  | ||||
| #pragma warning disable CS8618 | ||||
|  | ||||
|     private static ILogger? _Logger; | ||||
|     private static string _ControllerName; | ||||
|     private static TestContext _TestContext; | ||||
|     public TestContext TestContext { get; set; } | ||||
|     private static WebApplicationFactory<Server.Program>? _WebApplicationFactory; | ||||
|  | ||||
| #pragma warning restore | ||||
| @ -23,19 +23,32 @@ public class UnitAwaitingDispoController | ||||
|     [ClassInitialize] | ||||
|     public static void ClassInitAsync(TestContext testContext) | ||||
|     { | ||||
|         _TestContext = testContext; | ||||
|         _WebApplicationFactory = new WebApplicationFactory<Server.Program>(); | ||||
|         IServiceProvider serviceProvider = _WebApplicationFactory.Services.CreateScope().ServiceProvider; | ||||
|         _Logger = serviceProvider.GetRequiredService<ILogger<Server.Program>>(); | ||||
|         _ControllerName = nameof(Server.ApiControllers.AwaitingDispoController)[..^10]; | ||||
|     } | ||||
|  | ||||
|     private static void NonThrowTryCatch() | ||||
|     { | ||||
|         try | ||||
|         { throw new Exception(); } | ||||
|         catch (Exception) { } | ||||
|     } | ||||
|  | ||||
|     [TestCleanup] | ||||
|     public void TestCleanup() | ||||
|     { | ||||
|         if (TestContext.CurrentTestOutcome == UnitTestOutcome.Failed) | ||||
|             IncrementFailedTests(); | ||||
|     } | ||||
|  | ||||
|     [TestMethod] | ||||
|     public void TestControllerName() | ||||
|     { | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.AreEqual(IAwaitingDispoController<string>.GetRouteName(), _ControllerName); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|     } | ||||
|  | ||||
|     [Ignore] | ||||
| @ -46,8 +59,8 @@ public class UnitAwaitingDispoController | ||||
|         IServiceProvider? serviceProvider = _WebApplicationFactory?.Services.CreateScope().ServiceProvider; | ||||
|         IMetrologyRepository? metrologyRepository = serviceProvider?.GetRequiredService<IMetrologyRepository>(); | ||||
|         IEnumerable<AwaitingDisposition>? awaitingDispositions = metrologyRepository?.GetAwaitingDisposition(); | ||||
|         Assert.IsTrue(awaitingDispositions is not null); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         Assert.IsNotNull(awaitingDispositions); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|     } | ||||
|  | ||||
|     [Ignore] | ||||
| @ -56,10 +69,10 @@ public class UnitAwaitingDispoController | ||||
|     { | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         string? json = await httpClient.GetStringAsync($"api/{_ControllerName}"); | ||||
|         File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(IMetrologyRepository.GetAwaitingDisposition)}Api.json"), json); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|     } | ||||
|  | ||||
|     [Ignore] | ||||
| @ -70,7 +83,7 @@ public class UnitAwaitingDispoController | ||||
|         IServiceProvider? serviceProvider = _WebApplicationFactory?.Services.CreateScope().ServiceProvider; | ||||
|         IMetrologyRepository? metrologyRepository = serviceProvider?.GetRequiredService<IMetrologyRepository>(); | ||||
|         _ = metrologyRepository?.UpdateReviewDate(toolTypeId: 1, headerId: 1, clearDate: false); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|     } | ||||
|  | ||||
|     [Ignore] | ||||
| @ -79,9 +92,9 @@ public class UnitAwaitingDispoController | ||||
|     { | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         _ = await httpClient.GetFromJsonAsync<object>($"api/{_ControllerName}/markasreviewed"); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|     } | ||||
|  | ||||
|     [Ignore] | ||||
| @ -93,7 +106,7 @@ public class UnitAwaitingDispoController | ||||
|         IMetrologyRepository? metrologyRepository = serviceProvider?.GetRequiredService<IMetrologyRepository>(); | ||||
|         int? dateCleared = metrologyRepository?.UpdateReviewDate(toolTypeId: 1, headerId: 1, clearDate: true); | ||||
|         Assert.IsTrue(dateCleared <= 1); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|     } | ||||
|  | ||||
|     [Ignore] | ||||
| @ -102,9 +115,9 @@ public class UnitAwaitingDispoController | ||||
|     { | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         _ = await httpClient.PostAsync($"api/{_ControllerName}/markasawaiting", null); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|     } | ||||
|  | ||||
|     [TestMethod] | ||||
| @ -115,7 +128,7 @@ public class UnitAwaitingDispoController | ||||
|         IMetrologyRepository? metrologyRepository = serviceProvider?.GetRequiredService<IMetrologyRepository>(); | ||||
|         Guid? guid = metrologyRepository?.GetHeaderAttachmentID(toolTypeId: 1, headerId: 1); | ||||
|         Assert.IsNotNull(guid); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|     } | ||||
|  | ||||
|     [TestMethod] | ||||
| @ -123,10 +136,10 @@ public class UnitAwaitingDispoController | ||||
|     { | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         HttpResponseMessage httpResponseMessage = await httpClient.GetAsync($"api/{_ControllerName}/1/header-attachment-id?headerid=1"); | ||||
|         Assert.IsNotNull(httpResponseMessage.Content); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         Assert.IsNotNull(httpResponseMessage.Content.ToString()); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|     } | ||||
|  | ||||
| } | ||||
| @ -8,14 +8,14 @@ using System.Net; | ||||
| namespace OI.Metrology.Tests; | ||||
|  | ||||
| [TestClass] | ||||
| public class UnitTestAppSettingsController | ||||
| public class UnitTestAppSettingsController : BaseTestClass | ||||
| { | ||||
|  | ||||
| #pragma warning disable CS8618 | ||||
|  | ||||
|     private static ILogger? _Logger; | ||||
|     private static string _ControllerName; | ||||
|     private static TestContext _TestContext; | ||||
|     public TestContext TestContext { get; set; } | ||||
|     private static WebApplicationFactory<Server.Program>? _WebApplicationFactory; | ||||
|  | ||||
| #pragma warning restore | ||||
| @ -23,7 +23,6 @@ public class UnitTestAppSettingsController | ||||
|     [ClassInitialize] | ||||
|     public static void ClassInitAsync(TestContext testContext) | ||||
|     { | ||||
|         _TestContext = testContext; | ||||
|         _WebApplicationFactory = new WebApplicationFactory<Server.Program>(); | ||||
|         IServiceProvider serviceProvider = _WebApplicationFactory.Services.CreateScope().ServiceProvider; | ||||
|         _Logger = serviceProvider.GetRequiredService<ILogger<Server.Program>>(); | ||||
| @ -37,23 +36,19 @@ public class UnitTestAppSettingsController | ||||
|         catch (Exception) { } | ||||
|     } | ||||
|  | ||||
|     [TestCleanup] | ||||
|     public void TestCleanup() | ||||
|     { | ||||
|         if (TestContext.CurrentTestOutcome == UnitTestOutcome.Failed) | ||||
|             IncrementFailedTests(); | ||||
|     } | ||||
|  | ||||
|     [TestMethod] | ||||
|     public void TestControllerName() | ||||
|     { | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.AreEqual(IAppSettingsController<object>.GetRouteName(), _ControllerName); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
|     [TestMethod] | ||||
|     public void TestConnectionString() | ||||
|     { | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         IServiceProvider? serviceProvider = _WebApplicationFactory?.Services.CreateScope().ServiceProvider; | ||||
|         IAppSettingsRepository<Server.Models.Binder.AppSettings>? appSettingsRepository = serviceProvider?.GetRequiredService<IAppSettingsRepository<Server.Models.Binder.AppSettings>>(); | ||||
|         appSettingsRepository?.VerifyConnectionStrings(); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -64,7 +59,7 @@ public class UnitTestAppSettingsController | ||||
|         IServiceProvider? serviceProvider = _WebApplicationFactory?.Services.CreateScope().ServiceProvider; | ||||
|         AppSettings? appSettings = serviceProvider?.GetRequiredService<AppSettings>(); | ||||
|         Assert.IsNotNull(appSettings); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -73,10 +68,10 @@ public class UnitTestAppSettingsController | ||||
|     { | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         IServiceProvider? serviceProvider = _WebApplicationFactory?.Services.CreateScope().ServiceProvider; | ||||
|         IAppSettingsRepository<Server.Models.Binder.AppSettings>? appSettingsRepository = serviceProvider?.GetRequiredService<IAppSettingsRepository<Server.Models.Binder.AppSettings>>(); | ||||
|         Server.Models.Binder.AppSettings? appSettings = appSettingsRepository?.GetAppSettings(); | ||||
|         Assert.IsTrue(appSettings is not null); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         IAppSettingsRepository<AppSettings>? appSettingsRepository = serviceProvider?.GetRequiredService<IAppSettingsRepository<AppSettings>>(); | ||||
|         AppSettings? appSettings = appSettingsRepository?.GetAppSettings(); | ||||
|         Assert.IsNotNull(appSettings); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -85,16 +80,17 @@ public class UnitTestAppSettingsController | ||||
|     { | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         string actionName = nameof(IAppSettingsController<object>.Action.App); | ||||
|         HttpResponseMessage? httpResponseMessage = await httpClient.GetAsync($"api/{_ControllerName}/{actionName}"); | ||||
|         Assert.AreEqual(HttpStatusCode.OK, httpResponseMessage.StatusCode); | ||||
|         Assert.AreEqual("application/json; charset=utf-8", httpResponseMessage.Content.Headers.ContentType?.ToString()); | ||||
|         string json = await httpResponseMessage.Content.ReadAsStringAsync(); | ||||
|         Assert.IsNotNull(httpResponseMessage.Content.Headers.ContentType); | ||||
|         Assert.AreEqual("application/json; charset=utf-8", httpResponseMessage.Content.Headers.ContentType.ToString()); | ||||
|         string? json = await httpResponseMessage.Content.ReadAsStringAsync(); | ||||
|         File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetAppSettings)}.json"), json); | ||||
|         Assert.IsNotNull(json); | ||||
|         Assert.IsTrue(json != "[]"); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         Assert.AreNotEqual("[]", json); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -103,10 +99,10 @@ public class UnitTestAppSettingsController | ||||
|     { | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         IServiceProvider? serviceProvider = _WebApplicationFactory?.Services.CreateScope().ServiceProvider; | ||||
|         IAppSettingsRepository<Server.Models.Binder.AppSettings>? appSettingsRepository = serviceProvider?.GetRequiredService<IAppSettingsRepository<Server.Models.Binder.AppSettings>>(); | ||||
|         IAppSettingsRepository<AppSettings>? appSettingsRepository = serviceProvider?.GetRequiredService<IAppSettingsRepository<AppSettings>>(); | ||||
|         string? result = appSettingsRepository?.GetBuildNumberAndGitCommitSeven(); | ||||
|         Assert.IsTrue(result is not null); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         Assert.IsNotNull(result); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -115,15 +111,16 @@ public class UnitTestAppSettingsController | ||||
|     { | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         string actionName = nameof(IAppSettingsController<object>.Action.DevOps); | ||||
|         HttpResponseMessage? httpResponseMessage = await httpClient.GetAsync($"api/{_ControllerName}/{actionName}"); | ||||
|         Assert.AreEqual(HttpStatusCode.OK, httpResponseMessage.StatusCode); | ||||
|         Assert.AreEqual("text/plain; charset=utf-8", httpResponseMessage.Content.Headers.ContentType?.ToString()); | ||||
|         string json = await httpResponseMessage.Content.ReadAsStringAsync(); | ||||
|         Assert.IsNotNull(httpResponseMessage.Content.Headers.ContentType); | ||||
|         Assert.AreEqual("text/plain; charset=utf-8", httpResponseMessage.Content.Headers.ContentType.ToString()); | ||||
|         string? json = await httpResponseMessage.Content.ReadAsStringAsync(); | ||||
|         File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetBuildNumberAndGitCommitSeven)}.json"), json); | ||||
|         Assert.IsNotNull(json); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
|  | ||||
| @ -7,14 +7,14 @@ using System.Net; | ||||
| namespace OI.Metrology.Tests; | ||||
|  | ||||
| [TestClass] | ||||
| public class UnitTestClientSettingsController | ||||
| public class UnitTestClientSettingsController : BaseTestClass | ||||
| { | ||||
|  | ||||
| #pragma warning disable CS8618 | ||||
|  | ||||
|     private static ILogger? _Logger; | ||||
|     private static string _ControllerName; | ||||
|     private static TestContext _TestContext; | ||||
|     public TestContext TestContext { get; set; } | ||||
|     private static WebApplicationFactory<Server.Program>? _WebApplicationFactory; | ||||
|  | ||||
| #pragma warning restore | ||||
| @ -22,21 +22,37 @@ public class UnitTestClientSettingsController | ||||
|     [ClassInitialize] | ||||
|     public static void ClassInitAsync(TestContext testContext) | ||||
|     { | ||||
|         _TestContext = testContext; | ||||
|         _WebApplicationFactory = new WebApplicationFactory<Server.Program>(); | ||||
|         IServiceProvider serviceProvider = _WebApplicationFactory.Services.CreateScope().ServiceProvider; | ||||
|         _Logger = serviceProvider.GetRequiredService<ILogger<Server.Program>>(); | ||||
|         _ControllerName = nameof(Server.ApiControllers.ClientSettingsController)[..^10]; | ||||
|     } | ||||
|  | ||||
|     private static void NonThrowTryCatch() | ||||
|     { | ||||
|         try | ||||
|         { throw new Exception(); } | ||||
|         catch (Exception) { } | ||||
|     } | ||||
|  | ||||
|     [TestCleanup] | ||||
|     public void TestCleanup() | ||||
|     { | ||||
|         if (TestContext.CurrentTestOutcome == UnitTestOutcome.Failed) | ||||
|             IncrementFailedTests(); | ||||
|     } | ||||
|  | ||||
|     [TestMethod] | ||||
|     public void TestControllerName() | ||||
|     { | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.AreEqual(IClientSettingsController<object>.GetRouteName(), _ControllerName); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|     } | ||||
|  | ||||
| #if DEBUG | ||||
|     [Ignore] | ||||
| #endif | ||||
|     [TestMethod] | ||||
|     public void GetClientSettings() | ||||
|     { | ||||
| @ -45,31 +61,33 @@ public class UnitTestClientSettingsController | ||||
|         IClientSettingsRepository? clientSettingsRepository = serviceProvider?.GetRequiredService<IClientSettingsRepository>(); | ||||
| #if DEBUG | ||||
|         List<string>? clientSettings = clientSettingsRepository?.GetClientSettings(null); | ||||
|         Assert.IsTrue(clientSettings is not null); | ||||
|         Assert.IsNotNull(clientSettings); | ||||
| #endif | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|     } | ||||
|  | ||||
| #pragma warning disable CS1998 | ||||
| #if DEBUG | ||||
|     [Ignore] | ||||
| #endif | ||||
|     [TestMethod] | ||||
|     public async Task GetClientSettingsApi() | ||||
|     { | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
| #if DEBUG | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         string actionName = nameof(IClientSettingsController<object>.Action.Client); | ||||
|         HttpResponseMessage httpResponseMessage = await httpClient.GetAsync($"api/{_ControllerName}/{actionName}"); | ||||
|         Assert.AreEqual(HttpStatusCode.OK, httpResponseMessage.StatusCode); | ||||
|         Assert.AreEqual("application/json; charset=utf-8", httpResponseMessage.Content.Headers.ContentType?.ToString()); | ||||
|         string json = await httpResponseMessage.Content.ReadAsStringAsync(); | ||||
|         Assert.IsNotNull(httpResponseMessage.Content.Headers.ContentType); | ||||
|         Assert.AreEqual("application/json; charset=utf-8", httpResponseMessage.Content.Headers.ContentType.ToString()); | ||||
|         string? json = await httpResponseMessage.Content.ReadAsStringAsync(); | ||||
|         File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetClientSettings)}.json"), json); | ||||
|         Assert.IsNotNull(json); | ||||
|         Assert.IsTrue(json != "[]"); | ||||
|         Assert.AreNotEqual("[]", json); | ||||
| #endif | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|     } | ||||
| #pragma warning restore CS1998 | ||||
|  | ||||
|     [TestMethod] | ||||
|     public void GetIpAddress() | ||||
| @ -78,8 +96,8 @@ public class UnitTestClientSettingsController | ||||
|         IServiceProvider? serviceProvider = _WebApplicationFactory?.Services.CreateScope().ServiceProvider; | ||||
|         IClientSettingsRepository? clientSettingsRepository = serviceProvider?.GetRequiredService<IClientSettingsRepository>(); | ||||
|         string? ipAddress = clientSettingsRepository?.GetIpAddress(null); | ||||
|         Assert.IsTrue(ipAddress is not null); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         Assert.IsNotNull(ipAddress); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|     } | ||||
|  | ||||
|     [TestMethod] | ||||
| @ -87,15 +105,16 @@ public class UnitTestClientSettingsController | ||||
|     { | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         string actionName = nameof(IClientSettingsController<object>.Action.IP); | ||||
|         HttpResponseMessage httpResponseMessage = await httpClient.GetAsync($"api/{_ControllerName}/{actionName}"); | ||||
|         Assert.AreEqual(HttpStatusCode.OK, httpResponseMessage.StatusCode); | ||||
|         Assert.AreEqual("text/plain; charset=utf-8", httpResponseMessage.Content.Headers.ContentType?.ToString()); | ||||
|         string json = await httpResponseMessage.Content.ReadAsStringAsync(); | ||||
|         Assert.IsNotNull(httpResponseMessage.Content.Headers.ContentType); | ||||
|         Assert.AreEqual("text/plain; charset=utf-8", httpResponseMessage.Content.Headers.ContentType.ToString()); | ||||
|         string? json = await httpResponseMessage.Content.ReadAsStringAsync(); | ||||
|         File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetIpAddress)}.json"), json); | ||||
|         Assert.IsNotNull(json); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|     } | ||||
|  | ||||
| } | ||||
| @ -9,14 +9,14 @@ using System.Text; | ||||
| namespace OI.Metrology.Tests; | ||||
|  | ||||
| [TestClass] | ||||
| public class UnitTestExportController | ||||
| public class UnitTestExportController : BaseTestClass | ||||
| { | ||||
|  | ||||
| #pragma warning disable CS8618 | ||||
|  | ||||
|     private static ILogger? _Logger; | ||||
|     private static string _ControllerName; | ||||
|     private static TestContext _TestContext; | ||||
|     public TestContext TestContext { get; set; } | ||||
|     private static WebApplicationFactory<Server.Program>? _WebApplicationFactory; | ||||
|  | ||||
| #pragma warning restore | ||||
| @ -24,7 +24,6 @@ public class UnitTestExportController | ||||
|     [ClassInitialize] | ||||
|     public static void ClassInitAsync(TestContext testContext) | ||||
|     { | ||||
|         _TestContext = testContext; | ||||
|         _WebApplicationFactory = new WebApplicationFactory<Server.Program>(); | ||||
|         IServiceProvider serviceProvider = _WebApplicationFactory.Services.CreateScope().ServiceProvider; | ||||
|         _Logger = serviceProvider.GetRequiredService<ILogger<Server.Program>>(); | ||||
| @ -38,12 +37,19 @@ public class UnitTestExportController | ||||
|         catch (Exception) { } | ||||
|     } | ||||
|  | ||||
|     [TestCleanup] | ||||
|     public void TestCleanup() | ||||
|     { | ||||
|         if (TestContext.CurrentTestOutcome == UnitTestOutcome.Failed) | ||||
|             IncrementFailedTests(); | ||||
|     } | ||||
|  | ||||
|     [TestMethod] | ||||
|     public void TestControllerName() | ||||
|     { | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.AreEqual(IExportController<string>.GetRouteName(), _ControllerName); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -61,7 +67,7 @@ public class UnitTestExportController | ||||
|         IExportRepository? exportRepository = serviceProvider?.GetRequiredService<IExportRepository>(); | ||||
|         string? result = exportRepository?.GetExport(GetHeaderCommon()); | ||||
|         Assert.IsNotNull(result); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -70,11 +76,11 @@ public class UnitTestExportController | ||||
|     { | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         string? result = await httpClient.GetStringAsync($"api/{_ControllerName}/export"); | ||||
|         File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetExport)}.txt"), result); | ||||
|         Assert.IsNotNull(result); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -83,10 +89,10 @@ public class UnitTestExportController | ||||
|     { | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         HttpResponseMessage httpResponseMessage = await httpClient.PostAsync($"api/{_ControllerName}/export", GetStringContent()); | ||||
|         Assert.IsTrue(httpResponseMessage.StatusCode == System.Net.HttpStatusCode.OK); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         Assert.AreEqual(System.Net.HttpStatusCode.OK, httpResponseMessage.StatusCode); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -98,7 +104,7 @@ public class UnitTestExportController | ||||
|         IExportRepository? exportRepository = serviceProvider?.GetRequiredService<IExportRepository>(); | ||||
|         Result<HeaderCommon[]>? result = exportRepository?.GetHeaders(GetHeaderCommon()); | ||||
|         Assert.IsNotNull(result?.Results); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -107,12 +113,12 @@ public class UnitTestExportController | ||||
|     { | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         string? json = await httpClient.GetStringAsync($"api/{_ControllerName}/headers"); | ||||
|         File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetHeaders)}.json"), json); | ||||
|         Result<HeaderCommon[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<HeaderCommon[]>>(json); | ||||
|         Assert.IsNotNull(result?.Results); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -121,10 +127,10 @@ public class UnitTestExportController | ||||
|     { | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         HttpResponseMessage httpResponseMessage = await httpClient.PostAsync($"api/{_ControllerName}/headers", GetStringContent()); | ||||
|         Assert.IsTrue(httpResponseMessage.StatusCode == System.Net.HttpStatusCode.OK); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         Assert.AreEqual(System.Net.HttpStatusCode.OK, httpResponseMessage.StatusCode); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -136,7 +142,7 @@ public class UnitTestExportController | ||||
|         IExportRepository? exportRepository = serviceProvider?.GetRequiredService<IExportRepository>(); | ||||
|         Result<HeaderCommon[]>? result = exportRepository?.GetLogistics(GetHeaderCommon()); | ||||
|         Assert.IsNotNull(result?.Results); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -145,12 +151,12 @@ public class UnitTestExportController | ||||
|     { | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         string? json = await httpClient.GetStringAsync($"api/{_ControllerName}/logistics"); | ||||
|         File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetLogistics)}.json"), json); | ||||
|         Result<HeaderCommon[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<HeaderCommon[]>>(json); | ||||
|         Assert.IsNotNull(result?.Results); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -159,10 +165,10 @@ public class UnitTestExportController | ||||
|     { | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         HttpResponseMessage httpResponseMessage = await httpClient.PostAsync($"api/{_ControllerName}/logistics", GetStringContent()); | ||||
|         Assert.IsTrue(httpResponseMessage.StatusCode == System.Net.HttpStatusCode.OK); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         Assert.AreEqual(System.Net.HttpStatusCode.OK, httpResponseMessage.StatusCode); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -174,7 +180,7 @@ public class UnitTestExportController | ||||
|         IExportRepository? exportRepository = serviceProvider?.GetRequiredService<IExportRepository>(); | ||||
|         string? result = exportRepository?.GetProcessDataStandardFormat(GetHeaderCommon()); | ||||
|         Assert.IsNotNull(result); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -183,11 +189,11 @@ public class UnitTestExportController | ||||
|     { | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         string? result = await httpClient.GetStringAsync($"api/{_ControllerName}/processDataStandardFormat"); | ||||
|         File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetProcessDataStandardFormat)}.pdsf"), result); | ||||
|         Assert.IsNotNull(result); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -196,10 +202,10 @@ public class UnitTestExportController | ||||
|     { | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         HttpResponseMessage httpResponseMessage = await httpClient.PostAsync($"api/{_ControllerName}/processDataStandardFormat", GetStringContent()); | ||||
|         Assert.IsTrue(httpResponseMessage.StatusCode == System.Net.HttpStatusCode.OK); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         Assert.AreEqual(System.Net.HttpStatusCode.OK, httpResponseMessage.StatusCode); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -211,11 +217,11 @@ public class UnitTestExportController | ||||
|         IServiceProvider? serviceProvider = _WebApplicationFactory?.Services.CreateScope().ServiceProvider; | ||||
|         IMetrologyRepository? metrologyRepository = serviceProvider?.GetRequiredService<IMetrologyRepository>(); | ||||
|         IExportRepository? exportRepository = serviceProvider?.GetRequiredService<IExportRepository>(); | ||||
|         Assert.IsTrue(metrologyRepository is not null); | ||||
|         Assert.IsNotNull(metrologyRepository); | ||||
|         Result<DataTable>? result = exportRepository?.GetExportData(metrologyRepository, toolTypeId: 1, datebegin: null, dateend: null); | ||||
|         Assert.IsNotNull(result?.Results); | ||||
|         Assert.IsNotNull(result.Results.Rows.Count > 0); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|     } | ||||
|  | ||||
|     [Ignore] | ||||
| @ -224,15 +230,16 @@ public class UnitTestExportController | ||||
|     { | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         string? json = await httpClient.GetStringAsync($"api/{_ControllerName}/1/export?datebegin=&dateend="); | ||||
|         File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetExportData)}.json"), json); | ||||
|         Result<DataTable>? result = Newtonsoft.Json.JsonConvert.DeserializeObject<Result<DataTable>>(json); | ||||
|         Assert.IsNotNull(result?.Results); | ||||
|         Assert.IsNotNull(result.Results.Rows.Count > 0); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|     } | ||||
|  | ||||
|     [Ignore] | ||||
|     [TestMethod] | ||||
|     public void GetCSVExport() | ||||
|     { | ||||
| @ -240,10 +247,10 @@ public class UnitTestExportController | ||||
|         IServiceProvider? serviceProvider = _WebApplicationFactory?.Services.CreateScope().ServiceProvider; | ||||
|         IMetrologyRepository? metrologyRepository = serviceProvider?.GetRequiredService<IMetrologyRepository>(); | ||||
|         IExportRepository? exportRepository = serviceProvider?.GetRequiredService<IExportRepository>(); | ||||
|         Assert.IsTrue(metrologyRepository is not null); | ||||
|         Assert.IsNotNull(metrologyRepository); | ||||
|         string? result = exportRepository?.GetCSVExport(metrologyRepository, toolTypeId: 1, datebegin: null, dateend: null); | ||||
|         Assert.IsNotNull(result); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|     } | ||||
|  | ||||
|     [Ignore] | ||||
| @ -252,11 +259,11 @@ public class UnitTestExportController | ||||
|     { | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         string? result = await httpClient.GetStringAsync($"api/{_ControllerName}/1/csv?datebegin=&dateend="); | ||||
|         File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetCSVExport)}.csv"), result); | ||||
|         Assert.IsNotNull(result); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|     } | ||||
|  | ||||
| } | ||||
| @ -1,20 +1,22 @@ | ||||
| using Microsoft.AspNetCore.Mvc.Testing; | ||||
| using Microsoft.Extensions.DependencyInjection; | ||||
| using Microsoft.Extensions.Logging; | ||||
| using OI.Metrology.Shared.DataModels; | ||||
| using OI.Metrology.Shared.Models; | ||||
| using OI.Metrology.Shared.Models.Stateless; | ||||
| 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 TestContext _TestContext; | ||||
|     public TestContext TestContext { get; set; } | ||||
|     private static WebApplicationFactory<Wafer.Counter.Program>? _WebApplicationFactory; | ||||
|  | ||||
| #pragma warning restore | ||||
| @ -22,7 +24,6 @@ public class UnitTestFileShareController | ||||
|     [ClassInitialize] | ||||
|     public static void ClassInitAsync(TestContext testContext) | ||||
|     { | ||||
|         _TestContext = testContext; | ||||
|         _WebApplicationFactory = new WebApplicationFactory<Wafer.Counter.Program>(); | ||||
|         IServiceProvider serviceProvider = _WebApplicationFactory.Services.CreateScope().ServiceProvider; | ||||
|         _Logger = serviceProvider.GetRequiredService<ILogger<Wafer.Counter.Program>>(); | ||||
| @ -37,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", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -52,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", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -65,34 +73,36 @@ 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", _TestContext?.TestName); | ||||
|         _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", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
|     [Ignore] | ||||
|     [TestMethod] | ||||
|     public void GetArchiveData() | ||||
|     { | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         List<CharacterizationInfo>? result; | ||||
|         ReadOnlyCollection<CharacterizationInfo>? result; | ||||
|         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"); | ||||
| @ -101,19 +111,53 @@ public class UnitTestFileShareController | ||||
|         characterizationParameters = new(string.Empty, "CDE5", "CDE*.json", null, null, "8INCH"); | ||||
|         result = fileShareRepository?.GetArchiveData(characterizationParameters); | ||||
|         Assert.IsNotNull(result); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         characterizationParameters = new("FQA", "FQA-8INCH", "*.wc", null, null, "8INCH"); | ||||
|         result = fileShareRepository?.GetArchiveData(characterizationParameters); | ||||
|         Assert.IsNotNull(result); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
|     [Ignore] | ||||
|     [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", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| #if DEBUG | ||||
|     [Ignore] | ||||
| #endif | ||||
|     [TestMethod] | ||||
|     public void EquipmentIds() | ||||
|     { | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         IServiceProvider? serviceProvider = _WebApplicationFactory?.Services.CreateScope().ServiceProvider; | ||||
|         IFileShareRepository? fileShareRepository = serviceProvider?.GetRequiredService<IFileShareRepository>(); | ||||
|         ReadOnlyCollection<ToolTypeNameId>? result = fileShareRepository?.GetEquipmentIds(); | ||||
|         Assert.IsNotNull(result); | ||||
|         _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.IsNotNull(httpClient); | ||||
|         string? response = await httpClient.GetStringAsync($"api/v1/file-share/equipment-ids"); | ||||
|         Assert.IsNotNull(response); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
|  | ||||
| @ -6,14 +6,14 @@ using OI.Metrology.Shared.Models.Stateless; | ||||
| namespace OI.Metrology.Tests; | ||||
|  | ||||
| [TestClass] | ||||
| public class UnitTestISpreadingResistanceProfileController | ||||
| public class UnitTestISpreadingResistanceProfileController : BaseTestClass | ||||
| { | ||||
|  | ||||
| #pragma warning disable CS8618 | ||||
|  | ||||
|     private static ILogger? _Logger; | ||||
|     private static string _ControllerName; | ||||
|     private static TestContext _TestContext; | ||||
|     public TestContext TestContext { get; set; } | ||||
|     private static WebApplicationFactory<Server.Program>? _WebApplicationFactory; | ||||
|  | ||||
| #pragma warning restore | ||||
| @ -21,7 +21,6 @@ public class UnitTestISpreadingResistanceProfileController | ||||
|     [ClassInitialize] | ||||
|     public static void ClassInitAsync(TestContext testContext) | ||||
|     { | ||||
|         _TestContext = testContext; | ||||
|         _WebApplicationFactory = new WebApplicationFactory<Server.Program>(); | ||||
|         IServiceProvider serviceProvider = _WebApplicationFactory.Services.CreateScope().ServiceProvider; | ||||
|         _Logger = serviceProvider.GetRequiredService<ILogger<Server.Program>>(); | ||||
| @ -35,12 +34,19 @@ public class UnitTestISpreadingResistanceProfileController | ||||
|         catch (Exception) { } | ||||
|     } | ||||
|  | ||||
|     [TestCleanup] | ||||
|     public void TestCleanup() | ||||
|     { | ||||
|         if (TestContext.CurrentTestOutcome == UnitTestOutcome.Failed) | ||||
|             IncrementFailedTests(); | ||||
|     } | ||||
|  | ||||
|     [TestMethod] | ||||
|     public void TestControllerName() | ||||
|     { | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.AreEqual(ISpreadingResistanceProfileController<string>.GetRouteName(), _ControllerName); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -58,11 +64,11 @@ public class UnitTestISpreadingResistanceProfileController | ||||
|             IServiceProvider? serviceProvider = _WebApplicationFactory?.Services.CreateScope().ServiceProvider; | ||||
|             ISpreadingResistanceProfileService? spreadingResistanceProfileService = serviceProvider?.GetRequiredService<ISpreadingResistanceProfileService>(); | ||||
|             byte[]? bytes = spreadingResistanceProfileService?.GetImageBytes(json); | ||||
|             Assert.IsTrue(bytes is not null); | ||||
|             Assert.IsTrue(bytes.Length != 0); | ||||
|             Assert.IsNotNull(bytes); | ||||
|             Assert.AreNotEqual(0, bytes.Length); | ||||
|             File.WriteAllBytes(Path.Combine(directory, "srp.png"), bytes); | ||||
|         } | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
|  | ||||
| @ -8,14 +8,14 @@ using System.Text; | ||||
| namespace OI.Metrology.Tests; | ||||
| 
 | ||||
| [TestClass] | ||||
| public class UnitInboundController | ||||
| public class UnitTestInboundController : BaseTestClass | ||||
| { | ||||
| 
 | ||||
| #pragma warning disable CS8618 | ||||
| 
 | ||||
|     private static ILogger? _Logger; | ||||
|     private static string _ControllerName; | ||||
|     private static TestContext _TestContext; | ||||
|     public TestContext TestContext { get; set; } | ||||
|     private static WebApplicationFactory<Server.Program>? _WebApplicationFactory; | ||||
| 
 | ||||
| #pragma warning restore | ||||
| @ -23,7 +23,6 @@ public class UnitInboundController | ||||
|     [ClassInitialize] | ||||
|     public static void ClassInitAsync(TestContext testContext) | ||||
|     { | ||||
|         _TestContext = testContext; | ||||
|         _WebApplicationFactory = new WebApplicationFactory<Server.Program>(); | ||||
|         IServiceProvider serviceProvider = _WebApplicationFactory.Services.CreateScope().ServiceProvider; | ||||
|         _Logger = serviceProvider.GetRequiredService<ILogger<Server.Program>>(); | ||||
| @ -37,12 +36,19 @@ public class UnitInboundController | ||||
|         catch (Exception) { } | ||||
|     } | ||||
| 
 | ||||
|     [TestCleanup] | ||||
|     public void TestCleanup() | ||||
|     { | ||||
|         if (TestContext.CurrentTestOutcome == UnitTestOutcome.Failed) | ||||
|             IncrementFailedTests(); | ||||
|     } | ||||
| 
 | ||||
|     [TestMethod] | ||||
|     public void TestControllerName() | ||||
|     { | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.AreEqual(IInboundController<string>.GetRouteName(), _ControllerName); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
| 
 | ||||
| @ -58,9 +64,9 @@ public class UnitInboundController | ||||
|     { | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         _ = await httpClient.PostAsync($"api/{_ControllerName}/BioRad", GetStringContent()); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
| 
 | ||||
| @ -70,9 +76,9 @@ public class UnitInboundController | ||||
|     { | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         _ = await httpClient.PostAsync($"api/{_ControllerName}/BioRad/attachment", GetStringContent()); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
| 
 | ||||
| @ -7,14 +7,14 @@ using OI.Metrology.Shared.Models.Stateless; | ||||
| namespace OI.Metrology.Tests; | ||||
|  | ||||
| [TestClass] | ||||
| public class UnitTestInfinityQSController | ||||
| public class UnitTestInfinityQSController : BaseTestClass | ||||
| { | ||||
|  | ||||
| #pragma warning disable CS8618 | ||||
|  | ||||
|     private static ILogger? _Logger; | ||||
|     private static string _ControllerName; | ||||
|     private static TestContext _TestContext; | ||||
|     public TestContext TestContext { get; set; } | ||||
|     private static WebApplicationFactory<Server.Program>? _WebApplicationFactory; | ||||
|  | ||||
| #pragma warning restore | ||||
| @ -22,7 +22,6 @@ public class UnitTestInfinityQSController | ||||
|     [ClassInitialize] | ||||
|     public static void ClassInitAsync(TestContext testContext) | ||||
|     { | ||||
|         _TestContext = testContext; | ||||
|         _WebApplicationFactory = new WebApplicationFactory<Server.Program>(); | ||||
|         IServiceProvider serviceProvider = _WebApplicationFactory.Services.CreateScope().ServiceProvider; | ||||
|         _Logger = serviceProvider.GetRequiredService<ILogger<Server.Program>>(); | ||||
| @ -36,12 +35,19 @@ public class UnitTestInfinityQSController | ||||
|         catch (Exception) { } | ||||
|     } | ||||
|  | ||||
|     [TestCleanup] | ||||
|     public void TestCleanup() | ||||
|     { | ||||
|         if (TestContext.CurrentTestOutcome == UnitTestOutcome.Failed) | ||||
|             IncrementFailedTests(); | ||||
|     } | ||||
|  | ||||
|     [TestMethod] | ||||
|     public void TestControllerName() | ||||
|     { | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.AreEqual(IInfinityQSController<string>.GetRouteName(), _ControllerName); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -56,7 +62,7 @@ public class UnitTestInfinityQSController | ||||
|         IInfinityQSRepository? infinityQSRepository = serviceProvider?.GetRequiredService<IInfinityQSRepository>(); | ||||
|         string? result = infinityQSRepository?.GetCommandText("1677273357", "61", "CDE5", "5012", "575908", ""); | ||||
|         Assert.IsNotNull(result); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -68,11 +74,11 @@ public class UnitTestInfinityQSController | ||||
|     { | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         string? json = await httpClient.GetStringAsync($"api/{_ControllerName}/commandText/?sub_group_id=1677273357&process=61&job=CDE5&part=5012&lot=575908&date_time=2023-02-24 15:15:00"); | ||||
|         File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetCommandText)}.sql"), json); | ||||
|         Assert.IsNotNull(json); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -86,14 +92,12 @@ public class UnitTestInfinityQSController | ||||
|         IServiceProvider? serviceProvider = _WebApplicationFactory?.Services.CreateScope().ServiceProvider; | ||||
|         IInfinityQSRepository? infinityQSRepository = serviceProvider?.GetRequiredService<IInfinityQSRepository>(); | ||||
|         Result<InfinityQSBase[]>? result = infinityQSRepository?.GetData("1677273357"); | ||||
|         Assert.IsNotNull(result?.Results); | ||||
|         Assert.IsTrue(result?.Results.Length != 0); | ||||
|         Assert.IsNotNull(result?.Results[0].PR_NAME); | ||||
|         Assert.IsNotNull(result?.Results[0].SE_SGTM); | ||||
|         Assert.IsNotNull(result?.Results[0].SE_TSNO); | ||||
|         Assert.IsNotNull(result?.Results[0].TD_NAME); | ||||
|         Assert.IsNotNull(result?.Results[0].TD_TEST); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         Assert.IsNotNull(result); | ||||
|         Assert.IsNotNull(result.Results); | ||||
|         Assert.IsNotNull(result.Results[0].PR_NAME); | ||||
|         Assert.IsNotNull(result.Results[0].TD_NAME); | ||||
|         Assert.AreNotEqual(0, result.Results.Length); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -105,13 +109,13 @@ public class UnitTestInfinityQSController | ||||
|     { | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         //string? json = await httpClient.GetStringAsync($"api/{_ControllerName}/1677273357 575908_2023-02-24 14-18-05.txt/data"); | ||||
|         string? json = await httpClient.GetStringAsync($"api/{_ControllerName}/1677273357/data"); | ||||
|         File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetData)}.json"), json); | ||||
|         Result<InfinityQSBase[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSBase[]>>(json); | ||||
|         Assert.IsNotNull(result?.Results); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -125,11 +129,12 @@ public class UnitTestInfinityQSController | ||||
|         IServiceProvider? serviceProvider = _WebApplicationFactory?.Services.CreateScope().ServiceProvider; | ||||
|         IInfinityQSRepository? infinityQSRepository = serviceProvider?.GetRequiredService<IInfinityQSRepository>(); | ||||
|         Result<InfinityQSDescriptor[]>? result = infinityQSRepository?.GetDescriptors("1677273357"); | ||||
|         Assert.IsNotNull(result?.Results); | ||||
|         Assert.IsTrue(result?.Results.Length != 0); | ||||
|         Assert.IsNotNull(result?.Results[0].SD_SGRP); | ||||
|         Assert.IsNotNull(result?.Results[0].SD_TSNO); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         Assert.IsNotNull(result); | ||||
|         Assert.IsNotNull(result.Results); | ||||
|         Assert.IsNotNull(result.Results[0].SD_SGRP); | ||||
|         Assert.IsNotNull(result.Results[0].SD_TSNO); | ||||
|         Assert.AreNotEqual(0, result.Results.Length); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -141,13 +146,13 @@ public class UnitTestInfinityQSController | ||||
|     { | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         //string? json = await httpClient.GetStringAsync($"api/{_ControllerName}/1677273357 575908_2023-02-24 14-18-05.txt/descriptors"); | ||||
|         string? json = await httpClient.GetStringAsync($"api/{_ControllerName}/1677273357/descriptors"); | ||||
|         File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetDescriptors)}.json"), json); | ||||
|         Result<InfinityQSDescriptor[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSDescriptor[]>>(json); | ||||
|         Assert.IsNotNull(result?.Results); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -162,7 +167,7 @@ public class UnitTestInfinityQSController | ||||
|         IInfinityQSRepository? infinityQSRepository = serviceProvider?.GetRequiredService<IInfinityQSRepository>(); | ||||
|         Result<InfinityQSEvent[]>? result = infinityQSRepository?.GetEvents("1677273357"); | ||||
|         Assert.IsNotNull(result?.Results); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -174,12 +179,12 @@ public class UnitTestInfinityQSController | ||||
|     { | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         string? json = await httpClient.GetStringAsync($"api/{_ControllerName}/1677273357/events"); | ||||
|         File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetEvents)}.json"), json); | ||||
|         Result<InfinityQSEvent[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSEvent[]>>(json); | ||||
|         Assert.IsNotNull(result?.Results); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -194,7 +199,7 @@ public class UnitTestInfinityQSController | ||||
|         IInfinityQSRepository? infinityQSRepository = serviceProvider?.GetRequiredService<IInfinityQSRepository>(); | ||||
|         Result<InfinityQSBase[]>? result = infinityQSRepository?.GetHeader("1677273357"); | ||||
|         Assert.IsNotNull(result?.Results); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -206,12 +211,12 @@ public class UnitTestInfinityQSController | ||||
|     { | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         string? json = await httpClient.GetStringAsync($"api/{_ControllerName}/1677273357/header"); | ||||
|         File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetHeader)}.json"), json); | ||||
|         Result<InfinityQSBase[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSBase[]>>(json); | ||||
|         Assert.IsNotNull(result?.Results); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
|  | ||||
| @ -7,14 +7,14 @@ using OI.Metrology.Shared.Models.Stateless; | ||||
| namespace OI.Metrology.Tests; | ||||
|  | ||||
| [TestClass] | ||||
| public class UnitTestInfinityQSV2Controller | ||||
| public class UnitTestInfinityQSV2Controller : BaseTestClass | ||||
| { | ||||
|  | ||||
| #pragma warning disable CS8618 | ||||
|  | ||||
|     private static ILogger? _Logger; | ||||
|     private static string _ControllerName; | ||||
|     private static TestContext _TestContext; | ||||
|     public TestContext TestContext { get; set; } | ||||
|     private static WebApplicationFactory<Server.Program>? _WebApplicationFactory; | ||||
|  | ||||
| #pragma warning restore | ||||
| @ -22,7 +22,6 @@ public class UnitTestInfinityQSV2Controller | ||||
|     [ClassInitialize] | ||||
|     public static void ClassInitAsync(TestContext testContext) | ||||
|     { | ||||
|         _TestContext = testContext; | ||||
|         _WebApplicationFactory = new WebApplicationFactory<Server.Program>(); | ||||
|         IServiceProvider serviceProvider = _WebApplicationFactory.Services.CreateScope().ServiceProvider; | ||||
|         _Logger = serviceProvider.GetRequiredService<ILogger<Server.Program>>(); | ||||
| @ -36,12 +35,19 @@ public class UnitTestInfinityQSV2Controller | ||||
|         catch (Exception) { } | ||||
|     } | ||||
|  | ||||
|     [TestCleanup] | ||||
|     public void TestCleanup() | ||||
|     { | ||||
|         if (TestContext.CurrentTestOutcome == UnitTestOutcome.Failed) | ||||
|             IncrementFailedTests(); | ||||
|     } | ||||
|  | ||||
|     [TestMethod] | ||||
|     public void TestControllerName() | ||||
|     { | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.AreEqual(IInfinityQSV2Controller<string>.GetRouteName(), _ControllerName); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -53,7 +59,7 @@ public class UnitTestInfinityQSV2Controller | ||||
|         IInfinityQSV2Repository? infinityQSV2Repository = serviceProvider?.GetRequiredService<IInfinityQSV2Repository>(); | ||||
|         string? result = infinityQSV2Repository?.GetCommandText("1677273357", "61", "CDE5", "5012", "575908", ""); | ||||
|         Assert.IsNotNull(result); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -65,11 +71,11 @@ public class UnitTestInfinityQSV2Controller | ||||
|     { | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         string? json = await httpClient.GetStringAsync($"api/{_ControllerName}/1677273357/commandText/?process=61&job=CDE5&part=5012&lot=575908&date_time=2023-02-24 15:15:00"); | ||||
|         File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetCommandText)}.sql"), json); | ||||
|         Assert.IsNotNull(json); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -83,14 +89,16 @@ public class UnitTestInfinityQSV2Controller | ||||
|         IServiceProvider? serviceProvider = _WebApplicationFactory?.Services.CreateScope().ServiceProvider; | ||||
|         IInfinityQSV2Repository? infinityQSV2Repository = serviceProvider?.GetRequiredService<IInfinityQSV2Repository>(); | ||||
|         Result<InfinityQSBaseV2[]>? result = infinityQSV2Repository?.GetData("1677273357"); | ||||
|         Assert.IsNotNull(result?.Results); | ||||
|         Assert.IsTrue(result?.Results.Length != 0); | ||||
|         Assert.IsNotNull(result); | ||||
|         Assert.IsNotNull(result.Results); | ||||
|         Assert.IsNotNull(result.Results[0].Process); | ||||
|         Assert.AreNotEqual(0, result.Results.Length); | ||||
|         Assert.IsNotNull(result?.Results[0].Process); | ||||
|         Assert.IsNotNull(result?.Results[0].Variable); | ||||
|         Assert.IsNotNull(result?.Results[0].SiteNumber); | ||||
|         Assert.IsNotNull(result?.Results[0].VariableNumber); | ||||
|         Assert.IsNotNull(result?.Results[0].SubGroupDateTime); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -102,13 +110,13 @@ public class UnitTestInfinityQSV2Controller | ||||
|     { | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         //string? json = await httpClient.GetStringAsync($"api/{_ControllerName}/1677273357 575908_2023-02-24 14-18-05.txt/data"); | ||||
|         string? json = await httpClient.GetStringAsync($"api/{_ControllerName}/1677273357/data"); | ||||
|         File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetData)}.json"), json); | ||||
|         Result<InfinityQSBaseV2[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSBaseV2[]>>(json); | ||||
|         Assert.IsNotNull(result?.Results); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -122,11 +130,12 @@ public class UnitTestInfinityQSV2Controller | ||||
|         IServiceProvider? serviceProvider = _WebApplicationFactory?.Services.CreateScope().ServiceProvider; | ||||
|         IInfinityQSV2Repository? infinityQSV2Repository = serviceProvider?.GetRequiredService<IInfinityQSV2Repository>(); | ||||
|         Result<InfinityQSDescriptorV2[]>? result = infinityQSV2Repository?.GetDescriptors("1677273357"); | ||||
|         Assert.IsNotNull(result?.Results); | ||||
|         Assert.IsTrue(result?.Results.Length != 0); | ||||
|         Assert.IsNotNull(result); | ||||
|         Assert.IsNotNull(result.Results); | ||||
|         Assert.AreNotEqual(0, result.Results.Length); | ||||
|         Assert.IsNotNull(result?.Results[0].SubGroupId); | ||||
|         Assert.IsNotNull(result?.Results[0].SiteNumber); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -138,13 +147,13 @@ public class UnitTestInfinityQSV2Controller | ||||
|     { | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         //string? json = await httpClient.GetStringAsync($"api/{_ControllerName}/1677273357 575908_2023-02-24 14-18-05.txt/descriptors"); | ||||
|         string? json = await httpClient.GetStringAsync($"api/{_ControllerName}/1677273357/descriptors"); | ||||
|         File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetDescriptors)}.json"), json); | ||||
|         Result<InfinityQSDescriptorV2[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSDescriptorV2[]>>(json); | ||||
|         Assert.IsNotNull(result?.Results); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -159,7 +168,7 @@ public class UnitTestInfinityQSV2Controller | ||||
|         IInfinityQSV2Repository? infinityQSV2Repository = serviceProvider?.GetRequiredService<IInfinityQSV2Repository>(); | ||||
|         Result<InfinityQSEventV2[]>? result = infinityQSV2Repository?.GetEvents("1677273357"); | ||||
|         Assert.IsNotNull(result?.Results); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -171,12 +180,12 @@ public class UnitTestInfinityQSV2Controller | ||||
|     { | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         string? json = await httpClient.GetStringAsync($"api/{_ControllerName}/1677273357/events"); | ||||
|         File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetEvents)}.json"), json); | ||||
|         Result<InfinityQSEventV2[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSEventV2[]>>(json); | ||||
|         Assert.IsNotNull(result?.Results); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -192,7 +201,7 @@ public class UnitTestInfinityQSV2Controller | ||||
|         Result<InfinityQSBaseV2[]>? result = infinityQSV2Repository?.GetHeader("1677273357"); | ||||
|         Assert.IsNotNull(result?.Results); | ||||
|         Assert.IsNotNull(result?.Results[0].Part); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -204,13 +213,13 @@ public class UnitTestInfinityQSV2Controller | ||||
|     { | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         string? json = await httpClient.GetStringAsync($"api/{_ControllerName}/1677273357/header"); | ||||
|         File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetHeader)}.json"), json); | ||||
|         Result<InfinityQSBaseV2[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSBaseV2[]>>(json); | ||||
|         Assert.IsNotNull(result?.Results); | ||||
|         Assert.IsNotNull(result?.Results[0].Part); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
|  | ||||
| @ -7,14 +7,14 @@ using OI.Metrology.Shared.Models.Stateless; | ||||
| namespace OI.Metrology.Tests; | ||||
|  | ||||
| [TestClass] | ||||
| public class UnitTestInfinityQSV3Controller | ||||
| public class UnitTestInfinityQSV3Controller : BaseTestClass | ||||
| { | ||||
|  | ||||
| #pragma warning disable CS8618 | ||||
|  | ||||
|     private static ILogger? _Logger; | ||||
|     private static string _ControllerName; | ||||
|     private static TestContext _TestContext; | ||||
|     public TestContext TestContext { get; set; } | ||||
|     private static WebApplicationFactory<Server.Program>? _WebApplicationFactory; | ||||
|  | ||||
| #pragma warning restore | ||||
| @ -22,7 +22,6 @@ public class UnitTestInfinityQSV3Controller | ||||
|     [ClassInitialize] | ||||
|     public static void ClassInitAsync(TestContext testContext) | ||||
|     { | ||||
|         _TestContext = testContext; | ||||
|         _WebApplicationFactory = new WebApplicationFactory<Server.Program>(); | ||||
|         IServiceProvider serviceProvider = _WebApplicationFactory.Services.CreateScope().ServiceProvider; | ||||
|         _Logger = serviceProvider.GetRequiredService<ILogger<Server.Program>>(); | ||||
| @ -36,12 +35,19 @@ public class UnitTestInfinityQSV3Controller | ||||
|         catch (Exception) { } | ||||
|     } | ||||
|  | ||||
|     [TestCleanup] | ||||
|     public void TestCleanup() | ||||
|     { | ||||
|         if (TestContext.CurrentTestOutcome == UnitTestOutcome.Failed) | ||||
|             IncrementFailedTests(); | ||||
|     } | ||||
|  | ||||
|     [TestMethod] | ||||
|     public void TestControllerName() | ||||
|     { | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.AreEqual(IInfinityQSV3Controller<string>.GetRouteName(), _ControllerName); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -53,7 +59,7 @@ public class UnitTestInfinityQSV3Controller | ||||
|         IInfinityQSV3Repository? infinityQSV3Repository = serviceProvider?.GetRequiredService<IInfinityQSV3Repository>(); | ||||
|         string? result = infinityQSV3Repository?.GetCommandText("1698497987", "61", "CDE5", "5012", "575908", ""); | ||||
|         Assert.IsNotNull(result); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -62,11 +68,11 @@ public class UnitTestInfinityQSV3Controller | ||||
|     { | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         string? json = await httpClient.GetStringAsync($"api/{_ControllerName}/1698497987/commandText/?process=61&job=CDE5&part=5012&lot=575908&date_time=2023-02-24 15:15:00"); | ||||
|         File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetCommandText)}.sql"), json); | ||||
|         Assert.IsNotNull(json); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -77,14 +83,15 @@ public class UnitTestInfinityQSV3Controller | ||||
|         IServiceProvider? serviceProvider = _WebApplicationFactory?.Services.CreateScope().ServiceProvider; | ||||
|         IInfinityQSV3Repository? infinityQSV3Repository = serviceProvider?.GetRequiredService<IInfinityQSV3Repository>(); | ||||
|         Result<InfinityQSV3[]>? result = infinityQSV3Repository?.GetData("1698497987"); | ||||
|         Assert.IsNotNull(result?.Results); | ||||
|         Assert.IsTrue(result?.Results.Length != 0); | ||||
|         Assert.IsNotNull(result); | ||||
|         Assert.IsNotNull(result.Results); | ||||
|         Assert.AreNotEqual(0, result.Results.Length); | ||||
|         Assert.IsNotNull(result?.Results[0].Process); | ||||
|         Assert.IsNotNull(result?.Results[0].Variable); | ||||
|         Assert.IsNotNull(result?.Results[0].SiteNumber); | ||||
|         Assert.IsNotNull(result?.Results[0].VariableNumber); | ||||
|         Assert.IsNotNull(result?.Results[0].SubGroupDateTime); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -93,13 +100,13 @@ public class UnitTestInfinityQSV3Controller | ||||
|     { | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         //string? json = await httpClient.GetStringAsync($"api/{_ControllerName}/1698497987 575908_2023-02-24 14-18-05.txt/data"); | ||||
|         string? json = await httpClient.GetStringAsync($"api/{_ControllerName}/1698497987/data"); | ||||
|         File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetData)}.json"), json); | ||||
|         Result<InfinityQSV3[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSV3[]>>(json); | ||||
|         Assert.IsNotNull(result?.Results); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -110,11 +117,12 @@ public class UnitTestInfinityQSV3Controller | ||||
|         IServiceProvider? serviceProvider = _WebApplicationFactory?.Services.CreateScope().ServiceProvider; | ||||
|         IInfinityQSV3Repository? infinityQSV3Repository = serviceProvider?.GetRequiredService<IInfinityQSV3Repository>(); | ||||
|         Result<InfinityQSDescriptorV3[]>? result = infinityQSV3Repository?.GetDescriptors("1698497987"); | ||||
|         Assert.IsNotNull(result?.Results); | ||||
|         Assert.IsTrue(result?.Results.Length != 0); | ||||
|         Assert.IsNotNull(result?.Results[0].SubGroupId); | ||||
|         Assert.IsNotNull(result?.Results[0].SiteNumber); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         Assert.IsNotNull(result); | ||||
|         Assert.IsNotNull(result.Results); | ||||
|         Assert.AreNotEqual(0, result.Results.Length); | ||||
|         Assert.IsNotNull(result.Results[0].SubGroupId); | ||||
|         Assert.IsNotNull(result.Results[0].SiteNumber); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -123,13 +131,13 @@ public class UnitTestInfinityQSV3Controller | ||||
|     { | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         //string? json = await httpClient.GetStringAsync($"api/{_ControllerName}/1698497987 575908_2023-02-24 14-18-05.txt/descriptors"); | ||||
|         string? json = await httpClient.GetStringAsync($"api/{_ControllerName}/1698497987/descriptors"); | ||||
|         File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetDescriptors)}.json"), json); | ||||
|         Result<InfinityQSDescriptorV3[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSDescriptorV3[]>>(json); | ||||
|         Assert.IsNotNull(result?.Results); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -142,7 +150,7 @@ public class UnitTestInfinityQSV3Controller | ||||
|         Result<InfinityQSV3[]>? result = infinityQSV3Repository?.GetHeader("1698497987"); | ||||
|         Assert.IsNotNull(result?.Results); | ||||
|         Assert.IsNotNull(result?.Results[0].Part); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -151,13 +159,13 @@ public class UnitTestInfinityQSV3Controller | ||||
|     { | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         string? json = await httpClient.GetStringAsync($"api/{_ControllerName}/1698497987/header"); | ||||
|         File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetHeader)}.json"), json); | ||||
|         Result<InfinityQSV3[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSV3[]>>(json); | ||||
|         Assert.IsNotNull(result?.Results); | ||||
|         Assert.IsNotNull(result?.Results[0].Part); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -169,7 +177,7 @@ public class UnitTestInfinityQSV3Controller | ||||
|         IInfinityQSV3Repository? infinityQSV3Repository = serviceProvider?.GetRequiredService<IInfinityQSV3Repository>(); | ||||
|         string? result = infinityQSV3Repository?.GetProductDataAverageSumOfDefectsProcessMeanProcessSigma("41", "8IN_THIN ROTR"); | ||||
|         Assert.IsNotNull(result); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -178,11 +186,11 @@ public class UnitTestInfinityQSV3Controller | ||||
|     { | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         string? result = await httpClient.GetStringAsync($"api/{_ControllerName}/41/product-data-average-sum-of-defects-process-mean-process-sigma?recipe=8IN_THIN ROTR"); | ||||
|         File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetProductDataAverageSumOfDefectsProcessMeanProcessSigma)}.json"), result); | ||||
|         Assert.IsNotNull(result); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -195,7 +203,7 @@ public class UnitTestInfinityQSV3Controller | ||||
|         IInfinityQSV3Repository? infinityQSV3Repository = serviceProvider?.GetRequiredService<IInfinityQSV3Repository>(); | ||||
|         List<string[]>? results = infinityQSV3Repository?.GetEpiProTempVerificationRows(night); | ||||
|         Assert.IsNotNull(results); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -204,11 +212,11 @@ public class UnitTestInfinityQSV3Controller | ||||
|     { | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         string? result = await httpClient.GetStringAsync($"api/{_ControllerName}/epi-pro-temp-verification-rows/?night=44&night=46&night=52&night=54"); | ||||
|         File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetEpiProTempVerificationRows)}.json"), result); | ||||
|         Assert.IsNotNull(result); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -221,7 +229,7 @@ public class UnitTestInfinityQSV3Controller | ||||
|         IInfinityQSV3Repository? infinityQSV3Repository = serviceProvider?.GetRequiredService<IInfinityQSV3Repository>(); | ||||
|         string? result = infinityQSV3Repository?.GetEpiProTempVerification(night); | ||||
|         Assert.IsNotNull(result); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -230,11 +238,11 @@ public class UnitTestInfinityQSV3Controller | ||||
|     { | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         string? result = await httpClient.GetStringAsync($"api/{_ControllerName}/epi-pro-temp-verification/?night=44&night=46&night=52&night=54"); | ||||
|         File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetEpiProTempVerification)}.html"), result); | ||||
|         Assert.IsNotNull(result); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
|  | ||||
| @ -8,14 +8,14 @@ using OI.Metrology.Shared.Models.Stateless; | ||||
| namespace OI.Metrology.Tests; | ||||
|  | ||||
| [TestClass] | ||||
| public class UnitTestInfinityQSV4Controller | ||||
| public class UnitTestInfinityQSV4Controller : BaseTestClass | ||||
| { | ||||
|  | ||||
| #pragma warning disable CS8618 | ||||
|  | ||||
|     private static ILogger? _Logger; | ||||
|     private static string _ControllerName; | ||||
|     private static TestContext _TestContext; | ||||
|     public TestContext TestContext { get; set; } | ||||
|     private static string _ControllerVersion; | ||||
|     private static WebApplicationFactory<Server.Program>? _WebApplicationFactory; | ||||
|  | ||||
| @ -24,7 +24,6 @@ public class UnitTestInfinityQSV4Controller | ||||
|     [ClassInitialize] | ||||
|     public static void ClassInitAsync(TestContext testContext) | ||||
|     { | ||||
|         _TestContext = testContext; | ||||
|         _WebApplicationFactory = new WebApplicationFactory<Server.Program>(); | ||||
|         IServiceProvider serviceProvider = _WebApplicationFactory.Services.CreateScope().ServiceProvider; | ||||
|         _Logger = serviceProvider.GetRequiredService<ILogger<Server.Program>>(); | ||||
| @ -39,13 +38,20 @@ public class UnitTestInfinityQSV4Controller | ||||
|         catch (Exception) { } | ||||
|     } | ||||
|  | ||||
|     [TestCleanup] | ||||
|     public void TestCleanup() | ||||
|     { | ||||
|         if (TestContext.CurrentTestOutcome == UnitTestOutcome.Failed) | ||||
|             IncrementFailedTests(); | ||||
|     } | ||||
|  | ||||
|     [TestMethod] | ||||
|     public void TestControllerName() | ||||
|     { | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.AreEqual(IInfinityQSV4Controller<string>.GetRouteName(), _ControllerName); | ||||
|         Assert.AreEqual(IInfinityQSV4Controller<string>.GetRouteVersion(), _ControllerVersion); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -57,7 +63,7 @@ public class UnitTestInfinityQSV4Controller | ||||
|         IInfinityQSV4Repository? infinityQSV4Repository = serviceProvider?.GetRequiredService<IInfinityQSV4Repository>(); | ||||
|         string? result = infinityQSV4Repository?.GetCommandText("1718539249", "61", "CDE5", "5012", "575908", ""); | ||||
|         Assert.IsNotNull(result); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -66,14 +72,15 @@ public class UnitTestInfinityQSV4Controller | ||||
|     { | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         string? json = await httpClient.GetStringAsync($"api/{_ControllerVersion}/{_ControllerName}/1718539249/commandText/?process=61&job=CDE5&part=5012&lot=575908&date_time=2023-02-24 15:15:00"); | ||||
|         File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetCommandText)}.sql"), json); | ||||
|         Assert.IsNotNull(json); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
|     [Ignore] | ||||
|     [TestMethod] | ||||
|     public void GetData() | ||||
|     { | ||||
| @ -81,29 +88,31 @@ public class UnitTestInfinityQSV4Controller | ||||
|         IServiceProvider? serviceProvider = _WebApplicationFactory?.Services.CreateScope().ServiceProvider; | ||||
|         IInfinityQSV4Repository? infinityQSV4Repository = serviceProvider?.GetRequiredService<IInfinityQSV4Repository>(); | ||||
|         Result<InfinityQSV4[]>? result = infinityQSV4Repository?.GetData("1718539249"); | ||||
|         Assert.IsNotNull(result?.Results); | ||||
|         Assert.IsTrue(result?.Results.Length != 0); | ||||
|         Assert.IsNotNull(result); | ||||
|         Assert.IsNotNull(result.Results); | ||||
|         Assert.AreNotEqual(0, result.Results.Length); | ||||
|         Assert.IsNotNull(result?.Results[0].Process); | ||||
|         Assert.IsNotNull(result?.Results[0].Variable); | ||||
|         Assert.IsNotNull(result?.Results[0].SiteNumber); | ||||
|         Assert.IsNotNull(result?.Results[0].VariableNumber); | ||||
|         Assert.IsNotNull(result?.Results[0].SubGroupDateTime); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
|     [Ignore] | ||||
|     [TestMethod] | ||||
|     public async Task GetDataApi() | ||||
|     { | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         //string? json = await httpClient.GetStringAsync($"api/{_ControllerVersion}/{_ControllerName}/1718539249 575908_2023-02-24 14-18-05.txt/data"); | ||||
|         string? json = await httpClient.GetStringAsync($"api/{_ControllerVersion}/{_ControllerName}/1718539249/data"); | ||||
|         File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetData)}.json"), json); | ||||
|         Result<InfinityQSV4[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSV4[]>>(json); | ||||
|         Assert.IsNotNull(result?.Results); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -114,11 +123,12 @@ public class UnitTestInfinityQSV4Controller | ||||
|         IServiceProvider? serviceProvider = _WebApplicationFactory?.Services.CreateScope().ServiceProvider; | ||||
|         IInfinityQSV4Repository? infinityQSV4Repository = serviceProvider?.GetRequiredService<IInfinityQSV4Repository>(); | ||||
|         Result<InfinityQSDescriptorV4[]>? result = infinityQSV4Repository?.GetDescriptors("1718539249"); | ||||
|         Assert.IsNotNull(result?.Results); | ||||
|         Assert.IsTrue(result?.Results.Length != 0); | ||||
|         Assert.IsNotNull(result); | ||||
|         Assert.IsNotNull(result.Results); | ||||
|         Assert.AreNotEqual(0, result.Results.Length); | ||||
|         Assert.IsNotNull(result?.Results[0].SubGroupId); | ||||
|         Assert.IsNotNull(result?.Results[0].SiteNumber); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -127,13 +137,13 @@ public class UnitTestInfinityQSV4Controller | ||||
|     { | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         //string? json = await httpClient.GetStringAsync($"api/{_ControllerVersion}/{_ControllerName}/1718539249 575908_2023-02-24 14-18-05.txt/descriptors"); | ||||
|         string? json = await httpClient.GetStringAsync($"api/{_ControllerVersion}/{_ControllerName}/1718539249/descriptors"); | ||||
|         File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetDescriptors)}.json"), json); | ||||
|         Result<InfinityQSDescriptorV3[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSDescriptorV3[]>>(json); | ||||
|         Assert.IsNotNull(result?.Results); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -146,7 +156,7 @@ public class UnitTestInfinityQSV4Controller | ||||
|         Result<InfinityQSV4[]>? result = infinityQSV4Repository?.GetHeader("1718539249"); | ||||
|         Assert.IsNotNull(result?.Results); | ||||
|         Assert.IsNotNull(result?.Results[0].Part); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -155,16 +165,17 @@ public class UnitTestInfinityQSV4Controller | ||||
|     { | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         string? json = await httpClient.GetStringAsync($"api/{_ControllerVersion}/{_ControllerName}/1718539249/header"); | ||||
|         File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetHeader)}.json"), json); | ||||
|         Result<InfinityQSV4[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<InfinityQSV4[]>>(json); | ||||
|         Assert.IsNotNull(result?.Results); | ||||
|         Assert.IsNotNull(result?.Results[0].Part); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
|     [Ignore] | ||||
|     [TestMethod] | ||||
|     public void GetProductDataAverageSumOfDefectsProcessMeanProcessSigma() | ||||
|     { | ||||
| @ -173,20 +184,21 @@ public class UnitTestInfinityQSV4Controller | ||||
|         IInfinityQSV4Repository? infinityQSV4Repository = serviceProvider?.GetRequiredService<IInfinityQSV4Repository>(); | ||||
|         string? result = infinityQSV4Repository?.GetProductDataAverageSumOfDefectsProcessMeanProcessSigma("41", "8IN_THIN ROTR"); | ||||
|         Assert.IsNotNull(result); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
|     [Ignore] | ||||
|     [TestMethod] | ||||
|     public async Task GetProductDataAverageSumOfDefectsProcessMeanProcessSigmaApi() | ||||
|     { | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         string? result = await httpClient.GetStringAsync($"api/{_ControllerVersion}/{_ControllerName}/41/product-data-average-sum-of-defects-process-mean-process-sigma?recipe=8IN_THIN ROTR"); | ||||
|         File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetProductDataAverageSumOfDefectsProcessMeanProcessSigma)}.json"), result); | ||||
|         Assert.IsNotNull(result); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -199,7 +211,7 @@ public class UnitTestInfinityQSV4Controller | ||||
|         IInfinityQSV4Repository? infinityQSV4Repository = serviceProvider?.GetRequiredService<IInfinityQSV4Repository>(); | ||||
|         List<string[]>? results = infinityQSV4Repository?.GetEpiProTempVerificationRows(night); | ||||
|         Assert.IsNotNull(results); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -208,11 +220,11 @@ public class UnitTestInfinityQSV4Controller | ||||
|     { | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         string? result = await httpClient.GetStringAsync($"api/{_ControllerVersion}/{_ControllerName}/epi-pro-temp-verification-rows/?night=44&night=46&night=52&night=54"); | ||||
|         File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetEpiProTempVerificationRows)}.json"), result); | ||||
|         Assert.IsNotNull(result); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -225,7 +237,7 @@ public class UnitTestInfinityQSV4Controller | ||||
|         IInfinityQSV4Repository? infinityQSV4Repository = serviceProvider?.GetRequiredService<IInfinityQSV4Repository>(); | ||||
|         string? result = infinityQSV4Repository?.GetEpiProTempVerification(night); | ||||
|         Assert.IsNotNull(result); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -234,11 +246,11 @@ public class UnitTestInfinityQSV4Controller | ||||
|     { | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         string? result = await httpClient.GetStringAsync($"api/{_ControllerVersion}/{_ControllerName}/epi-pro-temp-verification/?night=44&night=46&night=52&night=54"); | ||||
|         File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetEpiProTempVerification)}.html"), result); | ||||
|         Assert.IsNotNull(result); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -250,7 +262,7 @@ public class UnitTestInfinityQSV4Controller | ||||
|         IInfinityQSV4Repository? infinityQSV4Repository = serviceProvider?.GetRequiredService<IInfinityQSV4Repository>(); | ||||
|         List<Reactor>? results = infinityQSV4Repository?.GetReactors(); | ||||
|         Assert.IsNotNull(results); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -266,7 +278,7 @@ public class UnitTestInfinityQSV4Controller | ||||
|             result = infinityQSV4Repository?.GetProductionSpecification(part); | ||||
|             Assert.IsNotNull(result); | ||||
|         } | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -298,7 +310,7 @@ public class UnitTestInfinityQSV4Controller | ||||
|             result = infinityQSV4Repository?.GetProductionSpecification(part); | ||||
|             Assert.IsNotNull(result); | ||||
|         } | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -313,7 +325,7 @@ public class UnitTestInfinityQSV4Controller | ||||
|         IInfinityQSV4Repository? infinityQSV4Repository = serviceProvider?.GetRequiredService<IInfinityQSV4Repository>(); | ||||
|         string? result = infinityQSV4Repository?.GetLastGroupIdWithValue(process, part, test); | ||||
|         Assert.IsNotNull(result); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -325,11 +337,11 @@ public class UnitTestInfinityQSV4Controller | ||||
|         const string process = "35"; | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         string? result = await httpClient.GetStringAsync($"api/{_ControllerVersion}/{_ControllerName}/{process}/last-group-id-with-value/?part={part}&test={test}"); | ||||
|         File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetLastGroupIdWithValue)}.html"), result); | ||||
|         Assert.IsNotNull(result); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
|  | ||||
| @ -6,14 +6,14 @@ using OI.Metrology.Shared.Models.Stateless; | ||||
| namespace OI.Metrology.Tests; | ||||
|  | ||||
| [TestClass] | ||||
| public class UnitTestOpenInsightV1Controller | ||||
| public class UnitTestOpenInsightV1Controller : BaseTestClass | ||||
| { | ||||
|  | ||||
| #pragma warning disable CS8618 | ||||
|  | ||||
|     private static ILogger? _Logger; | ||||
|     private static string _ControllerName; | ||||
|     private static TestContext _TestContext; | ||||
|     public TestContext TestContext { get; set; } | ||||
|     private static WebApplicationFactory<Server.Program>? _WebApplicationFactory; | ||||
|  | ||||
| #pragma warning restore | ||||
| @ -21,7 +21,6 @@ public class UnitTestOpenInsightV1Controller | ||||
|     [ClassInitialize] | ||||
|     public static void ClassInitAsync(TestContext testContext) | ||||
|     { | ||||
|         _TestContext = testContext; | ||||
|         _WebApplicationFactory = new WebApplicationFactory<Server.Program>(); | ||||
|         IServiceProvider serviceProvider = _WebApplicationFactory.Services.CreateScope().ServiceProvider; | ||||
|         _Logger = serviceProvider.GetRequiredService<ILogger<Server.Program>>(); | ||||
| @ -35,12 +34,19 @@ public class UnitTestOpenInsightV1Controller | ||||
|         catch (Exception) { } | ||||
|     } | ||||
|  | ||||
|     [TestCleanup] | ||||
|     public void TestCleanup() | ||||
|     { | ||||
|         if (TestContext.CurrentTestOutcome == UnitTestOutcome.Failed) | ||||
|             IncrementFailedTests(); | ||||
|     } | ||||
|  | ||||
|     [TestMethod] | ||||
|     public void TestControllerName() | ||||
|     { | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.AreEqual(IOpenInsightV1Controller<string>.GetRouteName(), _ControllerName); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|     } | ||||
|  | ||||
|     [TestMethod] | ||||
| @ -51,7 +57,7 @@ public class UnitTestOpenInsightV1Controller | ||||
|         IOpenInsightV1Repository? openInsightRepository = serviceProvider?.GetRequiredService<IOpenInsightV1Repository>(); | ||||
|         string? result = openInsightRepository?.GetTencorRun("615071", "10/30/2023 06:48:34PM", "6IN_EPP ROTR"); | ||||
|         Assert.IsNotNull(result); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -60,11 +66,11 @@ public class UnitTestOpenInsightV1Controller | ||||
|     { | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         string? result = await httpClient.GetStringAsync($"api/{_ControllerName}/615071/tencor-run?insert_date=10/30/2023 06:48:34PM&recipe=6IN_EPP ROTR"); | ||||
|         File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetTencorRun)}.json"), result); | ||||
|         Assert.IsNotNull(result); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
|  | ||||
| @ -7,14 +7,14 @@ using OI.Metrology.Shared.Models.Stateless; | ||||
| namespace OI.Metrology.Tests; | ||||
|  | ||||
| [TestClass] | ||||
| public class UnitTestPinController | ||||
| public class UnitTestPinController : BaseTestClass | ||||
| { | ||||
|  | ||||
| #pragma warning disable CS8618 | ||||
|  | ||||
|     private static ILogger? _Logger; | ||||
|     private static string _ControllerName; | ||||
|     private static TestContext _TestContext; | ||||
|     public TestContext TestContext { get; set; } | ||||
|     private static WebApplicationFactory<Server.Program>? _WebApplicationFactory; | ||||
|  | ||||
| #pragma warning restore | ||||
| @ -22,19 +22,32 @@ public class UnitTestPinController | ||||
|     [ClassInitialize] | ||||
|     public static void ClassInitAsync(TestContext testContext) | ||||
|     { | ||||
|         _TestContext = testContext; | ||||
|         _WebApplicationFactory = new WebApplicationFactory<Server.Program>(); | ||||
|         IServiceProvider serviceProvider = _WebApplicationFactory.Services.CreateScope().ServiceProvider; | ||||
|         _Logger = serviceProvider.GetRequiredService<ILogger<Server.Program>>(); | ||||
|         _ControllerName = nameof(Server.ApiControllers.PinController)[..^10]; | ||||
|     } | ||||
|  | ||||
|     private static void NonThrowTryCatch() | ||||
|     { | ||||
|         try | ||||
|         { throw new Exception(); } | ||||
|         catch (Exception) { } | ||||
|     } | ||||
|  | ||||
|     [TestCleanup] | ||||
|     public void TestCleanup() | ||||
|     { | ||||
|         if (TestContext.CurrentTestOutcome == UnitTestOutcome.Failed) | ||||
|             IncrementFailedTests(); | ||||
|     } | ||||
|  | ||||
|     [TestMethod] | ||||
|     public void TestControllerName() | ||||
|     { | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.AreEqual(IPinController<string>.GetRouteName(), _ControllerName); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|     } | ||||
|  | ||||
|     [TestMethod] | ||||
| @ -44,10 +57,10 @@ public class UnitTestPinController | ||||
|         IServiceProvider? serviceProvider = _WebApplicationFactory?.Services.CreateScope().ServiceProvider; | ||||
|         IMetrologyRepository? metrologyRepository = serviceProvider?.GetRequiredService<IMetrologyRepository>(); | ||||
|         IPinRepository? pinRepository = serviceProvider?.GetRequiredService<IPinRepository>(); | ||||
|         Assert.IsTrue(metrologyRepository is not null); | ||||
|         Assert.IsNotNull(metrologyRepository); | ||||
|         Result<Pinned[]>? result = pinRepository?.GetPinnedTable(metrologyRepository, id: 1, cde_id: null, biorad_id: null, rds: null); | ||||
|         Assert.IsNotNull(result?.Results); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|     } | ||||
|  | ||||
|     [TestMethod] | ||||
| @ -55,12 +68,12 @@ public class UnitTestPinController | ||||
|     { | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         string? json = await httpClient.GetStringAsync($"api/{_ControllerName}/-1/pinned"); | ||||
|         File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetPinnedTable)}.json"), json); | ||||
|         Result<Pinned[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<Pinned[]>>(json); | ||||
|         Assert.IsNotNull(result?.Results); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|     } | ||||
|  | ||||
| } | ||||
| @ -7,14 +7,14 @@ using OI.Metrology.Shared.ViewModels; | ||||
| namespace OI.Metrology.Tests; | ||||
|  | ||||
| [TestClass] | ||||
| public class UnitTestServiceShopOrderController | ||||
| public class UnitTestServiceShopOrderController : BaseTestClass | ||||
| { | ||||
|  | ||||
| #pragma warning disable CS8618 | ||||
|  | ||||
|     private static ILogger? _Logger; | ||||
|     private static string _ControllerName; | ||||
|     private static TestContext _TestContext; | ||||
|     public TestContext TestContext { get; set; } | ||||
|     private static WebApplicationFactory<Server.Program>? _WebApplicationFactory; | ||||
|  | ||||
| #pragma warning restore | ||||
| @ -22,19 +22,32 @@ public class UnitTestServiceShopOrderController | ||||
|     [ClassInitialize] | ||||
|     public static void ClassInitAsync(TestContext testContext) | ||||
|     { | ||||
|         _TestContext = testContext; | ||||
|         _WebApplicationFactory = new WebApplicationFactory<Server.Program>(); | ||||
|         IServiceProvider serviceProvider = _WebApplicationFactory.Services.CreateScope().ServiceProvider; | ||||
|         _Logger = serviceProvider.GetRequiredService<ILogger<Server.Program>>(); | ||||
|         _ControllerName = nameof(Server.ApiControllers.ServiceShopOrderController)[..^10]; | ||||
|     } | ||||
|  | ||||
|     private static void NonThrowTryCatch() | ||||
|     { | ||||
|         try | ||||
|         { throw new Exception(); } | ||||
|         catch (Exception) { } | ||||
|     } | ||||
|  | ||||
|     [TestCleanup] | ||||
|     public void TestCleanup() | ||||
|     { | ||||
|         if (TestContext.CurrentTestOutcome == UnitTestOutcome.Failed) | ||||
|             IncrementFailedTests(); | ||||
|     } | ||||
|  | ||||
|     [TestMethod] | ||||
|     public void TestControllerName() | ||||
|     { | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.AreEqual(IServiceShopOrderController<string>.GetRouteName(), _ControllerName); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|     } | ||||
|  | ||||
|     [TestMethod] | ||||
| @ -42,9 +55,9 @@ public class UnitTestServiceShopOrderController | ||||
|     { | ||||
|         if (_Logger is null) | ||||
|             throw new NullReferenceException(nameof(_Logger)); | ||||
|         ServiceShopOrder[] serviceShopOrders = IServiceShopOrder.GetServiceShopOrders(null); | ||||
|         ServiceShopOrder[]? serviceShopOrders = IServiceShopOrder.GetServiceShopOrders(null); | ||||
|         Assert.IsNotNull(serviceShopOrders); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|     } | ||||
|  | ||||
|     [TestMethod] | ||||
| @ -54,13 +67,13 @@ public class UnitTestServiceShopOrderController | ||||
|         ServiceShopOrder[]? serviceShopOrders; | ||||
|         IServiceProvider? serviceProvider = _WebApplicationFactory?.Services.CreateScope().ServiceProvider; | ||||
|         IServiceShopOrderRepository? serviceShopOrderRepository = serviceProvider?.GetRequiredService<IServiceShopOrderRepository>(); | ||||
|         Assert.IsTrue(serviceShopOrderRepository is not null); | ||||
|         Assert.IsNotNull(serviceShopOrderRepository); | ||||
|         serviceShopOrders = await serviceShopOrderRepository.GetAllServiceShopOrders(); | ||||
|         Assert.IsTrue(serviceShopOrders is not null); | ||||
|         Assert.IsNotNull(serviceShopOrders); | ||||
|         serviceShopOrders = await serviceShopOrderRepository.GetServiceShopOrders("23188d3d-9b75-ed11-ab8b-0050568f2fc3"); | ||||
|         Assert.IsTrue(serviceShopOrders is not null && serviceShopOrders.Length != 0); | ||||
|         Assert.IsNotNull(serviceShopOrders[0].ToString()); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|     } | ||||
|  | ||||
|     [TestMethod] | ||||
| @ -68,14 +81,14 @@ public class UnitTestServiceShopOrderController | ||||
|     { | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         string actionName = nameof(IServiceShopOrderController<object>.Action.All); | ||||
|         string? json = await httpClient.GetStringAsync($"api/{_ControllerName}/{actionName}"); | ||||
|         File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetAllServiceShopOrders)}.json"), json); | ||||
|         ServiceShopOrder[]? serviceShopOrders = System.Text.Json.JsonSerializer.Deserialize<ServiceShopOrder[]>(json); | ||||
|         Assert.IsNotNull(serviceShopOrders); | ||||
|         Assert.IsTrue(serviceShopOrders.Length != 0); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         Assert.AreNotEqual(0, serviceShopOrders.Length); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|     } | ||||
|  | ||||
| } | ||||
| @ -10,14 +10,14 @@ using System.Net.Http.Json; | ||||
| namespace OI.Metrology.Tests; | ||||
|  | ||||
| [TestClass] | ||||
| public class UnitTestToolTypesController | ||||
| public class UnitTestToolTypesController : BaseTestClass | ||||
| { | ||||
|  | ||||
| #pragma warning disable CS8618 | ||||
|  | ||||
|     private static ILogger? _Logger; | ||||
|     private static string _ControllerName; | ||||
|     private static TestContext _TestContext; | ||||
|     public TestContext TestContext { get; set; } | ||||
|     private static WebApplicationFactory<Server.Program>? _WebApplicationFactory; | ||||
|  | ||||
| #pragma warning restore | ||||
| @ -25,7 +25,6 @@ public class UnitTestToolTypesController | ||||
|     [ClassInitialize] | ||||
|     public static void ClassInitAsync(TestContext testContext) | ||||
|     { | ||||
|         _TestContext = testContext; | ||||
|         _WebApplicationFactory = new WebApplicationFactory<Server.Program>(); | ||||
|         IServiceProvider serviceProvider = _WebApplicationFactory.Services.CreateScope().ServiceProvider; | ||||
|         _Logger = serviceProvider.GetRequiredService<ILogger<Server.Program>>(); | ||||
| @ -39,12 +38,19 @@ public class UnitTestToolTypesController | ||||
|         catch (Exception) { } | ||||
|     } | ||||
|  | ||||
|     [TestCleanup] | ||||
|     public void TestCleanup() | ||||
|     { | ||||
|         if (TestContext.CurrentTestOutcome == UnitTestOutcome.Failed) | ||||
|             IncrementFailedTests(); | ||||
|     } | ||||
|  | ||||
|     [TestMethod] | ||||
|     public void TestControllerName() | ||||
|     { | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.AreEqual(IToolTypesController<string>.GetRouteName(), _ControllerName); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|     } | ||||
|  | ||||
|     [TestMethod] | ||||
| @ -54,12 +60,12 @@ public class UnitTestToolTypesController | ||||
|         IServiceProvider? serviceProvider = _WebApplicationFactory?.Services.CreateScope().ServiceProvider; | ||||
|         IMetrologyRepository? metrologyRepository = serviceProvider?.GetRequiredService<IMetrologyRepository>(); | ||||
|         IToolTypesRepository? toolTypesRepository = serviceProvider?.GetRequiredService<IToolTypesRepository>(); | ||||
|         Assert.IsTrue(metrologyRepository is not null); | ||||
|         Assert.IsNotNull(metrologyRepository); | ||||
|         Result<ToolTypeNameId[]>? result = toolTypesRepository?.Index(metrologyRepository); | ||||
|         Assert.IsNotNull(result?.Results); | ||||
|         Assert.IsTrue(result.Results.Length != 0); | ||||
|         Assert.AreNotEqual(0, result.Results.Length); | ||||
|         Assert.IsFalse(result.Results.All(l => l.ID == 0)); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|     } | ||||
|  | ||||
|     [TestMethod] | ||||
| @ -67,14 +73,14 @@ public class UnitTestToolTypesController | ||||
|     { | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         string? json = await httpClient.GetStringAsync($"api/{_ControllerName}"); | ||||
|         File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(Index)}.json"), json); | ||||
|         Result<ToolTypeNameId[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<ToolTypeNameId[]>>(json); | ||||
|         Assert.IsNotNull(result?.Results); | ||||
|         Assert.IsTrue(result.Results.Length != 0); | ||||
|         Assert.AreNotEqual(0, result.Results.Length); | ||||
|         Assert.IsFalse(result.Results.All(l => l.ID == 0)); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|     } | ||||
|  | ||||
|     [TestMethod] | ||||
| @ -84,13 +90,13 @@ public class UnitTestToolTypesController | ||||
|         IServiceProvider? serviceProvider = _WebApplicationFactory?.Services.CreateScope().ServiceProvider; | ||||
|         IMetrologyRepository? metrologyRepository = serviceProvider?.GetRequiredService<IMetrologyRepository>(); | ||||
|         IToolTypesRepository? toolTypesRepository = serviceProvider?.GetRequiredService<IToolTypesRepository>(); | ||||
|         Assert.IsTrue(metrologyRepository is not null); | ||||
|         Assert.IsNotNull(metrologyRepository); | ||||
|         Result<ToolTypeMetadataResult>? result = toolTypesRepository?.GetToolTypeMetadata(metrologyRepository, id: 1, sortby: string.Empty); | ||||
|         Assert.IsNotNull(result?.Results); | ||||
|         Assert.IsNotNull(result.Results.Metadata); | ||||
|         Assert.IsTrue(result.Results.Metadata.Length != 0); | ||||
|         Assert.AreNotEqual(0, result.Results.Metadata.Length); | ||||
|         Assert.IsFalse(result.Results.Metadata.All(l => l.ToolTypeID == 0)); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|     } | ||||
|  | ||||
|     [TestMethod] | ||||
| @ -98,15 +104,15 @@ public class UnitTestToolTypesController | ||||
|     { | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         string? json = await httpClient.GetStringAsync($"api/{_ControllerName}/1"); | ||||
|         File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetToolTypeMetadata)}.json"), json); | ||||
|         Result<ToolTypeMetadataResult>? result = System.Text.Json.JsonSerializer.Deserialize<Result<ToolTypeMetadataResult>>(json); | ||||
|         Assert.IsNotNull(result?.Results); | ||||
|         Assert.IsNotNull(result.Results.Metadata); | ||||
|         Assert.IsTrue(result.Results.Metadata.Length != 0); | ||||
|         Assert.AreNotEqual(0, result.Results.Metadata.Length); | ||||
|         Assert.IsFalse(result.Results.Metadata.All(l => l.ToolTypeID == 0)); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|     } | ||||
|  | ||||
|     [TestMethod] | ||||
| @ -116,11 +122,11 @@ public class UnitTestToolTypesController | ||||
|         IServiceProvider? serviceProvider = _WebApplicationFactory?.Services.CreateScope().ServiceProvider; | ||||
|         IMetrologyRepository? metrologyRepository = serviceProvider?.GetRequiredService<IMetrologyRepository>(); | ||||
|         IToolTypesRepository? toolTypesRepository = serviceProvider?.GetRequiredService<IToolTypesRepository>(); | ||||
|         Assert.IsTrue(metrologyRepository is not null); | ||||
|         Assert.IsNotNull(metrologyRepository); | ||||
|         Result<DataTable>? result = toolTypesRepository?.GetHeaders(metrologyRepository, id: 1, datebegin: null, dateend: null, page: null, pagesize: null, headerid: null); | ||||
|         Assert.IsNotNull(result?.Results); | ||||
|         Assert.IsNotNull(result.Results.Rows.Count > 0); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|     } | ||||
|  | ||||
|     [TestMethod] | ||||
| @ -128,13 +134,13 @@ public class UnitTestToolTypesController | ||||
|     { | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         string? json = await httpClient.GetStringAsync($"api/{_ControllerName}/1/headers"); | ||||
|         File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetHeaders)}.json"), json); | ||||
|         Result<DataTable>? result = Newtonsoft.Json.JsonConvert.DeserializeObject<Result<DataTable>>(json); | ||||
|         Assert.IsNotNull(result?.Results); | ||||
|         Assert.IsNotNull(result.Results.Rows.Count > 0); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|     } | ||||
|  | ||||
|     [TestMethod] | ||||
| @ -144,11 +150,12 @@ public class UnitTestToolTypesController | ||||
|         IServiceProvider? serviceProvider = _WebApplicationFactory?.Services.CreateScope().ServiceProvider; | ||||
|         IMetrologyRepository? metrologyRepository = serviceProvider?.GetRequiredService<IMetrologyRepository>(); | ||||
|         IToolTypesRepository? toolTypesRepository = serviceProvider?.GetRequiredService<IToolTypesRepository>(); | ||||
|         Assert.IsTrue(metrologyRepository is not null); | ||||
|         Assert.IsNotNull(metrologyRepository); | ||||
|         Result<HeaderCommon[]>? result = toolTypesRepository?.GetHeaderTitles(metrologyRepository, id: -1, page: null, pagesize: null); | ||||
|         Assert.IsNotNull(result?.Results); | ||||
|         Assert.IsTrue(result?.Results.Length != 0); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         Assert.IsNotNull(result); | ||||
|         Assert.IsNotNull(result.Results); | ||||
|         Assert.AreNotEqual(0, result.Results.Length); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|     } | ||||
|  | ||||
|     [TestMethod] | ||||
| @ -156,13 +163,13 @@ public class UnitTestToolTypesController | ||||
|     { | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         string? json = await httpClient.GetStringAsync($"api/{_ControllerName}/-1/headertitles"); | ||||
|         File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetHeaderTitles)}.json"), json); | ||||
|         Result<HeaderCommon[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<HeaderCommon[]>>(json); | ||||
|         Assert.IsNotNull(result?.Results); | ||||
|         Assert.IsTrue(result.Results.Length != 0); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         Assert.AreNotEqual(0, result.Results.Length); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|     } | ||||
|  | ||||
|     [TestMethod] | ||||
| @ -172,11 +179,11 @@ public class UnitTestToolTypesController | ||||
|         IServiceProvider? serviceProvider = _WebApplicationFactory?.Services.CreateScope().ServiceProvider; | ||||
|         IMetrologyRepository? metrologyRepository = serviceProvider?.GetRequiredService<IMetrologyRepository>(); | ||||
|         IToolTypesRepository? toolTypesRepository = serviceProvider?.GetRequiredService<IToolTypesRepository>(); | ||||
|         Assert.IsTrue(metrologyRepository is not null); | ||||
|         Assert.IsNotNull(metrologyRepository); | ||||
|         Result<ColumnValue[]>? result = toolTypesRepository?.GetHeaderFields(metrologyRepository, id: 1, headerid: 1); | ||||
|         Assert.IsNotNull(result?.Results); | ||||
|         Assert.IsTrue(result.Results.Length != 0); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         Assert.AreNotEqual(0, result.Results.Length); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|     } | ||||
|  | ||||
|     [TestMethod] | ||||
| @ -184,13 +191,13 @@ public class UnitTestToolTypesController | ||||
|     { | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         string? json = await httpClient.GetStringAsync($"api/{_ControllerName}/1/headers/1/fields"); | ||||
|         File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetHeaderFields)}.json"), json); | ||||
|         Result<ColumnValue[]>? result = System.Text.Json.JsonSerializer.Deserialize<Result<ColumnValue[]>>(json); | ||||
|         Assert.IsNotNull(result?.Results); | ||||
|         Assert.IsTrue(result.Results.Length != 0); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         Assert.AreNotEqual(0, result.Results.Length); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|     } | ||||
|  | ||||
|     [TestMethod] | ||||
| @ -200,11 +207,11 @@ public class UnitTestToolTypesController | ||||
|         IServiceProvider? serviceProvider = _WebApplicationFactory?.Services.CreateScope().ServiceProvider; | ||||
|         IMetrologyRepository? metrologyRepository = serviceProvider?.GetRequiredService<IMetrologyRepository>(); | ||||
|         IToolTypesRepository? toolTypesRepository = serviceProvider?.GetRequiredService<IToolTypesRepository>(); | ||||
|         Assert.IsTrue(metrologyRepository is not null); | ||||
|         Assert.IsNotNull(metrologyRepository); | ||||
|         Result<DataTable>? result = toolTypesRepository?.GetData(metrologyRepository, id: 1, headerid: 1); | ||||
|         Assert.IsNotNull(result?.Results); | ||||
|         Assert.IsNotNull(result.Results.Rows.Count > 0); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|     } | ||||
|  | ||||
|     [TestMethod] | ||||
| @ -212,13 +219,13 @@ public class UnitTestToolTypesController | ||||
|     { | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         string? json = await httpClient.GetStringAsync($"api/{_ControllerName}/1/headers/1/data"); | ||||
|         File.WriteAllText(Path.Combine(AppContext.BaseDirectory, $"{_ControllerName}-{nameof(GetData)}.json"), json); | ||||
|         Result<DataTable>? result = Newtonsoft.Json.JsonConvert.DeserializeObject<Result<DataTable>>(json); | ||||
|         Assert.IsNotNull(result?.Results); | ||||
|         Assert.IsNotNull(result.Results.Rows.Count > 0); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|     } | ||||
|  | ||||
|     [Ignore] | ||||
| @ -227,19 +234,19 @@ public class UnitTestToolTypesController | ||||
|     { | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         int toolTypeId = 1; | ||||
|         string tabletype = "data"; | ||||
|         string tableType = "data"; | ||||
|         string filename = "data.txt"; | ||||
|         string attachmentId = "ffdf5410-ca19-4097-bfa4-b398e236d07e"; | ||||
|         IServiceProvider? serviceProvider = _WebApplicationFactory?.Services.CreateScope().ServiceProvider; | ||||
|         IAttachmentsService? attachmentsService = serviceProvider?.GetRequiredService<IAttachmentsService>(); | ||||
|         IMetrologyRepository? metrologyRepository = serviceProvider?.GetRequiredService<IMetrologyRepository>(); | ||||
|         IToolTypesRepository? toolTypesRepository = serviceProvider?.GetRequiredService<IToolTypesRepository>(); | ||||
|         Assert.IsTrue(attachmentsService is not null); | ||||
|         Assert.IsTrue(metrologyRepository is not null); | ||||
|         Assert.IsTrue(toolTypesRepository is not null); | ||||
|         (string? message, string? _, Stream? _) = toolTypesRepository.GetAttachment(metrologyRepository, attachmentsService, toolTypeId, tabletype, attachmentId, filename); | ||||
|         Assert.IsTrue(message is null); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         Assert.IsNotNull(attachmentsService); | ||||
|         Assert.IsNotNull(metrologyRepository); | ||||
|         Assert.IsNotNull(toolTypesRepository); | ||||
|         (string? message, string? _, Stream? _) = toolTypesRepository.GetAttachment(metrologyRepository, attachmentsService, toolTypeId, tableType, attachmentId, filename); | ||||
|         Assert.IsNull(message); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|     } | ||||
|  | ||||
|     [Ignore] | ||||
| @ -248,9 +255,9 @@ public class UnitTestToolTypesController | ||||
|     { | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         _ = await httpClient.GetFromJsonAsync<object>($"api/{_ControllerName}/1/data/files/ffdf5410-ca19-4097-bfa4-b398e236d07e/data.txt"); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|     } | ||||
|  | ||||
|     [Ignore] | ||||
| @ -263,12 +270,12 @@ public class UnitTestToolTypesController | ||||
|         IMetrologyRepository? metrologyRepository = serviceProvider?.GetRequiredService<IMetrologyRepository>(); | ||||
|         IToolTypesRepository? toolTypesRepository = serviceProvider?.GetRequiredService<IToolTypesRepository>(); | ||||
|         Server.Models.AppSettings? appSettings = serviceProvider?.GetRequiredService<Server.Models.AppSettings>(); | ||||
|         Assert.IsTrue(appSettings is not null); | ||||
|         Assert.IsTrue(attachmentsService is not null); | ||||
|         Assert.IsTrue(metrologyRepository is not null); | ||||
|         Assert.IsNotNull(appSettings); | ||||
|         Assert.IsNotNull(attachmentsService); | ||||
|         Assert.IsNotNull(metrologyRepository); | ||||
|         string? message = toolTypesRepository?.OIExport(metrologyRepository, attachmentsService, toolTypeId: 1, headerid: 1); | ||||
|         Assert.IsTrue(message is null); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         Assert.IsNull(message); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|     } | ||||
|  | ||||
|     [Ignore] | ||||
| @ -277,9 +284,9 @@ public class UnitTestToolTypesController | ||||
|     { | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         _ = await httpClient.GetFromJsonAsync<object>($"api/{_ControllerName}/1/headers/1/export"); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|     } | ||||
|  | ||||
| } | ||||
| @ -7,14 +7,14 @@ using OI.Metrology.Shared.Models.Stateless; | ||||
| namespace OI.Metrology.Tests; | ||||
|  | ||||
| [TestClass] | ||||
| public class UnitTestWaferCounterController | ||||
| public class UnitTestWaferCounterController : BaseTestClass | ||||
| { | ||||
|  | ||||
| #pragma warning disable CS8618 | ||||
|  | ||||
|     private static ILogger? _Logger; | ||||
|     private static string _ControllerName; | ||||
|     private static TestContext _TestContext; | ||||
|     public TestContext TestContext { get; set; } | ||||
|     private static WebApplicationFactory<Wafer.Counter.Program>? _WebApplicationFactory; | ||||
|  | ||||
| #pragma warning restore | ||||
| @ -22,7 +22,6 @@ public class UnitTestWaferCounterController | ||||
|     [ClassInitialize] | ||||
|     public static void ClassInitAsync(TestContext testContext) | ||||
|     { | ||||
|         _TestContext = testContext; | ||||
|         _WebApplicationFactory = new WebApplicationFactory<Wafer.Counter.Program>(); | ||||
|         IServiceProvider serviceProvider = _WebApplicationFactory.Services.CreateScope().ServiceProvider; | ||||
|         _Logger = serviceProvider.GetRequiredService<ILogger<Wafer.Counter.Program>>(); | ||||
| @ -36,12 +35,19 @@ public class UnitTestWaferCounterController | ||||
|         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", _TestContext?.TestName); | ||||
|         Assert.AreEqual(IWaferCounterController<string>.GetRouteName(), _ControllerName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -52,9 +58,9 @@ public class UnitTestWaferCounterController | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         IServiceProvider? serviceProvider = _WebApplicationFactory?.Services.CreateScope().ServiceProvider; | ||||
|         IWaferCounterRepository? waferCounterRepository = serviceProvider?.GetRequiredService<IWaferCounterRepository>(); | ||||
|         WaferCounter? result = waferCounterRepository?.GetLastQuantityAndSlotMap(area: "FQA", waferSize: "8INCH", text: "Test"); | ||||
|         WaferCounter? result = waferCounterRepository?.GetLastQuantityAndSlotMap(area: "MU", waferSize: "9INCH", text: "Test"); | ||||
|         Assert.IsNotNull(result); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
| @ -64,10 +70,10 @@ public class UnitTestWaferCounterController | ||||
|     { | ||||
|         HttpClient? httpClient = _WebApplicationFactory?.CreateClient(); | ||||
|         _Logger?.LogInformation("Starting Web Application"); | ||||
|         Assert.IsTrue(httpClient is not null); | ||||
|         string? response = await httpClient.GetStringAsync($"api/v1/{_ControllerName}/FQA/last-quantity-and-slot-map/?waferSize=8INCH&text=Test"); | ||||
|         Assert.IsNotNull(httpClient); | ||||
|         string? response = await httpClient.GetStringAsync($"api/v1/{_ControllerName}/MU/last-quantity-and-slot-map/?waferSize=9INCH&text=Test"); | ||||
|         Assert.IsNotNull(response); | ||||
|         _Logger?.LogInformation("{TestName} completed", _TestContext?.TestName); | ||||
|         _Logger?.LogInformation("{TestName} completed", TestContext.TestName); | ||||
|         NonThrowTryCatch(); | ||||
|     } | ||||
|  | ||||
|  | ||||
							
								
								
									
										21
									
								
								Tests/server-development.hurl
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								Tests/server-development.hurl
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,21 @@ | ||||
| ### | ||||
|  | ||||
| GET https://oi-metrology-viewer-prod.mes.infineon.com:4432/api/AppSettings/App | ||||
| Accept: application/json | ||||
|  | ||||
| HTTP 200 | ||||
| [Asserts] | ||||
| header "Content-Type" == "application/json; charset=utf-8" | ||||
| jsonpath "$.company" == "Infineon Technologies Americas Corp." | ||||
|  | ||||
| ### | ||||
|  | ||||
| GET https://oi-metrology-viewer-prod.mes.infineon.com:4432/api/tooltypes | ||||
| Accept: application/json | ||||
|  | ||||
| HTTP 200 | ||||
| [Asserts] | ||||
| header "Content-Type" == "application/json; charset=utf-8" | ||||
| jsonpath "$.Results" count > 5 | ||||
|  | ||||
| ### | ||||
							
								
								
									
										21
									
								
								Tests/server-release.hurl
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								Tests/server-release.hurl
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,21 @@ | ||||
| ### | ||||
|  | ||||
| GET https://oi-metrology-viewer-prod.mes.infineon.com:4433/api/AppSettings/App | ||||
| Accept: application/json | ||||
|  | ||||
| HTTP 200 | ||||
| [Asserts] | ||||
| header "Content-Type" == "application/json; charset=utf-8" | ||||
| jsonpath "$.company" == "Infineon Technologies Americas Corp." | ||||
|  | ||||
| ### | ||||
|  | ||||
| GET https://oi-metrology-viewer-prod.mes.infineon.com:4433/api/tooltypes | ||||
| Accept: application/json | ||||
|  | ||||
| HTTP 200 | ||||
| [Asserts] | ||||
| header "Content-Type" == "application/json; charset=utf-8" | ||||
| jsonpath "$.Results" count > 5 | ||||
|  | ||||
| ### | ||||
							
								
								
									
										2
									
								
								Wafer-Counter/.vscode/launch.json
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								Wafer-Counter/.vscode/launch.json
									
									
									
									
										vendored
									
									
								
							| @ -8,7 +8,7 @@ | ||||
|             "name": ".NET Core Launch (web)", | ||||
|             "type": "coreclr", | ||||
|             "request": "launch", | ||||
|             "preLaunchTask": "build", | ||||
|             "preLaunchTask": "Build", | ||||
|             // If you have changed target frameworks, make sure to update the program path. | ||||
|             "program": "${workspaceFolder}/bin/Debug/net8.0/OI.Metrology.Wafer.Counter.dll", | ||||
|             "args": [], | ||||
|  | ||||
							
								
								
									
										489
									
								
								Wafer-Counter/.vscode/tasks.json
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										489
									
								
								Wafer-Counter/.vscode/tasks.json
									
									
									
									
										vendored
									
									
								
							| @ -1,60 +1,173 @@ | ||||
| { | ||||
|     "version": "2.0.0", | ||||
|     "inputs": [ | ||||
|         { | ||||
|             "default": "Development", | ||||
|             "description": "Which ASP Net Core Environment?", | ||||
|             "id": "ASPNETCORE_ENVIRONMENT", | ||||
|             "options": [ | ||||
|                 "Development", | ||||
|                 "Production" | ||||
|             ], | ||||
|             "type": "pickString" | ||||
|         }, | ||||
|         { | ||||
|             "default": "{AssemblyTitle}", | ||||
|             "description": "What Assembly Title?", | ||||
|             "id": "AssemblyTitle", | ||||
|             "type": "promptString" | ||||
|         }, | ||||
|         { | ||||
|             "default": "{Build.BuildId}", | ||||
|             "description": "Which Build BuildId?", | ||||
|             "id": "Build.BuildId", | ||||
|             "type": "promptString" | ||||
|         }, | ||||
|         { | ||||
|             "default": "{Build.Reason}", | ||||
|             "description": "Which Build Reason?", | ||||
|             "id": "Build.Reason", | ||||
|             "type": "promptString" | ||||
|         }, | ||||
|         { | ||||
|             "default": "{Build.Repository.Id}", | ||||
|             "description": "Which Build Repository Id?", | ||||
|             "id": "Build.Repository.Id", | ||||
|             "type": "promptString" | ||||
|         }, | ||||
|         { | ||||
|             "default": "{Build.Repository.Name}", | ||||
|             "description": "Which Build Repository Name?", | ||||
|             "id": "Build.Repository.Name", | ||||
|             "type": "promptString" | ||||
|         }, | ||||
|         { | ||||
|             "default": "{Build.SourceVersion}", | ||||
|             "description": "Which Build Source Version?", | ||||
|             "id": "Build.SourceVersion", | ||||
|             "type": "promptString" | ||||
|         }, | ||||
|         { | ||||
|             "default": "Debug", | ||||
|             "description": "Which Configuration?", | ||||
|             "id": "Configuration", | ||||
|             "options": [ | ||||
|                 "Debug", | ||||
|                 "Release" | ||||
|             ], | ||||
|             "type": "pickString" | ||||
|         }, | ||||
|         { | ||||
|             "default": "net8.0", | ||||
|             "description": "Which Core Version?", | ||||
|             "id": "CoreVersion", | ||||
|             "options": [ | ||||
|                 "net8.0" | ||||
|             ], | ||||
|             "type": "pickString" | ||||
|         }, | ||||
|         { | ||||
|             "default": "C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/MSBuild/Current/Bin/MSBuild.exe", | ||||
|             "description": "Which MS Build?", | ||||
|             "id": "MSBuild", | ||||
|             "type": "promptString" | ||||
|         }, | ||||
|         { | ||||
|             "default": "https://artifactory.intra.infineon.com/artifactory/api/nuget/ngt-fi-package-main-vir/", | ||||
|             "description": "Which Nuget Source?", | ||||
|             "id": "NugetSource", | ||||
|             "type": "promptString" | ||||
|         }, | ||||
|         { | ||||
|             "default": "win-x64", | ||||
|             "description": "Which Runtime?", | ||||
|             "id": "Runtime", | ||||
|             "options": [ | ||||
|                 "win-x64", | ||||
|                 "win-x32", | ||||
|                 "linux-x64", | ||||
|                 "linux-x32" | ||||
|             ], | ||||
|             "type": "pickString" | ||||
|         }, | ||||
|         { | ||||
|             "default": "L:/", | ||||
|             "description": "Which System DefaultWorkingDirectory?", | ||||
|             "id": "System.DefaultWorkingDirectory", | ||||
|             "options": [ | ||||
|                 "L:/", | ||||
|                 "D:/", | ||||
|                 "C:/" | ||||
|             ], | ||||
|             "type": "pickString" | ||||
|         }, | ||||
|         { | ||||
|             "default": "v4.8", | ||||
|             "description": "Which Core Target Framework Version?", | ||||
|             "id": "TargetFrameworkVersion", | ||||
|             "options": [ | ||||
|                 "v4.8" | ||||
|             ], | ||||
|             "type": "pickString" | ||||
|         }, | ||||
|         { | ||||
|             "default": "{UserSecretsId}", | ||||
|             "description": "Which Core User Secrets Id?", | ||||
|             "id": "UserSecretsId", | ||||
|             "type": "promptString" | ||||
|         } | ||||
|     ], | ||||
|     "tasks": [ | ||||
|         { | ||||
|             "label": "build", | ||||
|             "command": "dotnet", | ||||
|             "type": "process", | ||||
|             "args": [ | ||||
|                 "build", | ||||
|                 "${workspaceFolder}/OI.Metrology.Wafer.Counter.csproj", | ||||
|                 "/property:GenerateFullPaths=true", | ||||
|                 "/consoleloggerparameters:NoSummary" | ||||
|             ], | ||||
|             "problemMatcher": "$msCompile" | ||||
|             "command": "dotnet OI.Metrology.Wafer.Counter.dll", | ||||
|             "label": "Dotnet Run Debug", | ||||
|             "options": { | ||||
|                 "cwd": "${workspaceFolder}/bin/Debug/net8.0" | ||||
|             }, | ||||
|             "problemMatcher": [], | ||||
|             "type": "shell" | ||||
|         }, | ||||
|         { | ||||
|             "label": "buildTests", | ||||
|             "command": "dotnet", | ||||
|             "type": "process", | ||||
|             "args": [ | ||||
|                 "build", | ||||
|                 "${workspaceFolder}/../Tests/OI.Metrology.Tests.csproj", | ||||
|                 "/property:GenerateFullPaths=true", | ||||
|                 "/consoleloggerparameters:NoSummary" | ||||
|                 "build" | ||||
|             ], | ||||
|             "problemMatcher": "$msCompile" | ||||
|             "command": "dotnet", | ||||
|             "label": "Build", | ||||
|             "problemMatcher": "$msCompile", | ||||
|             "type": "process" | ||||
|         }, | ||||
|         { | ||||
|             "label": "testDebug", | ||||
|             "args": [ | ||||
|                 "build", | ||||
|                 "${workspaceFolder}/../Tests/OI.Metrology.Tests.csproj" | ||||
|             ], | ||||
|             "command": "dotnet", | ||||
|             "type": "process", | ||||
|             "label": "Build Tests", | ||||
|             "problemMatcher": "$msCompile", | ||||
|             "type": "process" | ||||
|         }, | ||||
|         { | ||||
|             "args": [ | ||||
|                 "test", | ||||
|                 "${workspaceFolder}/../Tests/OI.Metrology.Tests.csproj" | ||||
|             ], | ||||
|             "command": "dotnet", | ||||
|             "label": "Test Debug", | ||||
|             "problemMatcher": "$msCompile", | ||||
|             "type": "process" | ||||
|         }, | ||||
|         { | ||||
|             "args": [ | ||||
|                 "test", | ||||
|                 "${workspaceFolder}/../Tests/OI.Metrology.Tests.csproj", | ||||
|                 "/property:GenerateFullPaths=true", | ||||
|                 "/consoleloggerparameters:NoSummary" | ||||
|             ], | ||||
|             "problemMatcher": "$msCompile" | ||||
|         }, | ||||
|         { | ||||
|             "label": "testRelease", | ||||
|             "command": "dotnet", | ||||
|             "type": "process", | ||||
|             "args": [ | ||||
|                 "test", | ||||
|                 "${workspaceFolder}/../Tests/OI.Metrology.Tests.csproj", | ||||
|                 "/property:GenerateFullPaths=true", | ||||
|                 "/consoleloggerparameters:NoSummary", | ||||
|                 "-c", | ||||
|                 "Release" | ||||
|             ], | ||||
|             "problemMatcher": "$msCompile" | ||||
|             "command": "dotnet", | ||||
|             "label": "Test Release", | ||||
|             "problemMatcher": "$msCompile", | ||||
|             "type": "process" | ||||
|         }, | ||||
|         { | ||||
|             "label": "Format", | ||||
|             "command": "dotnet", | ||||
|             "type": "process", | ||||
|             "args": [ | ||||
|                 "format", | ||||
|                 "--report", | ||||
| @ -64,27 +177,24 @@ | ||||
|                 "--severity", | ||||
|                 "warn" | ||||
|             ], | ||||
|             "problemMatcher": "$msCompile" | ||||
|             "command": "dotnet", | ||||
|             "label": "Format", | ||||
|             "problemMatcher": "$msCompile", | ||||
|             "type": "process" | ||||
|         }, | ||||
|         { | ||||
|             "label": "Format-Whitespace", | ||||
|             "command": "dotnet", | ||||
|             "type": "process", | ||||
|             "args": [ | ||||
|                 "format", | ||||
|                 "whitespace" | ||||
|             ], | ||||
|             "problemMatcher": "$msCompile" | ||||
|             "command": "dotnet", | ||||
|             "label": "Format Whitespace", | ||||
|             "problemMatcher": "$msCompile", | ||||
|             "type": "process" | ||||
|         }, | ||||
|         { | ||||
|             "label": "publish", | ||||
|             "command": "dotnet", | ||||
|             "type": "process", | ||||
|             "args": [ | ||||
|                 "publish", | ||||
|                 "${workspaceFolder}/OI.Metrology.Wafer.Counter.csproj", | ||||
|                 "/property:GenerateFullPaths=true", | ||||
|                 "/consoleloggerparameters:NoSummary", | ||||
|                 "--configuration", | ||||
|                 "Release", | ||||
|                 "--runtime", | ||||
| @ -93,17 +203,14 @@ | ||||
|                 "-o", | ||||
|                 "D:/web-sites/OI-Metrology/oo-8e5dd137-_______-OI-Metrology-Release/Wafer-Counter" | ||||
|             ], | ||||
|             "problemMatcher": "$msCompile" | ||||
|             "command": "dotnet", | ||||
|             "label": "Publish", | ||||
|             "problemMatcher": "$msCompile", | ||||
|             "type": "process" | ||||
|         }, | ||||
|         { | ||||
|             "label": "Publish AOT", | ||||
|             "command": "dotnet", | ||||
|             "type": "process", | ||||
|             "args": [ | ||||
|                 "publish", | ||||
|                 "${workspaceFolder}/OI.Metrology.Wafer.Counter.csproj", | ||||
|                 "/property:GenerateFullPaths=true", | ||||
|                 "/consoleloggerparameters:NoSummary", | ||||
|                 "--configuration", | ||||
|                 "Release", | ||||
|                 "--runtime", | ||||
| @ -111,53 +218,269 @@ | ||||
|                 "-p:PublishAot=true", | ||||
|                 "/property:GenerateFullPaths=true" | ||||
|             ], | ||||
|             "problemMatcher": "$msCompile" | ||||
|             "command": "dotnet", | ||||
|             "label": "Publish AOT", | ||||
|             "problemMatcher": "$msCompile", | ||||
|             "type": "process" | ||||
|         }, | ||||
|         { | ||||
|             "label": "old-watch", | ||||
|             "command": "dotnet", | ||||
|             "type": "process", | ||||
|             "args": [ | ||||
|                 "watch", | ||||
|                 "run", | ||||
|                 "--project", | ||||
|                 "${workspaceFolder}/OI.Metrology.Wafer.Counter.csproj" | ||||
|                 "run" | ||||
|             ], | ||||
|             "problemMatcher": "$msCompile" | ||||
|             "command": "dotnet", | ||||
|             "label": "Old Watch", | ||||
|             "problemMatcher": "$msCompile", | ||||
|             "type": "process" | ||||
|         }, | ||||
|         { | ||||
|             "label": "watch", | ||||
|             "command": "dotnet", | ||||
|             "type": "process", | ||||
|             "args": [ | ||||
|                 "watch", | ||||
|                 "--launch-profile", | ||||
|                 "http", | ||||
|                 "run", | ||||
|                 "--project", | ||||
|                 "${workspaceFolder}/OI.Metrology.Wafer.Counter.csproj", | ||||
|                 "--verbose" | ||||
|             ], | ||||
|             "isBackground": true, | ||||
|             "command": "dotnet", | ||||
|             "dependsOn": [ | ||||
|                 "build" | ||||
|                 "Build" | ||||
|             ], | ||||
|             "isBackground": true, | ||||
|             "label": "Watch", | ||||
|             "problemMatcher": { | ||||
|                 "fileLocation": "relative", | ||||
|                 "pattern": { | ||||
|                     "regexp": "^([^\\s].*)\\((\\d+|\\d+,\\d+|\\d+,\\d+,\\d+,\\d+)\\):\\s+(error|warning|info)\\s+(TS\\d+)\\s*:\\s*(.*)$", | ||||
|                     "file": 1, | ||||
|                     "location": 2, | ||||
|                     "severity": 3, | ||||
|                     "code": 4, | ||||
|                     "message": 5 | ||||
|                 }, | ||||
|                 "background": { | ||||
|                     "activeOnStart": true, | ||||
|                     "beginsPattern": "^.*Shutdown requested.*", | ||||
|                     "endsPattern": "^.*Application started.*" | ||||
|                 }, | ||||
|                 "fileLocation": "relative", | ||||
|                 "pattern": { | ||||
|                     "code": 4, | ||||
|                     "file": 1, | ||||
|                     "location": 2, | ||||
|                     "message": 5, | ||||
|                     "regexp": "^([^\\s].*)\\((\\d+|\\d+,\\d+|\\d+,\\d+,\\d+,\\d+)\\):\\s+(error|warning|info)\\s+(TS\\d+)\\s*:\\s*(.*)$", | ||||
|                     "severity": 3 | ||||
|                 } | ||||
|             } | ||||
|             }, | ||||
|             "type": "process" | ||||
|         }, | ||||
|         { | ||||
|             "command": "echo Assembly Title: ${input:AssemblyTitle} & echo Build Id: ${input:Build.BuildId} & echo Build Reason: ${input:Build.Reason} & echo Repo Id: ${input:Build.Repository.Id} & echo Repo Name: ${input:Build.Repository.Name} & echo Source Version: ${input:Build.SourceVersion} & echo Configuration: ${input:Configuration} & echo Core Version: ${input:CoreVersion} & echo Nuget Source: ${input:NugetSource} & echo Runtime: ${input:Runtime}", | ||||
|             "label": "Echo Check", | ||||
|             "problemMatcher": [], | ||||
|             "type": "shell" | ||||
|         }, | ||||
|         { | ||||
|             "command": "dotnet user-secrets init & dotnet user-secrets set BuildNumber ${input:Build.BuildId} & dotnet user-secrets set GitCommit ${input:Build.SourceVersion} & dotnet user-secrets list", | ||||
|             "label": "Server - Safe storage of app secrets", | ||||
|             "problemMatcher": [], | ||||
|             "type": "shell" | ||||
|         }, | ||||
|         { | ||||
|             "args": [ | ||||
|                 "build", | ||||
|                 "--configuration", | ||||
|                 "${input:Configuration}", | ||||
|                 "--source", | ||||
|                 "${input:NugetSource}" | ||||
|             ], | ||||
|             "command": "dotnet", | ||||
|             "label": "App - Build", | ||||
|             "problemMatcher": "$msCompile", | ||||
|             "type": "process" | ||||
|         }, | ||||
|         { | ||||
|             "args": [ | ||||
|                 "build", | ||||
|                 "${workspaceFolder}/../Tests/OI.Metrology.Tests.csproj", | ||||
|                 "--configuration", | ||||
|                 "${input:Configuration}", | ||||
|                 "--source", | ||||
|                 "${input:NugetSource}" | ||||
|             ], | ||||
|             "command": "dotnet", | ||||
|             "label": "Tests - Build", | ||||
|             "problemMatcher": "$msCompile", | ||||
|             "type": "process" | ||||
|         }, | ||||
|         { | ||||
|             "args": [ | ||||
|                 "test", | ||||
|                 "${workspaceFolder}/../Tests/OI.Metrology.Tests.csproj", | ||||
|                 "--configuration", | ||||
|                 "${input:Configuration}" | ||||
|             ], | ||||
|             "command": "dotnet", | ||||
|             "label": "Tests - Test", | ||||
|             "problemMatcher": "$msCompile", | ||||
|             "type": "process" | ||||
|         }, | ||||
|         { | ||||
|             "args": [ | ||||
|                 "publish", | ||||
|                 "--configuration", | ||||
|                 "${input:Configuration}", | ||||
|                 "--runtime", | ||||
|                 "${input:Runtime}", | ||||
|                 "--self-contained" | ||||
|             ], | ||||
|             "command": "dotnet", | ||||
|             "label": "App - Publish", | ||||
|             "problemMatcher": "$msCompile", | ||||
|             "type": "process" | ||||
|         }, | ||||
|         { | ||||
|             "args": [ | ||||
|                 "publish", | ||||
|                 "--configuration", | ||||
|                 "${input:Configuration}", | ||||
|                 "--runtime", | ||||
|                 "${input:Runtime}", | ||||
|                 "-p:PublishAot=true" | ||||
|             ], | ||||
|             "command": "dotnet", | ||||
|             "label": "App - AOT Publish", | ||||
|             "problemMatcher": "$msCompile", | ||||
|             "type": "process" | ||||
|         }, | ||||
|         { | ||||
|             "command": "(robocopy /MIR \"bin/${input:Configuration}/${input:CoreVersion}/${input:Runtime}/publish\" \"D:/${input:CoreVersion}/${input:Runtime}/${input:Build.Repository.Name}/${input:Configuration}/${input:Build.BuildId}/${input:AssemblyTitle}\") ^& IF %ERRORLEVEL% LEQ 7 exit 0", | ||||
|             "label": "Copy Files to: D:/", | ||||
|             "problemMatcher": [], | ||||
|             "type": "shell" | ||||
|         }, | ||||
|         { | ||||
|             "args": [ | ||||
|                 "tool", | ||||
|                 "restore" | ||||
|             ], | ||||
|             "command": "dotnet", | ||||
|             "label": "Tool Restore", | ||||
|             "problemMatcher": [], | ||||
|             "type": "process" | ||||
|         }, | ||||
|         { | ||||
|             "args": [ | ||||
|                 "ReportGenerator", | ||||
|                 "-reports:${input:System.DefaultWorkingDirectory}/TestResults/**/coverage.cobertura.xml", | ||||
|                 "-targetDir:${input:Build.ArtifactStagingDirectory}/Coverage", | ||||
|                 "-reportTypes:Html_Dark" | ||||
|             ], | ||||
|             "command": "dotnet", | ||||
|             "label": "Report Generator", | ||||
|             "problemMatcher": [], | ||||
|             "type": "process" | ||||
|         }, | ||||
|         { | ||||
|             "args": [ | ||||
|                 "clean", | ||||
|                 "${workspaceFolder}/../Tests/OI.Metrology.Tests.csproj", | ||||
|                 "--configuration", | ||||
|                 "${input:Configuration}" | ||||
|             ], | ||||
|             "command": "dotnet", | ||||
|             "label": "Tests - Clean", | ||||
|             "problemMatcher": "$msCompile", | ||||
|             "type": "process" | ||||
|         }, | ||||
|         { | ||||
|             "args": [ | ||||
|                 "clean", | ||||
|                 "--configuration", | ||||
|                 "${input:Configuration}" | ||||
|             ], | ||||
|             "command": "dotnet", | ||||
|             "label": "App - Clean", | ||||
|             "problemMatcher": "$msCompile", | ||||
|             "type": "process" | ||||
|         }, | ||||
|         { | ||||
|             "command": "C:/Windows/system32/inetsrv/appcmd.exe stop apppool /apppool.name:${input:AssemblyTitle}.${input:Configuration} & exit 0", | ||||
|             "label": "Stop Pool", | ||||
|             "problemMatcher": [], | ||||
|             "type": "shell" | ||||
|         }, | ||||
|         { | ||||
|             "command": "C:/Windows/system32/inetsrv/appcmd.exe stop site /site.name:${input:AssemblyTitle}.${input:Configuration} & exit 0", | ||||
|             "label": "Stop Website", | ||||
|             "problemMatcher": [], | ||||
|             "type": "shell" | ||||
|         }, | ||||
|         { | ||||
|             "command": "rmdir D:/web-sites/${input:AssemblyTitle}.${input:Configuration} & exit 0", | ||||
|             "label": "Remove MKLink", | ||||
|             "problemMatcher": [], | ||||
|             "type": "shell" | ||||
|         }, | ||||
|         { | ||||
|             "command": "mklink /J \"D:\\web-sites\\${input:AssemblyTitle}.${input:Configuration}\" \"D:\\$(CoreVersion)\\$(Runtime)\\$(Build.Repository.Name)\\$(Configuration)\\$(Build.BuildId)\\$(AssemblyTitle)\"", | ||||
|             "label": "Create MKLink", | ||||
|             "problemMatcher": [], | ||||
|             "type": "shell" | ||||
|         }, | ||||
|         { | ||||
|             "command": "mkdir D:/web-sites/${input:AssemblyTitle}.${input:Configuration}/${input:AssemblyTitle}.${input:Configuration} & exit 0", | ||||
|             "label": "Make Directory", | ||||
|             "problemMatcher": [], | ||||
|             "type": "shell" | ||||
|         }, | ||||
|         { | ||||
|             "command": "(robocopy /E /IS /IT /IM \"%USERPROFILE%/AppData/Roaming/Microsoft/UserSecrets/$(UserSecretsId)\" \"D:/$(CoreVersion)/$(Runtime)/$(Build.Repository.Name)/$(Configuration)/$(Build.BuildId)/$(AssemblyTitle)\" secrets.json) ^& IF %ERRORLEVEL% LEQ 7 exit 0", | ||||
|             "label": "Replace User Secrets Id File", | ||||
|             "problemMatcher": [], | ||||
|             "type": "shell" | ||||
|         }, | ||||
|         { | ||||
|             "command": "(robocopy /E /IS /IT /IM \"%USERPROFILE%/AppData/Roaming/Microsoft/UserSecrets/$(UserSecretsId)\" \"D:/$(CoreVersion)/$(Runtime)/$(Build.Repository.Name)/$(Configuration)/$(Build.BuildId)/$(AssemblyTitle)\" web.config) ^& IF %ERRORLEVEL% LEQ 7 exit 0", | ||||
|             "label": "Replace Web Configuration File", | ||||
|             "problemMatcher": [], | ||||
|             "type": "shell" | ||||
|         }, | ||||
|         { | ||||
|             "command": "C:/Windows/system32/inetsrv/appcmd.exe start apppool /apppool.name:${input:AssemblyTitle}.${input:Configuration}", | ||||
|             "label": "Start Pool", | ||||
|             "problemMatcher": [], | ||||
|             "type": "shell" | ||||
|         }, | ||||
|         { | ||||
|             "command": "C:/Windows/system32/inetsrv/appcmd.exe start site /site.name:${input:AssemblyTitle}.${input:Configuration}", | ||||
|             "label": "Start Website", | ||||
|             "problemMatcher": [], | ||||
|             "type": "shell" | ||||
|         }, | ||||
|         { | ||||
|             "args": [ | ||||
|                 "App - AOT Publish", | ||||
|                 "Tool Restore", | ||||
|                 "Report Generator" | ||||
|             ], | ||||
|             "command": "echo", | ||||
|             "dependsOn": [ | ||||
|                 "Echo Check", | ||||
|                 "Server - Safe storage of app secrets", | ||||
|                 "App - Build", | ||||
|                 "Tests - Build", | ||||
|                 "Tests - Test", | ||||
|                 "App - Publish", | ||||
|                 "Copy Files to: D:/", | ||||
|                 "Tests - Clean", | ||||
|                 "App - Clean", | ||||
|                 "Stop Pool", | ||||
|                 "Stop Website", | ||||
|                 "Remove MKLink", | ||||
|                 "Create MKLink", | ||||
|                 "Make Directory", | ||||
|                 "Replace User Secrets Id File", | ||||
|                 "Replace Web Configuration File", | ||||
|                 "Start Pool", | ||||
|                 "Start Website" | ||||
|             ], | ||||
|             "dependsOrder": "sequence", | ||||
|             "label": "Pipeline", | ||||
|             "problemMatcher": [], | ||||
|             "type": "shell" | ||||
|         } | ||||
|     ] | ||||
|     ], | ||||
|     "version": "2.0.0" | ||||
| } | ||||
| @ -8,9 +8,9 @@ namespace OI.Metrology.Wafer.Counter.ApiControllers; | ||||
| public class AppSettingsController : ControllerBase, IAppSettingsController<ActionResult> | ||||
| { | ||||
|  | ||||
|     private readonly IAppSettingsRepository<Models.Binder.AppSettings> _AppSettingsRepository; | ||||
|     private readonly IAppSettingsRepository<Models.AppSettings> _AppSettingsRepository; | ||||
|  | ||||
|     public AppSettingsController(IAppSettingsRepository<Models.Binder.AppSettings> AppSettingsRepository) => | ||||
|     public AppSettingsController(IAppSettingsRepository<Models.AppSettings> AppSettingsRepository) => | ||||
|         _AppSettingsRepository = AppSettingsRepository; | ||||
|  | ||||
|     [HttpGet(nameof(IAppSettingsController<ActionResult>.Action.App))] | ||||
|  | ||||
| @ -1,9 +1,9 @@ | ||||
| using Microsoft.AspNetCore.Mvc; | ||||
| using OI.Metrology.Shared.DataModels; | ||||
| using OI.Metrology.Shared.Models; | ||||
| using OI.Metrology.Shared.Models.Stateless; | ||||
| using System.Collections.Specialized; | ||||
| using System.Text.Json; | ||||
| using System.Web; | ||||
| using OI.Metrology.Wafer.Counter.Helper; | ||||
| using System.Collections.ObjectModel; | ||||
|  | ||||
| namespace OI.Metrology.Wafer.Counter.ApiControllers; | ||||
|  | ||||
| @ -37,39 +37,21 @@ public class FileShareController : Controller, IFileShareController<IResult> | ||||
|         return Results.Ok(); | ||||
|     } | ||||
|  | ||||
|     private static Dictionary<string, string?> GetKeyValuePairs(QueryString queryString) | ||||
|     { | ||||
|         Dictionary<string, string?> results = []; | ||||
|         if (queryString.HasValue) | ||||
|         { | ||||
|             NameValueCollection nameValueCollection = HttpUtility.ParseQueryString(queryString.Value); | ||||
|             foreach (string? key in nameValueCollection.AllKeys) | ||||
|             { | ||||
|                 if (key is null) | ||||
|                     continue; | ||||
|                 results.Add(key, nameValueCollection[key]); | ||||
|             } | ||||
|         } | ||||
|         return results; | ||||
|     } | ||||
|  | ||||
|     private static CharacterizationParameters? GetCharacterizationParameters(QueryString queryString) | ||||
|     { | ||||
|         CharacterizationParameters? result; | ||||
|         Dictionary<string, string?> keyValuePairs = GetKeyValuePairs(queryString); | ||||
|         string json = JsonSerializer.Serialize(keyValuePairs); | ||||
|         result = string.IsNullOrEmpty(json) ? null : JsonSerializer.Deserialize(json, CharacterizationParametersSourceGenerationContext.Default.CharacterizationParameters); | ||||
|         return result; | ||||
|     } | ||||
|  | ||||
|     [HttpGet("archive-data")] | ||||
|     public IActionResult ArchiveData() | ||||
|     { | ||||
|         List<CharacterizationInfo> results; | ||||
|         CharacterizationParameters? characterizationParameters = GetCharacterizationParameters(Request.QueryString); | ||||
|         ReadOnlyCollection<CharacterizationInfo> results; | ||||
|         CharacterizationParameters? characterizationParameters = ParameterHelper.GetCharacterizationParameters(Request.QueryString); | ||||
|         ArgumentNullException.ThrowIfNull(characterizationParameters); | ||||
|         results = _FileShareRepository.GetArchiveData(characterizationParameters); | ||||
|         return Json(results); | ||||
|     } | ||||
|  | ||||
|     [HttpGet("equipment-ids")] | ||||
|     public IActionResult EquipmentIds() | ||||
|     { | ||||
|         ReadOnlyCollection<ToolTypeNameId> results = _FileShareRepository.GetEquipmentIds(); | ||||
|         return Json(results); | ||||
|     } | ||||
|  | ||||
| } | ||||
							
								
								
									
										93
									
								
								Wafer-Counter/Helper/ParameterHelper.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										93
									
								
								Wafer-Counter/Helper/ParameterHelper.cs
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,93 @@ | ||||
| using OI.Metrology.Shared.Models; | ||||
| using System.Collections.Specialized; | ||||
| using System.Net; | ||||
| using System.Text.Json; | ||||
| using System.Text.Json.Serialization; | ||||
| using System.Web; | ||||
|  | ||||
| namespace OI.Metrology.Wafer.Counter.Helper; | ||||
|  | ||||
| public class ParameterHelper | ||||
| { | ||||
|  | ||||
|     private static Dictionary<string, string?> GetKeyValuePairs(QueryString queryString) | ||||
|     { | ||||
|         Dictionary<string, string?> results = []; | ||||
|         if (queryString.HasValue) | ||||
|         { | ||||
|             NameValueCollection nameValueCollection = HttpUtility.ParseQueryString(queryString.Value); | ||||
|             foreach (string? key in nameValueCollection.AllKeys) | ||||
|             { | ||||
|                 if (key is null) | ||||
|                     continue; | ||||
|                 results.Add(key, nameValueCollection[key]); | ||||
|             } | ||||
|         } | ||||
|         return results; | ||||
|     } | ||||
|  | ||||
|     internal static CharacterizationParameters? GetCharacterizationParameters(QueryString queryString) | ||||
|     { | ||||
|         CharacterizationParameters? result; | ||||
|         Dictionary<string, string?> keyValuePairs = GetKeyValuePairs(queryString); | ||||
| #pragma warning disable CS8620 | ||||
|         string json = JsonSerializer.Serialize(keyValuePairs, DictionaryStringStringSourceGenerationContext.Default.DictionaryStringString); | ||||
| #pragma warning restore CS8620 | ||||
|         result = string.IsNullOrEmpty(json) ? null : JsonSerializer.Deserialize(json, CharacterizationParametersSourceGenerationContext.Default.CharacterizationParameters); | ||||
|         return result; | ||||
|     } | ||||
|  | ||||
|     private static string? GetQueryString(Stream stream) | ||||
|     { | ||||
|         string? result; | ||||
|         if (!stream.CanRead) | ||||
|             result = null; | ||||
|         else | ||||
|         { | ||||
|             Task<string> task = new StreamReader(stream).ReadToEndAsync(); | ||||
|             result = task.Result; | ||||
|         } | ||||
|         return result; | ||||
|     } | ||||
|  | ||||
|     private static Dictionary<string, string?> GetKeyValuePairs(string? queryString) | ||||
|     { | ||||
|         Dictionary<string, string?> results = []; | ||||
|         if (!string.IsNullOrEmpty(queryString)) | ||||
|         { | ||||
|             NameValueCollection nameValueCollection = HttpUtility.ParseQueryString(queryString); | ||||
|             foreach (string? key in nameValueCollection.AllKeys) | ||||
|             { | ||||
|                 if (key is null) | ||||
|                     continue; | ||||
|                 results.Add(key, nameValueCollection[key]); | ||||
|             } | ||||
|         } | ||||
|         return results; | ||||
|     } | ||||
|  | ||||
|     internal static PollValue? GetPollValue(IPAddress? remoteIpAddress, Stream stream) | ||||
|     { | ||||
|         PollValue? result; | ||||
|         string? queryString = GetQueryString(stream); | ||||
|         Dictionary<string, string?> keyValuePairs = GetKeyValuePairs(queryString); | ||||
| #pragma warning disable CS8620 | ||||
|         string json = JsonSerializer.Serialize(keyValuePairs, DictionaryStringStringSourceGenerationContext.Default.DictionaryStringString); | ||||
| #pragma warning restore CS8620 | ||||
|         result = string.IsNullOrEmpty(json) ? null : JsonSerializer.Deserialize(json, PollValueSourceGenerationContext.Default.PollValue); | ||||
|         if (result is not null) | ||||
|         { | ||||
|             result = new(null, result.Id, result.Page, queryString, remoteIpAddress is null ? string.Empty : remoteIpAddress.ToString(), result.Time, result.Value); | ||||
|             json = JsonSerializer.Serialize(result, PollValueSourceGenerationContext.Default.PollValue); | ||||
|             result = new(json, result.Id, result.Page, queryString, remoteIpAddress is null ? string.Empty : remoteIpAddress.ToString(), result.Time, result.Value); | ||||
|         } | ||||
|         return result; | ||||
|     } | ||||
|  | ||||
| } | ||||
|  | ||||
| [JsonSourceGenerationOptions(WriteIndented = true)] | ||||
| [JsonSerializable(typeof(Dictionary<string, string>))] | ||||
| public partial class DictionaryStringStringSourceGenerationContext : JsonSerializerContext | ||||
| { | ||||
| } | ||||
| @ -1,6 +1,6 @@ | ||||
| using System.Text.RegularExpressions; | ||||
| 
 | ||||
| namespace OI.Metrology.Wafer.Counter.Repository; | ||||
| namespace OI.Metrology.Wafer.Counter.Helper; | ||||
| 
 | ||||
| public partial class RegexHelper | ||||
| { | ||||
| @ -8,4 +8,4 @@ public partial class RegexHelper | ||||
|     [GeneratedRegex(@"[\\,\/,\:,\*,\?,\"",\<,\>,\|]")]
 | ||||
|     internal static partial Regex WindowsFileSystem(); | ||||
| 
 | ||||
| } | ||||
| } | ||||
| @ -1,4 +1,5 @@ | ||||
| using System.Text.Json; | ||||
| using System.Text.Json.Serialization; | ||||
|  | ||||
| namespace OI.Metrology.Wafer.Counter.Models; | ||||
|  | ||||
| @ -20,8 +21,59 @@ public record AppSettings(string BuildNumber, | ||||
|  | ||||
|     public override string ToString() | ||||
|     { | ||||
|         string result = JsonSerializer.Serialize(this, new JsonSerializerOptions() { WriteIndented = true }); | ||||
|         string result = JsonSerializer.Serialize(this, AppSettingsSourceGenerationContext.Default.AppSettings); | ||||
|         return result; | ||||
|     } | ||||
|  | ||||
|     private static void Verify(AppSettings appSettings) | ||||
|     { | ||||
|         if (string.IsNullOrEmpty(appSettings.Company)) | ||||
|             throw new Exception("Company name must have a value!"); | ||||
|         if (string.IsNullOrEmpty(appSettings.WorkingDirectoryName)) | ||||
|             throw new Exception("Working directory name must have a value!"); | ||||
|     } | ||||
|  | ||||
|     public static AppSettings Get(IConfigurationRoot configurationRoot) | ||||
|     { | ||||
|         AppSettings result; | ||||
|         AppSettings? appSettings = configurationRoot.Get<AppSettings>(); | ||||
| #pragma warning restore IL3050, IL2026 | ||||
|         if (appSettings is null | ||||
|             || appSettings?.Company is null) | ||||
|         { | ||||
|             List<string> paths = []; | ||||
|             foreach (IConfigurationProvider configurationProvider in configurationRoot.Providers) | ||||
|             { | ||||
|                 if (configurationProvider is not Microsoft.Extensions.Configuration.Json.JsonConfigurationProvider jsonConfigurationProvider) | ||||
|                     continue; | ||||
|                 if (jsonConfigurationProvider.Source.FileProvider is not Microsoft.Extensions.FileProviders.PhysicalFileProvider physicalFileProvider) | ||||
|                     continue; | ||||
|                 paths.Add(physicalFileProvider.Root); | ||||
|             } | ||||
|             throw new NotSupportedException($"Not found!{Environment.NewLine}{string.Join(Environment.NewLine, paths.Distinct())}"); | ||||
|         } | ||||
|         result = new(appSettings.BuildNumber, | ||||
|                      appSettings.Company, | ||||
|                      appSettings.EcCharacterizationSi, | ||||
|                      appSettings.EcMesaFileShareCharacterizationSi, | ||||
|                      appSettings.GitCommitSeven, | ||||
|                      appSettings.IsDevelopment, | ||||
|                      appSettings.IsStaging, | ||||
|                      appSettings.MockRoot, | ||||
|                      appSettings.MonAResource, | ||||
|                      appSettings.MonASite, | ||||
|                      appSettings.URLs, | ||||
|                      appSettings.WaferCounterDestinationDirectory, | ||||
|                      appSettings.WaferCounterTwoFileSecondsWait, | ||||
|                      appSettings.WorkingDirectoryName); | ||||
|         Verify(result); | ||||
|         return result; | ||||
|     } | ||||
|  | ||||
| } | ||||
|  | ||||
| [JsonSourceGenerationOptions(WriteIndented = true)] | ||||
| [JsonSerializable(typeof(AppSettings))] | ||||
| public partial class AppSettingsSourceGenerationContext : JsonSerializerContext | ||||
| { | ||||
| } | ||||
| @ -1,2 +0,0 @@ | ||||
| [*.cs] | ||||
| csharp_preserve_single_line_statements = true | ||||
| @ -1,99 +0,0 @@ | ||||
| using System.Text.Json; | ||||
| using System.Text.Json.Serialization; | ||||
|  | ||||
| namespace OI.Metrology.Wafer.Counter.Models.Binder; | ||||
|  | ||||
| public class AppSettings | ||||
| { | ||||
|  | ||||
|     public string? BuildNumber { get; set; } | ||||
|     public string? Company { get; set; } | ||||
|     public string? EcCharacterizationSi { get; set; } | ||||
|     public string? EcMesaFileShareCharacterizationSi { get; set; } | ||||
|     public string? GitCommitSeven { get; set; } | ||||
|     public bool? IsDevelopment { get; set; } | ||||
|     public bool? IsStaging { get; set; } | ||||
|     public string? MockRoot { get; set; } | ||||
|     public string? MonAResource { get; set; } | ||||
|     public string? MonASite { get; set; } | ||||
|     public string? URLs { get; set; } | ||||
|     public string? WaferCounterDestinationDirectory { get; set; } | ||||
|     public int? WaferCounterTwoFileSecondsWait { get; set; } | ||||
|     public string? WorkingDirectoryName { get; set; } | ||||
|  | ||||
|     public override string ToString() | ||||
|     { | ||||
|         string result = JsonSerializer.Serialize(this, new JsonSerializerOptions() { WriteIndented = true }); | ||||
|         return result; | ||||
|     } | ||||
|  | ||||
|     private static void PreVerify(IConfigurationRoot configurationRoot, AppSettings? appSettings) | ||||
|     { | ||||
|         if (appSettings?.Company is null) | ||||
|         { | ||||
|             List<string> paths = new(); | ||||
|             foreach (IConfigurationProvider configurationProvider in configurationRoot.Providers) | ||||
|             { | ||||
|                 if (configurationProvider is not Microsoft.Extensions.Configuration.Json.JsonConfigurationProvider jsonConfigurationProvider) | ||||
|                     continue; | ||||
|                 if (jsonConfigurationProvider.Source.FileProvider is not Microsoft.Extensions.FileProviders.PhysicalFileProvider physicalFileProvider) | ||||
|                     continue; | ||||
|                 paths.Add(physicalFileProvider.Root); | ||||
|             } | ||||
|             throw new NotSupportedException($"Not found!{Environment.NewLine}{string.Join(Environment.NewLine, paths.Distinct())}"); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     private static Models.AppSettings Get(AppSettings? appSettings) | ||||
|     { | ||||
|         Models.AppSettings result; | ||||
|         if (appSettings is null) throw new NullReferenceException(nameof(appSettings)); | ||||
|         if (appSettings.BuildNumber is null) throw new NullReferenceException(nameof(BuildNumber)); | ||||
|         if (appSettings.Company is null) throw new NullReferenceException(nameof(Company)); | ||||
|         if (appSettings.EcCharacterizationSi is null) throw new NullReferenceException(nameof(EcCharacterizationSi)); | ||||
|         if (appSettings.EcMesaFileShareCharacterizationSi is null) throw new NullReferenceException(nameof(EcMesaFileShareCharacterizationSi)); | ||||
|         if (appSettings.GitCommitSeven is null) throw new NullReferenceException(nameof(GitCommitSeven)); | ||||
|         if (appSettings.IsDevelopment is null) throw new NullReferenceException(nameof(IsDevelopment)); | ||||
|         if (appSettings.IsStaging is null) throw new NullReferenceException(nameof(IsStaging)); | ||||
|         if (appSettings.MockRoot is null) throw new NullReferenceException(nameof(MockRoot)); | ||||
|         if (appSettings.MonAResource is null) throw new NullReferenceException(nameof(MonAResource)); | ||||
|         if (appSettings.MonASite is null) throw new NullReferenceException(nameof(MonASite)); | ||||
|         if (appSettings.URLs is null) throw new NullReferenceException(nameof(URLs)); | ||||
|         if (appSettings.WaferCounterDestinationDirectory is null) throw new NullReferenceException(nameof(WaferCounterDestinationDirectory)); | ||||
|         if (appSettings.WaferCounterTwoFileSecondsWait is null) throw new NullReferenceException(nameof(WaferCounterTwoFileSecondsWait)); | ||||
|         if (appSettings.WorkingDirectoryName is null) throw new NullReferenceException(nameof(WorkingDirectoryName)); | ||||
|         result = new(appSettings.BuildNumber, | ||||
|                      appSettings.Company, | ||||
|                      appSettings.EcCharacterizationSi, | ||||
|                      appSettings.EcMesaFileShareCharacterizationSi, | ||||
|                      appSettings.GitCommitSeven, | ||||
|                      appSettings.IsDevelopment.Value, | ||||
|                      appSettings.IsStaging.Value, | ||||
|                      appSettings.MockRoot, | ||||
|                      appSettings.MonAResource, | ||||
|                      appSettings.MonASite, | ||||
|                      appSettings.URLs, | ||||
|                      appSettings.WaferCounterDestinationDirectory, | ||||
|                      appSettings.WaferCounterTwoFileSecondsWait.Value, | ||||
|                      appSettings.WorkingDirectoryName); | ||||
|         return result; | ||||
|     } | ||||
|  | ||||
|     public static Models.AppSettings Get(IConfigurationRoot configurationRoot) | ||||
|     { | ||||
|         Models.AppSettings result; | ||||
| #pragma warning disable IL3050, IL2026 | ||||
|         AppSettings? appSettings = configurationRoot.Get<AppSettings>(); | ||||
| #pragma warning restore IL3050, IL2026 | ||||
|         PreVerify(configurationRoot, appSettings); | ||||
|         result = Get(appSettings); | ||||
|         return result; | ||||
|     } | ||||
|  | ||||
| } | ||||
|  | ||||
| [JsonSourceGenerationOptions(WriteIndented = true)] | ||||
| [JsonSerializable(typeof(AppSettings))] | ||||
| internal partial class BinderAppSettingsSourceGenerationContext : JsonSerializerContext | ||||
| { | ||||
| } | ||||
| @ -19,17 +19,17 @@ | ||||
|         <PackageReference Include="Dapper" Version="2.1.44" /> | ||||
|         <PackageReference Include="EntityFramework" Version="6.5.1" /> | ||||
|         <PackageReference Include="jQuery" Version="3.7.1" /> | ||||
|         <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.8" /> | ||||
|         <PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="8.0.0" /> | ||||
|         <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" /> | ||||
|         <PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.0" /> | ||||
|         <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" /> | ||||
|         <PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="8.0.0" /> | ||||
|         <PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" /> | ||||
|         <PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" /> | ||||
|         <PackageReference Include="Microsoft.Extensions.Logging.EventLog" Version="8.0.0" /> | ||||
|         <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.10" /> | ||||
|         <PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="8.0.1" /> | ||||
|         <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.1" /> | ||||
|         <PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.1" /> | ||||
|         <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1" /> | ||||
|         <PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="8.0.1" /> | ||||
|         <PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.1" /> | ||||
|         <PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.1" /> | ||||
|         <PackageReference Include="Microsoft.Extensions.Logging.EventLog" Version="8.0.1" /> | ||||
|         <PackageReference Include="Newtonsoft.Json" Version="13.0.3" /> | ||||
|         <PackageReference Include="Swashbuckle.AspNetCore" Version="6.7.3" /> | ||||
|         <PackageReference Include="Swashbuckle.AspNetCore" Version="6.8.1" /> | ||||
|         <PackageReference Include="System.Data.SqlClient" Version="4.8.6" /> | ||||
|     </ItemGroup> | ||||
|     <ItemGroup> | ||||
|  | ||||
| @ -14,11 +14,7 @@ public class Program | ||||
|         ILogger<Program>? logger = null; | ||||
|         WebApplicationBuilder webApplicationBuilder = WebApplication.CreateBuilder(args); | ||||
|         _ = webApplicationBuilder.Configuration.AddUserSecrets<Program>(); | ||||
|         AppSettings appSettings = Models.Binder.AppSettings.Get(webApplicationBuilder.Configuration); | ||||
|         if (string.IsNullOrEmpty(appSettings.Company)) | ||||
|             throw new Exception("Company name must have a value!"); | ||||
|         if (string.IsNullOrEmpty(appSettings.WorkingDirectoryName)) | ||||
|             throw new Exception("Working directory name must have a value!"); | ||||
|         AppSettings appSettings = AppSettings.Get(webApplicationBuilder.Configuration); | ||||
|         try | ||||
|         { | ||||
|             _ = webApplicationBuilder.Services.AddMemoryCache(); | ||||
| @ -32,7 +28,7 @@ public class Program | ||||
|             _ = webApplicationBuilder.Services.AddSingleton(_ => appSettings); | ||||
|             _ = webApplicationBuilder.Services.AddSingleton<IFileShareRepository, FileShareRepository>(); | ||||
|             _ = webApplicationBuilder.Services.AddSingleton<IWaferCounterRepository, WaferCounterRepository>(); | ||||
|             _ = webApplicationBuilder.Services.AddSingleton<IAppSettingsRepository<Models.Binder.AppSettings>>(_ => appSettingsRepository); | ||||
|             _ = webApplicationBuilder.Services.AddSingleton<IAppSettingsRepository<AppSettings>>(_ => appSettingsRepository); | ||||
|  | ||||
|             _ = webApplicationBuilder.Services.AddSwaggerGen(); | ||||
|             _ = webApplicationBuilder.Services.AddSession(sessionOptions => | ||||
|  | ||||
| @ -3,27 +3,18 @@ using OI.Metrology.Shared.Models.Stateless; | ||||
|  | ||||
| namespace OI.Metrology.Wafer.Counter.Repository; | ||||
|  | ||||
| public class AppSettingsRepository : IAppSettingsRepository<Models.Binder.AppSettings> | ||||
| public class AppSettingsRepository : IAppSettingsRepository<AppSettings> | ||||
| { | ||||
|  | ||||
|     private readonly AppSettings _AppSettings; | ||||
|  | ||||
|     public AppSettingsRepository(AppSettings appSettings) => _AppSettings = appSettings; | ||||
|     public AppSettingsRepository(AppSettings appSettings) => | ||||
|         _AppSettings = appSettings; | ||||
|  | ||||
|     internal Models.Binder.AppSettings GetAppSettings() | ||||
|     { | ||||
|         Models.Binder.AppSettings result = new() | ||||
|         { | ||||
|             BuildNumber = _AppSettings.BuildNumber, | ||||
|             Company = _AppSettings.Company, | ||||
|             GitCommitSeven = _AppSettings.GitCommitSeven, | ||||
|             IsDevelopment = _AppSettings.IsDevelopment, | ||||
|             IsStaging = _AppSettings.IsStaging, | ||||
|         }; | ||||
|         return result; | ||||
|     } | ||||
|     internal AppSettings GetAppSettings() => | ||||
|         _AppSettings; | ||||
|  | ||||
|     Models.Binder.AppSettings IAppSettingsRepository<Models.Binder.AppSettings>.GetAppSettings() => GetAppSettings(); | ||||
|     AppSettings IAppSettingsRepository<AppSettings>.GetAppSettings() => GetAppSettings(); | ||||
|  | ||||
|     internal string GetBuildNumberAndGitCommitSeven() | ||||
|     { | ||||
| @ -31,10 +22,10 @@ public class AppSettingsRepository : IAppSettingsRepository<Models.Binder.AppSet | ||||
|         return result; | ||||
|     } | ||||
|  | ||||
|     string IAppSettingsRepository<Models.Binder.AppSettings>.GetBuildNumberAndGitCommitSeven() => | ||||
|     string IAppSettingsRepository<AppSettings>.GetBuildNumberAndGitCommitSeven() => | ||||
|         GetBuildNumberAndGitCommitSeven(); | ||||
|  | ||||
|     void IAppSettingsRepository<Models.Binder.AppSettings>.VerifyConnectionStrings() => | ||||
|     void IAppSettingsRepository<AppSettings>.VerifyConnectionStrings() => | ||||
|         throw new NotImplementedException(); | ||||
|  | ||||
| } | ||||
| @ -1,3 +1,4 @@ | ||||
| using OI.Metrology.Shared.DataModels; | ||||
| using OI.Metrology.Shared.Models; | ||||
| using OI.Metrology.Shared.Models.Stateless; | ||||
| using OI.Metrology.Wafer.Counter.Models; | ||||
| @ -82,7 +83,7 @@ public class FileShareRepository : IFileShareRepository | ||||
|         return result; | ||||
|     } | ||||
|  | ||||
|     List<NginxFileSystemSortable> IFileShareRepository.GetNginxFileSystemSortableCollection(HttpClient httpClient, Uri uri, string? endsWith) | ||||
|     ReadOnlyCollection<NginxFileSystemSortable> IFileShareRepository.GetNginxFileSystemSortableCollection(HttpClient httpClient, Uri uri, string[] endsWithCollection) | ||||
|     { | ||||
|         List<NginxFileSystemSortable> results = new(); | ||||
|         Task<HttpResponseMessage> httpResponseMessage = httpClient.GetAsync(uri); | ||||
| @ -96,12 +97,12 @@ public class FileShareRepository : IFileShareRepository | ||||
|             List<NginxFileSystemSortable> nginxFileSystemSortableCollection = NginxFileSystemSortable.Convert(fileShareRepository, uri, nginxFileSystemCollection); | ||||
|             foreach (NginxFileSystemSortable nginxFileSystemSortable in nginxFileSystemSortableCollection.OrderByDescending(l => l.DateTime)) | ||||
|             { | ||||
|                 if (!string.IsNullOrEmpty(endsWith) && !nginxFileSystemSortable.Name.EndsWith(endsWith)) | ||||
|                 if (!endsWithCollection.Any(l => !string.IsNullOrEmpty(nginxFileSystemSortable.Name) && nginxFileSystemSortable.Name.EndsWith(l))) | ||||
|                     continue; | ||||
|                 results.Add(nginxFileSystemSortable); | ||||
|             } | ||||
|         } | ||||
|         return results; | ||||
|         return new(results); | ||||
|     } | ||||
|  | ||||
|     private static ReadOnlyCollection<string> GetValidDirectories(string equipmentDirectory, DateTime startDateTime, DateTime endDateTime) | ||||
| @ -121,27 +122,31 @@ public class FileShareRepository : IFileShareRepository | ||||
|         return new(results); | ||||
|     } | ||||
|  | ||||
|     private static ReadOnlyCollection<FileInfo> GetCollection(CharacterizationParameters characterizationParameters, string searchPattern, DateTime startDateTime, DateTime endDateTime, ReadOnlyCollection<string> validDirectories) | ||||
|     private static ReadOnlyCollection<string> GetFiles(CharacterizationParameters characterizationParameters, string equipmentDirectory, DateTime startDateTime, DateTime endDateTime, ReadOnlyCollection<string> validDirectories) | ||||
|     { | ||||
|         FileInfo[] results; | ||||
|         List<string> results = []; | ||||
|         string[] directories; | ||||
|         List<FileInfo> collection = []; | ||||
|         SearchOption searchOption; | ||||
|         string startDateTimeTicks = startDateTime.Ticks.ToString(); | ||||
|         string delta = (endDateTime.Ticks - startDateTime.Ticks).ToString(); | ||||
|         string ticksSearchPattern = $"{startDateTime.Ticks.ToString()[..(startDateTimeTicks.Length - delta.Length + 1)]}*"; | ||||
|         string ticksSearchPattern = $"{startDateTime.Ticks.ToString()[..(startDateTimeTicks.Length - delta.Length - 1)]}*"; | ||||
|         foreach (string validDirectory in validDirectories) | ||||
|         { | ||||
|             if (string.IsNullOrEmpty(validDirectory) || !Directory.Exists(validDirectory)) | ||||
|             if (string.IsNullOrEmpty(characterizationParameters.SearchPattern) || string.IsNullOrEmpty(validDirectory) || !Directory.Exists(validDirectory)) | ||||
|                 continue; | ||||
|             if (characterizationParameters.SearchPattern is null || searchPattern == characterizationParameters.SearchPattern) | ||||
|                 collection.AddRange(Directory.GetFiles(validDirectory, searchPattern, SearchOption.AllDirectories).Select(l => new FileInfo(l))); | ||||
|             else | ||||
|             { | ||||
|                 directories = Directory.GetDirectories(validDirectory, ticksSearchPattern, SearchOption.AllDirectories); | ||||
|                 foreach (string directory in directories) | ||||
|                     collection.AddRange(Directory.GetFiles(directory, searchPattern, SearchOption.TopDirectoryOnly).Select(l => new FileInfo(l))); | ||||
|             } | ||||
|             searchOption = validDirectory == equipmentDirectory ? SearchOption.TopDirectoryOnly : SearchOption.AllDirectories; | ||||
|             directories = Directory.GetDirectories(validDirectory, ticksSearchPattern, searchOption); | ||||
|             foreach (string directory in directories) | ||||
|                 results.AddRange(Directory.GetFiles(directory, characterizationParameters.SearchPattern, SearchOption.TopDirectoryOnly)); | ||||
|         } | ||||
|         return new(results); | ||||
|     } | ||||
|  | ||||
|     private static ReadOnlyCollection<FileInfo> GetCollection(CharacterizationParameters characterizationParameters, string equipmentDirectory, DateTime startDateTime, DateTime endDateTime, ReadOnlyCollection<string> validDirectories) | ||||
|     { | ||||
|         FileInfo[] results; | ||||
|         ReadOnlyCollection<string> files = GetFiles(characterizationParameters, equipmentDirectory, startDateTime, endDateTime, validDirectories); | ||||
|         FileInfo[] collection = files.Select(l => new FileInfo(l)).ToArray(); | ||||
|         results = (from l in collection where l.LastWriteTime >= startDateTime && l.LastWriteTime <= endDateTime orderby l.LastWriteTime descending select l).ToArray(); | ||||
|         return new(results); | ||||
|     } | ||||
| @ -182,7 +187,7 @@ public class FileShareRepository : IFileShareRepository | ||||
|         return new(results); | ||||
|     } | ||||
|  | ||||
|     private static ReadOnlyCollection<CharacterizationInfo> GetCharacterizationData(CharacterizationParameters characterizationParameters, string equipmentDirectory, string searchPattern) | ||||
|     private static ReadOnlyCollection<CharacterizationInfo> GetCharacterizationData(CharacterizationParameters characterizationParameters, string equipmentDirectory) | ||||
|     { | ||||
|         List<CharacterizationInfo> results = []; | ||||
|         string[] lines; | ||||
| @ -193,7 +198,7 @@ public class FileShareRepository : IFileShareRepository | ||||
|         DateTime endDateTime = characterizationParameters.EndTime is null ? DateTime.Now : DateTime.Parse(characterizationParameters.EndTime).ToLocalTime(); | ||||
|         DateTime startDateTime = characterizationParameters.StartTime is null ? DateTime.Now.AddHours(-6) : DateTime.Parse(characterizationParameters.StartTime).ToLocalTime(); | ||||
|         ReadOnlyCollection<string> validDirectories = GetValidDirectories(equipmentDirectory, startDateTime, endDateTime); | ||||
|         ReadOnlyCollection<FileInfo> collection = GetCollection(characterizationParameters, searchPattern, startDateTime, endDateTime, validDirectories); | ||||
|         ReadOnlyCollection<FileInfo> collection = GetCollection(characterizationParameters, equipmentDirectory, startDateTime, endDateTime, validDirectories); | ||||
|         foreach (FileInfo fileInfo in collection) | ||||
|         { | ||||
|             if (string.IsNullOrEmpty(fileInfo.DirectoryName)) | ||||
| @ -218,24 +223,40 @@ public class FileShareRepository : IFileShareRepository | ||||
|         return new(results); | ||||
|     } | ||||
|  | ||||
|     List<CharacterizationInfo> IFileShareRepository.GetArchiveData(CharacterizationParameters characterizationParameters) | ||||
|     ReadOnlyCollection<CharacterizationInfo> IFileShareRepository.GetArchiveData(CharacterizationParameters characterizationParameters) | ||||
|     { | ||||
|         List<CharacterizationInfo> results = []; | ||||
|         string searchPattern; | ||||
|         string equipmentDirectory; | ||||
|         if (!string.IsNullOrEmpty(characterizationParameters.Area) && !string.IsNullOrEmpty(characterizationParameters.WaferSize)) | ||||
|         { | ||||
|             searchPattern = characterizationParameters.SearchPattern is null ? "*" : characterizationParameters.SearchPattern; | ||||
|             equipmentDirectory = Path.Combine(_AppSettings.EcCharacterizationSi, "WaferCounter", characterizationParameters.Area, characterizationParameters.WaferSize); | ||||
|             if (Directory.Exists(equipmentDirectory)) | ||||
|                 results.AddRange(GetCharacterizationData(characterizationParameters, equipmentDirectory, searchPattern)); | ||||
|                 results.AddRange(GetCharacterizationData(characterizationParameters, equipmentDirectory)); | ||||
|         } | ||||
|         if (!string.IsNullOrEmpty(characterizationParameters.EquipmentId)) | ||||
|         { | ||||
|             searchPattern = "*.json"; | ||||
|             equipmentDirectory = Path.Combine(_AppSettings.EcCharacterizationSi, "Archive", characterizationParameters.EquipmentId); | ||||
|             if (Directory.Exists(equipmentDirectory)) | ||||
|                 results.AddRange(GetCharacterizationData(characterizationParameters, equipmentDirectory, searchPattern)); | ||||
|                 results.AddRange(GetCharacterizationData(characterizationParameters, equipmentDirectory)); | ||||
|         } | ||||
|         return new(results); | ||||
|     } | ||||
|  | ||||
|     ReadOnlyCollection<ToolTypeNameId> IFileShareRepository.GetEquipmentIds() | ||||
|     { | ||||
|         List<ToolTypeNameId> results = []; | ||||
|         string directoryName; | ||||
|         ToolTypeNameId toolTypeNameId; | ||||
|         string archiveDirectory = Path.Combine(_AppSettings.EcCharacterizationSi, "Archive"); | ||||
|         string[] directories = Directory.GetDirectories(archiveDirectory, "*", SearchOption.TopDirectoryOnly); | ||||
|         string[] fileNames = Directory.GetFiles(archiveDirectory, "*.json", SearchOption.TopDirectoryOnly).Select(l => Path.GetFileNameWithoutExtension(l)).ToArray(); | ||||
|         for (int i = 0; i < directories.Length; i++) | ||||
|         { | ||||
|             directoryName = Path.GetFileName(directories[i]); | ||||
|             if (!fileNames.Contains(directoryName)) | ||||
|                 continue; | ||||
|             toolTypeNameId = new() { ID = i, ToolTypeName = directoryName }; | ||||
|             results.Add(toolTypeNameId); | ||||
|         } | ||||
|         return new(results); | ||||
|     } | ||||
|  | ||||
| @ -1,7 +1,9 @@ | ||||
| using OI.Metrology.Shared.DataModels; | ||||
| using OI.Metrology.Shared.Models; | ||||
| using OI.Metrology.Shared.Models.Stateless; | ||||
| using OI.Metrology.Wafer.Counter.Helper; | ||||
| using OI.Metrology.Wafer.Counter.Models; | ||||
| using System.Collections.ObjectModel; | ||||
| using System.Globalization; | ||||
| using System.Text.Json; | ||||
| using System.Text.RegularExpressions; | ||||
| @ -32,17 +34,25 @@ public class WaferCounterRepository : IWaferCounterRepository | ||||
|         _RepositoryName = nameof(WaferCounterRepository)[..^10]; | ||||
|     } | ||||
|  | ||||
|     private void MoveFile(string area, string waferSize, string windowsFileSystemSafeText, string waferSizeDirectory, NginxFileSystemSortable nginxFileSystemSortable) | ||||
|     private void MoveFile(string area, string waferSize, WaferCounter? waferCounter, string windowsFileSystemSafeText, string waferSizeDirectory, NginxFileSystemSortable nginxFileSystemSortable) | ||||
|     { | ||||
|         string equipmentId = $"{area}-{waferSize}"; | ||||
|         WaferCounterArchive waferCounterArchive = new() | ||||
|         { | ||||
|             Date = nginxFileSystemSortable.DateTime, | ||||
|             MesEntity = equipmentId, | ||||
|             RDS = windowsFileSystemSafeText, | ||||
|             SlotMap = waferCounter?.SlotMap, | ||||
|             Text = waferCounter?.Text, | ||||
|             Total = waferCounter?.Total, | ||||
|         }; | ||||
|         Calendar calendar = new CultureInfo("en-US").Calendar; | ||||
|         string from = Path.Combine(waferSizeDirectory, nginxFileSystemSortable.Name); | ||||
|         string archive = Path.Combine(_AppSettings.EcCharacterizationSi, "Archive", equipmentId); | ||||
|         HeaderCommon headerCommon = new() { RDS = windowsFileSystemSafeText, MesEntity = equipmentId }; | ||||
|         string weekOfYear = $"{nginxFileSystemSortable.DateTime:yyyy}_Week_{calendar.GetWeekOfYear(nginxFileSystemSortable.DateTime, CalendarWeekRule.FirstDay, DayOfWeek.Sunday):00}"; | ||||
|         string directory = Path.Combine(archive, weekOfYear, nginxFileSystemSortable.DateTime.ToString("yyyy-MM-dd"), windowsFileSystemSafeText); | ||||
|         string file = Path.Combine(directory, nginxFileSystemSortable.DateTime.Ticks.ToString(), $"{nginxFileSystemSortable.Name}.json"); | ||||
|         string json = JsonSerializer.Serialize(headerCommon, new JsonSerializerOptions() { WriteIndented = true }); | ||||
|         string json = JsonSerializer.Serialize(waferCounterArchive, WaferCounterArchiveSourceGenerationContext.Default.WaferCounterArchive); | ||||
|         _FileShareRepository.FileWrite(file, json); | ||||
|         string to = Path.Combine(directory, nginxFileSystemSortable.Name); | ||||
|         _FileShareRepository.MoveFile(from, to); | ||||
| @ -145,10 +155,13 @@ public class WaferCounterRepository : IWaferCounterRepository | ||||
|     { | ||||
|         List<NginxFileSystemSortable> results = new(); | ||||
|         DateTime dateTime = DateTime.Now; | ||||
|         string[] endsWithCollection = [".wc", ".pdsf"]; | ||||
|         ReadOnlyCollection<NginxFileSystemSortable> collection; | ||||
|         long ticks = dateTime.AddSeconds(_AppSettings.WaferCounterTwoFileSecondsWait).Ticks; | ||||
|         for (int i = 0; i < int.MaxValue; i++) | ||||
|         { | ||||
|             results = _FileShareRepository.GetNginxFileSystemSortableCollection(httpClient, waferSizeUri, ".wc"); | ||||
|             collection = _FileShareRepository.GetNginxFileSystemSortableCollection(httpClient, waferSizeUri, endsWithCollection); | ||||
|             results.AddRange(collection); | ||||
|             if (results.Count > 0 || DateTime.Now.Ticks > ticks) | ||||
|                 break; | ||||
|             Thread.Sleep(250); | ||||
| @ -156,20 +169,35 @@ public class WaferCounterRepository : IWaferCounterRepository | ||||
|         return results; | ||||
|     } | ||||
|  | ||||
|     private static WaferCounter? GetLastQuantityAndSlotMap(string waferSize, HttpClient httpClient, NginxFileSystemSortable nginxFileSystemSortable) | ||||
|     private static WaferCounter? GetLastQuantityAndSlotMap(string area, string waferSize, HttpClient httpClient, NginxFileSystemSortable nginxFileSystemSortable) | ||||
|     { | ||||
|         WaferCounter? result; | ||||
|         Task<string> value = httpClient.GetStringAsync(nginxFileSystemSortable.Uri); | ||||
|         value.Wait(); | ||||
|         string? line1; | ||||
|         string? line2; | ||||
|         string[] lines = value.Result.Split("\r\n"); | ||||
|         if (lines.Length < 3) | ||||
|         if (nginxFileSystemSortable.Name.EndsWith(".wc") && lines.Length > 2) | ||||
|         { | ||||
|             line1 = lines[^3]; | ||||
|             line2 = lines[^2]; | ||||
|         } | ||||
|         else if (nginxFileSystemSortable.Name.EndsWith(".pdsf") && lines.Length > 14) | ||||
|         { | ||||
|             line1 = lines[7].Split('\t')[^1]; | ||||
|             line2 = lines[8].Split('\t')[^1]; | ||||
|         } | ||||
|         else | ||||
|         { | ||||
|             line1 = null; | ||||
|             line2 = null; | ||||
|         } | ||||
|         if (string.IsNullOrEmpty(line1) || string.IsNullOrEmpty(line2)) | ||||
|             result = WaferCounter.GetWaferCounter("Incomplete file length!"); | ||||
|         else | ||||
|         { | ||||
|             string text = string.Empty; | ||||
|             string[] segments = nginxFileSystemSortable.Name.Split('-'); | ||||
|             Record record = GetRecord(lines[^3], lines[^2]); | ||||
|             string equipmentId = segments.Length <= 1 ? nginxFileSystemSortable.Name : segments[1].Split('.')[0]; | ||||
|             Record record = GetRecord(line1, line2); | ||||
|             if (string.IsNullOrEmpty(record.SlotMap) || record.SlotMap.Length != 25) | ||||
|                 result = WaferCounter.GetWaferCounter("Wrong length for slot-map!"); | ||||
|             else | ||||
| @ -177,7 +205,13 @@ public class WaferCounterRepository : IWaferCounterRepository | ||||
|                 if (record.Total != record.Check) | ||||
|                     result = WaferCounter.GetWaferCounter($"Checksum has failed. {record.Total} != {record.Check}"); | ||||
|                 else | ||||
|                     result = new(nginxFileSystemSortable.DateTime, nginxFileSystemSortable.DateTime.ToString("yyyy-MM-dd hh:mm tt"), $"WC{waferSize}{equipmentId}", string.Empty, text, record.Total, record.SlotMap); | ||||
|                     result = new(DateTime: nginxFileSystemSortable.DateTime, | ||||
|                                  DateTimeFormatted: nginxFileSystemSortable.DateTime.ToString("yyyy-MM-dd hh:mm tt"), | ||||
|                                  EquipmentId: $"{area}-{waferSize}", | ||||
|                                  Message: string.Empty, | ||||
|                                  Text: text, | ||||
|                                  Total: record.Total, | ||||
|                                  SlotMap: record.SlotMap); | ||||
|             } | ||||
|         } | ||||
|         return result; | ||||
| @ -195,9 +229,9 @@ public class WaferCounterRepository : IWaferCounterRepository | ||||
|         else | ||||
|         { | ||||
|             string windowsFileSystemSafeText = _Regex.Replace(text, "."); | ||||
|             result = GetLastQuantityAndSlotMap(waferSize, httpClient, nginxFileSystemSortableCollection[0]); | ||||
|             result = GetLastQuantityAndSlotMap(area, waferSize, httpClient, nginxFileSystemSortableCollection[0]); | ||||
|             for (int i = 0; i < nginxFileSystemSortableCollection.Count; i++) | ||||
|                 MoveFile(area, waferSize, windowsFileSystemSafeText, waferSizeDirectory, nginxFileSystemSortableCollection[i]); | ||||
|                 MoveFile(area, waferSize, result, windowsFileSystemSafeText, waferSizeDirectory, nginxFileSystemSortableCollection[i]); | ||||
|         } | ||||
|         return result; | ||||
|     } | ||||
|  | ||||
							
								
								
									
										199
									
								
								Wafer-Counter/wafer-counter-pipeline.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										199
									
								
								Wafer-Counter/wafer-counter-pipeline.yml
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,199 @@ | ||||
| trigger: | ||||
|   branches: | ||||
|     include: | ||||
|       - master | ||||
|   paths: | ||||
|     include: | ||||
|       - Wafer-Counter | ||||
|  | ||||
| variables: | ||||
|   runtime: 'win-x64' | ||||
|   coreVersion: 'net8.0' | ||||
|   nugetSource: 'https://artifactory.intra.infineon.com/artifactory/api/nuget/ngt-fi-package-main-vir/' | ||||
|  | ||||
| stages: | ||||
|   - stage: Development | ||||
|     displayName: Development | ||||
|     pool: | ||||
|       name: 'OpenInsight Metrology Viewer' | ||||
|       demands: OpenInsight-Metrology-Viewer-Wafer-Counter-Development | ||||
|     variables: | ||||
|       ASPNETCORE_ENVIRONMENT: 'Development' | ||||
|       assemblyTitle: 'OI.Metrology.Wafer.Counter' | ||||
|       configuration: 'Debug' | ||||
|       userSecretsId: '2a0acd34-8f61-47a3-8818-73fa8fe04902' | ||||
|     jobs: | ||||
|       - job: DebugDotnet | ||||
|         steps: | ||||
|           - script: | | ||||
|               echo Assembly Title: $(AssemblyTitle) | ||||
|               echo Build Id: $(Build.BuildId) | ||||
|               echo Build Reason: $(Build.Reason) | ||||
|               echo Repo Id: $(Build.Repository.Id) | ||||
|               echo Repo Name: $(Build.Repository.Name) | ||||
|               echo Source Version: $(Build.SourceVersion) | ||||
|               echo Configuration: $(Configuration) | ||||
|               echo Core Version: $(CoreVersion) | ||||
|               echo Nuget Source: $(NugetSource) | ||||
|               echo Runtime: $(Runtime) | ||||
|               echo UserSecretsId: $(UserSecretsId) | ||||
|             displayName: 'Echo Check' | ||||
|  | ||||
|           - script: | | ||||
|               dotnet user-secrets init | ||||
|               dotnet user-secrets set BuildNumber $(Build.BuildId) | ||||
|               dotnet user-secrets set GitCommit $(Build.SourceVersion) | ||||
|               dotnet user-secrets list | ||||
|             workingDirectory: Wafer-Counter | ||||
|             displayName: 'App - Safe storage of app secrets' | ||||
|  | ||||
|           - script: dotnet build --configuration $(Configuration) --source $(NugetSource) | ||||
|             workingDirectory: Wafer-Counter | ||||
|             displayName: 'App - Build' | ||||
|  | ||||
|           - script: dotnet build --configuration $(Configuration) --source $(NugetSource) | ||||
|             workingDirectory: Tests | ||||
|             displayName: 'Tests - Build' | ||||
|  | ||||
|           - script: dotnet test --configuration $(Configuration) | ||||
|             workingDirectory: Tests | ||||
|             displayName: 'Tests - Test' | ||||
|  | ||||
|           - script: dotnet publish --configuration $(Configuration) --runtime $(Runtime) --self-contained | ||||
|             workingDirectory: Wafer-Counter | ||||
|             displayName: 'App - Publish' | ||||
|  | ||||
|           - script: dotnet publish --configuration $(Configuration) --runtime $(Runtime) -p:PublishAot=true | ||||
|             workingDirectory: Wafer-Counter | ||||
|             displayName: 'App - AOT Publish' | ||||
|             enabled: false | ||||
|  | ||||
|           - task: CopyFiles@2 | ||||
|             displayName: 'Copy Files to: D:\' | ||||
|             inputs: | ||||
|               Contents: '*' | ||||
|               SourceFolder: 'Wafer-Counter\bin\$(Configuration)\$(CoreVersion)\$(Runtime)\publish' | ||||
|               TargetFolder: 'D:\$(CoreVersion)\$(Runtime)\$(Build.Repository.Name)\$(Configuration)\$(Build.BuildId)\$(AssemblyTitle)' | ||||
|               OverWrite: true | ||||
|  | ||||
|           - script: dotnet clean --configuration $(Configuration) | ||||
|             workingDirectory: Tests | ||||
|             displayName: 'Tests - Clean' | ||||
|  | ||||
|           - script: dotnet clean --configuration $(Configuration) | ||||
|             workingDirectory: Wafer-Counter | ||||
|             displayName: 'App - Clean' | ||||
|  | ||||
|           - script: C:/Windows/system32/inetsrv/appcmd.exe stop apppool /apppool.name:$(AssemblyTitle).$(Configuration) | ||||
|             workingDirectory: Wafer-Counter | ||||
|             displayName: 'Stop Pool' | ||||
|             continueOnError: true | ||||
|  | ||||
|           - script: C:/Windows/system32/inetsrv/appcmd.exe stop site /site.name:$(AssemblyTitle).$(Configuration) | ||||
|             workingDirectory: Wafer-Counter | ||||
|             displayName: 'Stop Website' | ||||
|             continueOnError: true | ||||
|  | ||||
|           - script: rmdir "D:\web-sites\$(AssemblyTitle).$(Configuration)" | ||||
|             workingDirectory: Wafer-Counter | ||||
|             displayName: 'Remove MKLink' | ||||
|             continueOnError: true | ||||
|  | ||||
|           - script: mklink /J "D:\web-sites\$(AssemblyTitle).$(Configuration)" "D:\$(CoreVersion)\$(Runtime)\$(Build.Repository.Name)\$(Configuration)\$(Build.BuildId)\$(AssemblyTitle)" | ||||
|             workingDirectory: Wafer-Counter | ||||
|             displayName: 'Create MKLink' | ||||
|  | ||||
|           - script: mkdir "D:\web-sites\$(AssemblyTitle).$(Configuration)\$(AssemblyTitle).$(Configuration)" | ||||
|             workingDirectory: Wafer-Counter | ||||
|             displayName: 'Make Directory' | ||||
|             continueOnError: true | ||||
|  | ||||
|           - script: (robocopy /E /IS /IT /IM "%USERPROFILE%/AppData/Roaming/Microsoft/UserSecrets/$(UserSecretsId)" "D:\$(CoreVersion)\$(Runtime)\$(Build.Repository.Name)\$(Configuration)\$(Build.BuildId)\$(AssemblyTitle)" secrets.json) ^& IF %ERRORLEVEL% LEQ 7 exit 0 | ||||
|             workingDirectory: Wafer-Counter | ||||
|             displayName: 'Replace User Secrets Id File' | ||||
|  | ||||
|           - script: (robocopy /E /IS /IT /IM "%USERPROFILE%/AppData/Roaming/Microsoft/UserSecrets/$(UserSecretsId)" "D:\$(CoreVersion)\$(Runtime)\$(Build.Repository.Name)\$(Configuration)\$(Build.BuildId)\$(AssemblyTitle)" web.config) ^& IF %ERRORLEVEL% LEQ 7 exit 0 | ||||
|             workingDirectory: Wafer-Counter | ||||
|             displayName: 'Replace Web Configuration File' | ||||
|  | ||||
|           - script: C:/Windows/system32/inetsrv/appcmd.exe start apppool /apppool.name:$(AssemblyTitle).$(Configuration) | ||||
|             workingDirectory: Wafer-Counter | ||||
|             displayName: 'Start Pool' | ||||
|  | ||||
|           - script: C:/Windows/system32/inetsrv/appcmd.exe start site /site.name:$(AssemblyTitle).$(Configuration) | ||||
|             workingDirectory: Wafer-Counter | ||||
|             displayName: 'Start Website' | ||||
|  | ||||
|   - stage: Release | ||||
|     displayName: Release | ||||
|     pool: | ||||
|       name: 'OpenInsight Metrology Viewer' | ||||
|       demands: OpenInsight-Metrology-Viewer-Wafer-Counter | ||||
|     variables: | ||||
|       ASPNETCORE_ENVIRONMENT: 'Production' | ||||
|       assemblyTitle: 'OI.Metrology.Wafer.Counter' | ||||
|       configuration: 'Release' | ||||
|     jobs: | ||||
|       - job: ReleaseDotnet | ||||
|         steps: | ||||
|           - script: | | ||||
|               echo Assembly Title: $(AssemblyTitle) | ||||
|               echo Build Id: $(Build.BuildId) | ||||
|               echo Build Reason: $(Build.Reason) | ||||
|               echo Repo Id: $(Build.Repository.Id) | ||||
|               echo Repo Name: $(Build.Repository.Name) | ||||
|               echo Source Version: $(Build.SourceVersion) | ||||
|               echo Configuration: $(Configuration) | ||||
|               echo Core Version: $(CoreVersion) | ||||
|               echo Nuget Source: $(NugetSource) | ||||
|               echo Runtime: $(Runtime) | ||||
|             displayName: 'Echo Check' | ||||
|  | ||||
|           - script: | | ||||
|               dotnet user-secrets init | ||||
|               dotnet user-secrets set BuildNumber $(Build.BuildId) | ||||
|               dotnet user-secrets set GitCommit $(Build.SourceVersion) | ||||
|               dotnet user-secrets list | ||||
|             workingDirectory: Wafer-Counter | ||||
|             displayName: 'App - Safe storage of app secrets' | ||||
|  | ||||
|           - script: dotnet build --configuration $(Configuration) --source $(NugetSource) | ||||
|             workingDirectory: Wafer-Counter | ||||
|             displayName: 'App - Build' | ||||
|  | ||||
|           - script: dotnet build --configuration $(Configuration) --source $(NugetSource) | ||||
|             workingDirectory: Tests | ||||
|             displayName: 'Tests - Build' | ||||
|  | ||||
|           - script: dotnet test --configuration $(Configuration) | ||||
|             workingDirectory: Tests | ||||
|             displayName: 'Tests - Test' | ||||
|  | ||||
|           - script: dotnet publish --configuration $(Configuration) --runtime $(Runtime) --self-contained | ||||
|             workingDirectory: Wafer-Counter | ||||
|             displayName: 'App - Publish' | ||||
|  | ||||
|           - script: dotnet publish --configuration $(Configuration) --runtime $(Runtime) -p:PublishAot=true | ||||
|             workingDirectory: Wafer-Counter | ||||
|             displayName: 'App - AOT Publish' | ||||
|             enabled: false | ||||
|  | ||||
|           - task: CopyFiles@2 | ||||
|             displayName: 'Copy Files to: D:\' | ||||
|             inputs: | ||||
|               Contents: '*' | ||||
|               SourceFolder: 'Wafer-Counter\bin\$(Configuration)\$(CoreVersion)\$(Runtime)\publish' | ||||
|               TargetFolder: 'D:\$(CoreVersion)\$(Runtime)\$(Build.Repository.Name)\$(Configuration)\$(Build.BuildId)\$(AssemblyTitle)' | ||||
|               OverWrite: true | ||||
|  | ||||
|           - script: dotnet clean --configuration $(Configuration) | ||||
|             workingDirectory: Tests | ||||
|             displayName: 'Tests - Clean' | ||||
|  | ||||
|           - script: dotnet clean --configuration $(Configuration) | ||||
|             workingDirectory: Wafer-Counter | ||||
|             displayName: 'App - Clean' | ||||
|  | ||||
|           - script: 'echo $(Build.SourceVersion)-$(Build.BuildId)>bin_x_x_\$(Configuration)\$(CoreVersion)\win-x64\$(Build.Repository.Name).txt' | ||||
|             displayName: 'Force Fail' | ||||
|             enabled: false | ||||
		Reference in New Issue
	
	Block a user