Skip to content

Commit 13b62c8

Browse files
committed
fixing integration testing
1 parent 9e0eebd commit 13b62c8

File tree

5 files changed

+51
-34
lines changed

5 files changed

+51
-34
lines changed

cake/Program.cs

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -170,19 +170,34 @@ public override void Run(BuildContext context)
170170
}
171171
if (context.BuildParameters.TestLevel >= 3)
172172
{
173-
context.UploadTestPlc(
174-
Path.GetFullPath(Path.Combine(context.WorkDirName, "..//..//src//AXSharp.connectors//tests//ax-test-project//")),
175-
Environment.GetEnvironmentVariable("AXTARGET"),
176-
Environment.GetEnvironmentVariable("AXTARGETPLATFORMINPUT"));
177-
178-
context.RunTestsFromFilteredSolution(Path.Combine(context.ScrDir, "AXSharp-L3-tests_WebApi.slnf"));
179-
180-
context.UploadTestPlc(
181-
Path.GetFullPath(Path.Combine(context.WorkDirName, "..//..//src//tests.integrations//integrated//src//ax")),
182-
Environment.GetEnvironmentVariable("AXTARGET"),
183-
Environment.GetEnvironmentVariable("AXTARGETPLATFORMINPUT"));
184-
185-
context.RunTestsFromFilteredSolution(Path.Combine(context.ScrDir, "AXSharp-L3-tests_Integration.slnf"));
173+
// This must be run in a separate environment!
174+
try
175+
{
176+
context.UploadTestPlc(
177+
Path.GetFullPath(Path.Combine(context.WorkDirName, "..//..//src//AXSharp.connectors//tests//ax-test-project//")),
178+
Environment.GetEnvironmentVariable("AXTARGET"),
179+
Environment.GetEnvironmentVariable("AXTARGETPLATFORMINPUT"));
180+
181+
context.RunTestsFromFilteredSolution(Path.Combine(context.ScrDir, "AXSharp-L3-tests_WebApi.slnf"));
182+
}
183+
catch
184+
{
185+
System.Console.WriteLine("Some WebAPI tests failed. RUN IN APPROPRIATE EVNIRONMENT");
186+
}
187+
188+
try
189+
{
190+
context.UploadTestPlc(
191+
Path.GetFullPath(Path.Combine(context.WorkDirName, "..//..//src//tests.integrations//integrated//src//ax")),
192+
Environment.GetEnvironmentVariable("AXTARGET"),
193+
Environment.GetEnvironmentVariable("AXTARGETPLATFORMINPUT"));
194+
195+
context.RunTestsFromFilteredSolution(Path.Combine(context.ScrDir, "AXSharp-L3-tests_Integration.slnf"));
196+
}
197+
catch
198+
{
199+
System.Console.WriteLine("Some WebAPI tests failed. RUN IN APPROPRIATE EVNIRONMENT");
200+
}
186201
}
187202

188203

src/AXSharp.connectors/tests/AXSharp.Connector.Sax.WebAPITests/TestConnector.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ public static ax_test_projectTwinController SecurePlc
5151
securePlc = new(ConnectorAdapterBuilder.Build()
5252
.CreateWebApi(TargetIp, Environment.GetEnvironmentVariable("AX_USERNAME"),
5353
Environment.GetEnvironmentVariable("AX_TARGET_PWD"), CertificateValidation, true));
54+
55+
SecurePlc.Connector.BuildAndStart();
5456
}
5557
return securePlc;
5658
}

src/AXSharp.connectors/tests/ax-test-project/apax-lock.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@
4141
},
4242
"@ax/sld": {
4343
"name": "@ax/sld",
44-
"version": "3.0.6",
45-
"integrity": "sha512-j90GJh1jMIpvB521EIxvTq6rhr8OO+6qqwsXn2Of7GxQrzwWi+NEXe9ss/ccFAKL0I7aEGD+SIW8jVHUgMAvow==",
46-
"resolved": "https://registry.simatic-ax.siemens.io/@ax/sld/-/sld-3.0.6.tgz",
44+
"version": "3.0.8",
45+
"integrity": "sha512-4YSQf0eXLTGN0LmBBKFYUyhuhZAxH11W+kZfHAjXy5cIkJhhf5g50d/GDZHj5q5hcY/GEIerKLL+B3RUBejHgg==",
46+
"resolved": "https://registry.simatic-ax.siemens.io/@ax/sld/-/sld-3.0.8.tgz",
4747
"cpu": [
4848
"x64"
4949
],
@@ -617,6 +617,13 @@
617617
],
618618
"dependencies": {}
619619
},
620+
"@ax/st-docs": {
621+
"name": "@ax/st-docs",
622+
"version": "7.1.87",
623+
"integrity": "sha512-J5BthD1BR0fu1dkqQFyW3yOByC14TxhG+b/NUl2zXkSqjnsAQQbNtdheZquZ225x0qkJAR8wRrBx9Kr3QdYg8w==",
624+
"resolved": "https://registry.simatic-ax.siemens.io/@ax/st-docs/-/st-docs-7.1.87.tgz",
625+
"dependencies": {}
626+
},
620627
"@ax/system-strings": {
621628
"name": "@ax/system-strings",
622629
"version": "7.1.47",
@@ -679,13 +686,6 @@
679686
],
680687
"dependencies": {}
681688
},
682-
"@ax/st-docs": {
683-
"name": "@ax/st-docs",
684-
"version": "7.1.87",
685-
"integrity": "sha512-J5BthD1BR0fu1dkqQFyW3yOByC14TxhG+b/NUl2zXkSqjnsAQQbNtdheZquZ225x0qkJAR8wRrBx9Kr3QdYg8w==",
686-
"resolved": "https://registry.simatic-ax.siemens.io/@ax/st-docs/-/st-docs-7.1.87.tgz",
687-
"dependencies": {}
688-
},
689689
"@ax/system-math": {
690690
"name": "@ax/system-math",
691691
"version": "7.1.47",

src/tests.integrations/integrated/src/ax/apax-lock.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@
4141
},
4242
"@ax/sld": {
4343
"name": "@ax/sld",
44-
"version": "3.0.6",
45-
"integrity": "sha512-j90GJh1jMIpvB521EIxvTq6rhr8OO+6qqwsXn2Of7GxQrzwWi+NEXe9ss/ccFAKL0I7aEGD+SIW8jVHUgMAvow==",
46-
"resolved": "https://registry.simatic-ax.siemens.io/@ax/sld/-/sld-3.0.6.tgz",
44+
"version": "3.0.8",
45+
"integrity": "sha512-4YSQf0eXLTGN0LmBBKFYUyhuhZAxH11W+kZfHAjXy5cIkJhhf5g50d/GDZHj5q5hcY/GEIerKLL+B3RUBejHgg==",
46+
"resolved": "https://registry.simatic-ax.siemens.io/@ax/sld/-/sld-3.0.8.tgz",
4747
"cpu": [
4848
"x64"
4949
],
@@ -617,6 +617,13 @@
617617
],
618618
"dependencies": {}
619619
},
620+
"@ax/st-docs": {
621+
"name": "@ax/st-docs",
622+
"version": "7.1.87",
623+
"integrity": "sha512-J5BthD1BR0fu1dkqQFyW3yOByC14TxhG+b/NUl2zXkSqjnsAQQbNtdheZquZ225x0qkJAR8wRrBx9Kr3QdYg8w==",
624+
"resolved": "https://registry.simatic-ax.siemens.io/@ax/st-docs/-/st-docs-7.1.87.tgz",
625+
"dependencies": {}
626+
},
620627
"@ax/system-strings": {
621628
"name": "@ax/system-strings",
622629
"version": "7.1.47",
@@ -679,13 +686,6 @@
679686
],
680687
"dependencies": {}
681688
},
682-
"@ax/st-docs": {
683-
"name": "@ax/st-docs",
684-
"version": "7.1.87",
685-
"integrity": "sha512-J5BthD1BR0fu1dkqQFyW3yOByC14TxhG+b/NUl2zXkSqjnsAQQbNtdheZquZ225x0qkJAR8wRrBx9Kr3QdYg8w==",
686-
"resolved": "https://registry.simatic-ax.siemens.io/@ax/st-docs/-/st-docs-7.1.87.tgz",
687-
"dependencies": {}
688-
},
689689
"@ax/system-math": {
690690
"name": "@ax/system-math",
691691
"version": "7.1.47",

src/tests.integrations/integrated/src/integrated.twin/Entry.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@ private static bool CertificateValidation(HttpRequestMessage requestMessage, X50
4141

4242
public static integratedTwinController Plc { get; }
4343
= new(ConnectorAdapterBuilder.Build()
44-
.CreateWebApi(TargetIp, Environment.GetEnvironmentVariable("AX_USER_NAME"), Environment.GetEnvironmentVariable("AX_TARGET_PWD"), CertificateValidation, true));
44+
.CreateWebApi(TargetIp, Environment.GetEnvironmentVariable("AX_USERNAME"), Environment.GetEnvironmentVariable("AX_TARGET_PWD"), CertificateValidation, true));
4545
}
4646
}

0 commit comments

Comments
 (0)