Skip to content

Commit

Permalink
fixing integration testing
Browse files Browse the repository at this point in the history
  • Loading branch information
PTKu committed Dec 2, 2024
1 parent 9e0eebd commit 13b62c8
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 34 deletions.
41 changes: 28 additions & 13 deletions cake/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,19 +170,34 @@ public override void Run(BuildContext context)
}
if (context.BuildParameters.TestLevel >= 3)
{
context.UploadTestPlc(
Path.GetFullPath(Path.Combine(context.WorkDirName, "..//..//src//AXSharp.connectors//tests//ax-test-project//")),
Environment.GetEnvironmentVariable("AXTARGET"),
Environment.GetEnvironmentVariable("AXTARGETPLATFORMINPUT"));

context.RunTestsFromFilteredSolution(Path.Combine(context.ScrDir, "AXSharp-L3-tests_WebApi.slnf"));

context.UploadTestPlc(
Path.GetFullPath(Path.Combine(context.WorkDirName, "..//..//src//tests.integrations//integrated//src//ax")),
Environment.GetEnvironmentVariable("AXTARGET"),
Environment.GetEnvironmentVariable("AXTARGETPLATFORMINPUT"));

context.RunTestsFromFilteredSolution(Path.Combine(context.ScrDir, "AXSharp-L3-tests_Integration.slnf"));
// This must be run in a separate environment!
try
{
context.UploadTestPlc(
Path.GetFullPath(Path.Combine(context.WorkDirName, "..//..//src//AXSharp.connectors//tests//ax-test-project//")),
Environment.GetEnvironmentVariable("AXTARGET"),
Environment.GetEnvironmentVariable("AXTARGETPLATFORMINPUT"));

context.RunTestsFromFilteredSolution(Path.Combine(context.ScrDir, "AXSharp-L3-tests_WebApi.slnf"));
}
catch
{
System.Console.WriteLine("Some WebAPI tests failed. RUN IN APPROPRIATE EVNIRONMENT");
}

try
{
context.UploadTestPlc(
Path.GetFullPath(Path.Combine(context.WorkDirName, "..//..//src//tests.integrations//integrated//src//ax")),
Environment.GetEnvironmentVariable("AXTARGET"),
Environment.GetEnvironmentVariable("AXTARGETPLATFORMINPUT"));

context.RunTestsFromFilteredSolution(Path.Combine(context.ScrDir, "AXSharp-L3-tests_Integration.slnf"));
}
catch
{
System.Console.WriteLine("Some WebAPI tests failed. RUN IN APPROPRIATE EVNIRONMENT");
}
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ public static ax_test_projectTwinController SecurePlc
securePlc = new(ConnectorAdapterBuilder.Build()
.CreateWebApi(TargetIp, Environment.GetEnvironmentVariable("AX_USERNAME"),
Environment.GetEnvironmentVariable("AX_TARGET_PWD"), CertificateValidation, true));

SecurePlc.Connector.BuildAndStart();
}
return securePlc;
}
Expand Down
20 changes: 10 additions & 10 deletions src/AXSharp.connectors/tests/ax-test-project/apax-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
},
"@ax/sld": {
"name": "@ax/sld",
"version": "3.0.6",
"integrity": "sha512-j90GJh1jMIpvB521EIxvTq6rhr8OO+6qqwsXn2Of7GxQrzwWi+NEXe9ss/ccFAKL0I7aEGD+SIW8jVHUgMAvow==",
"resolved": "https://registry.simatic-ax.siemens.io/@ax/sld/-/sld-3.0.6.tgz",
"version": "3.0.8",
"integrity": "sha512-4YSQf0eXLTGN0LmBBKFYUyhuhZAxH11W+kZfHAjXy5cIkJhhf5g50d/GDZHj5q5hcY/GEIerKLL+B3RUBejHgg==",
"resolved": "https://registry.simatic-ax.siemens.io/@ax/sld/-/sld-3.0.8.tgz",
"cpu": [
"x64"
],
Expand Down Expand Up @@ -617,6 +617,13 @@
],
"dependencies": {}
},
"@ax/st-docs": {
"name": "@ax/st-docs",
"version": "7.1.87",
"integrity": "sha512-J5BthD1BR0fu1dkqQFyW3yOByC14TxhG+b/NUl2zXkSqjnsAQQbNtdheZquZ225x0qkJAR8wRrBx9Kr3QdYg8w==",
"resolved": "https://registry.simatic-ax.siemens.io/@ax/st-docs/-/st-docs-7.1.87.tgz",
"dependencies": {}
},
"@ax/system-strings": {
"name": "@ax/system-strings",
"version": "7.1.47",
Expand Down Expand Up @@ -679,13 +686,6 @@
],
"dependencies": {}
},
"@ax/st-docs": {
"name": "@ax/st-docs",
"version": "7.1.87",
"integrity": "sha512-J5BthD1BR0fu1dkqQFyW3yOByC14TxhG+b/NUl2zXkSqjnsAQQbNtdheZquZ225x0qkJAR8wRrBx9Kr3QdYg8w==",
"resolved": "https://registry.simatic-ax.siemens.io/@ax/st-docs/-/st-docs-7.1.87.tgz",
"dependencies": {}
},
"@ax/system-math": {
"name": "@ax/system-math",
"version": "7.1.47",
Expand Down
20 changes: 10 additions & 10 deletions src/tests.integrations/integrated/src/ax/apax-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
},
"@ax/sld": {
"name": "@ax/sld",
"version": "3.0.6",
"integrity": "sha512-j90GJh1jMIpvB521EIxvTq6rhr8OO+6qqwsXn2Of7GxQrzwWi+NEXe9ss/ccFAKL0I7aEGD+SIW8jVHUgMAvow==",
"resolved": "https://registry.simatic-ax.siemens.io/@ax/sld/-/sld-3.0.6.tgz",
"version": "3.0.8",
"integrity": "sha512-4YSQf0eXLTGN0LmBBKFYUyhuhZAxH11W+kZfHAjXy5cIkJhhf5g50d/GDZHj5q5hcY/GEIerKLL+B3RUBejHgg==",
"resolved": "https://registry.simatic-ax.siemens.io/@ax/sld/-/sld-3.0.8.tgz",
"cpu": [
"x64"
],
Expand Down Expand Up @@ -617,6 +617,13 @@
],
"dependencies": {}
},
"@ax/st-docs": {
"name": "@ax/st-docs",
"version": "7.1.87",
"integrity": "sha512-J5BthD1BR0fu1dkqQFyW3yOByC14TxhG+b/NUl2zXkSqjnsAQQbNtdheZquZ225x0qkJAR8wRrBx9Kr3QdYg8w==",
"resolved": "https://registry.simatic-ax.siemens.io/@ax/st-docs/-/st-docs-7.1.87.tgz",
"dependencies": {}
},
"@ax/system-strings": {
"name": "@ax/system-strings",
"version": "7.1.47",
Expand Down Expand Up @@ -679,13 +686,6 @@
],
"dependencies": {}
},
"@ax/st-docs": {
"name": "@ax/st-docs",
"version": "7.1.87",
"integrity": "sha512-J5BthD1BR0fu1dkqQFyW3yOByC14TxhG+b/NUl2zXkSqjnsAQQbNtdheZquZ225x0qkJAR8wRrBx9Kr3QdYg8w==",
"resolved": "https://registry.simatic-ax.siemens.io/@ax/st-docs/-/st-docs-7.1.87.tgz",
"dependencies": {}
},
"@ax/system-math": {
"name": "@ax/system-math",
"version": "7.1.47",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ private static bool CertificateValidation(HttpRequestMessage requestMessage, X50

public static integratedTwinController Plc { get; }
= new(ConnectorAdapterBuilder.Build()
.CreateWebApi(TargetIp, Environment.GetEnvironmentVariable("AX_USER_NAME"), Environment.GetEnvironmentVariable("AX_TARGET_PWD"), CertificateValidation, true));
.CreateWebApi(TargetIp, Environment.GetEnvironmentVariable("AX_USERNAME"), Environment.GetEnvironmentVariable("AX_TARGET_PWD"), CertificateValidation, true));
}
}

0 comments on commit 13b62c8

Please sign in to comment.