Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
ab9d062
Merge pull request #483 from PHOENIXCONTACT/fix/dead-end-validation
1nf0rmagician Nov 21, 2024
c907130
Fix test steps in build pipeline
seveneleven Oct 24, 2024
5264106
Fix failing artifacts
seveneleven Nov 26, 2024
2414a5a
Merge pull request #493 from PHOENIXCONTACT/fix/legacy-test-steps
seveneleven Nov 27, 2024
8caf924
Added functionality to use Https / TLS
chaostrichter Jun 30, 2025
84d7c23
fixed the part for "endpoints" it will be started on http and https when
chaostrichter Jul 3, 2025
bdfd09e
changed build server from 2019 to 2022
chaostrichter Jul 7, 2025
7e2cafd
changed certificate search from thumbprint to serialnumber
chaostrichter Jul 8, 2025
2604b52
added setup for node 14 before build
chaostrichter Jul 15, 2025
f877fb3
added minimatch version
chaostrichter Jul 15, 2025
72c39ff
Merge pull request #548 from PHOENIXCONTACT/fix/httpsPipeline
chaostrichter Jul 15, 2025
a7207a4
Make TimerId of ScheduleExecution thread safe.
dacky179 Jul 17, 2025
4c8a3de
Merge pull request #546 from PHOENIXCONTACT/feature/https
seveneleven Jul 23, 2025
8d7e89a
Make TimerId of ScheduleExecution thread safe.
dacky179 Jul 17, 2025
59534f5
Merge branch 'ThreadSafeScheduleExecution' of https://github.com/dack…
dacky179 Jul 24, 2025
b6f5d0e
Change to Interlocked.Increment
dacky179 Jul 25, 2025
04cbb02
Merge pull request #550 from dacky179/ThreadSafeScheduleExecution
seveneleven Jul 30, 2025
4a46537
removed the check for only WebHttp Binding. Its not working when https
chaostrichter Aug 27, 2025
fecd3b7
Merge pull request #585 from PHOENIXCONTACT/bugfix/https
seveneleven Aug 29, 2025
f0e605b
FIX: Allow numbers in TextBindingResolver (#597)
slimberg91 Sep 11, 2025
4440445
Allow reading the number of pending elements in the ParallelOperation…
dacky179 Nov 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 15 additions & 57 deletions .build/BuildToolkit.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -265,20 +265,7 @@ function Invoke-CoverTests($SearchPath = $RootPath, $SearchFilter = "*.csproj",
return;
}

if (-not (Test-Path $global:NUnitCli)) {
Install-Tool "NUnit.Console" $NunitVersion $global:NunitCli;
}

if (-not (Test-Path $global:OpenCoverCli)) {
Install-Tool "OpenCover" $OpenCoverVersion $global:OpenCoverCli;
}

if (-not (Test-Path $global:OpenCoverToCoberturaCli)) {
Install-Tool "OpenCoverToCoberturaConverter" $OpenCoverToCoberturaVersion $global:OpenCoverToCoberturaCli;
}

CreateFolderIfNotExists $OpenCoverReportsDir;
CreateFolderIfNotExists $NunitReportsDir;
CreateFolderIfNotExists $CoberturaReportsDir;

$includeFilter = "+[Moryx*]*";
$excludeFilter = "-[*nunit*]* -[*Tests]* -[*Model*]*";
Expand Down Expand Up @@ -309,55 +296,26 @@ function Invoke-CoverTests($SearchPath = $RootPath, $SearchFilter = "*.csproj",

ForEach($testProject in $testProjects ) {
$projectName = ([System.IO.Path]::GetFileNameWithoutExtension($testProject.Name));
$testAssembly = [System.IO.Path]::Combine($testProject.DirectoryName, "bin", $env:MORYX_BUILD_CONFIG, "$projectName.dll");
$isNetCore = Get-CsprojIsNetCore($testProject);

Write-Host "OpenCover Test: ${projectName}:";

$nunitXml = ($NunitReportsDir + "\$projectName.TestResult.xml");
$openCoverXml = ($OpenCoverReportsDir + "\$projectName.OpenCover.xml");
$coberturaXml = ($CoberturaReportsDir + "\$projectName.Cobertura.xml");

if ($isNetCore) {
$targetArgs = '"test -v ' + $env:MORYX_TEST_VERBOSITY + ' -c ' + $env:MORYX_BUILD_CONFIG + ' ' + $testProject + '"';
$openCoverAgs = "-target:$global:DotNetCli", "-targetargs:$targetArgs"
}
else {
# If assembly does not exists, the project will be build
if (-not (Test-Path $testAssembly)) {
Invoke-Build $testProject
}
Write-Host "Testing ${projectName}...";

dotnet test ${testProject} --collect:"XPlat Code Coverage" `
/p:CoverletOutputFormat="cobertura" `
/p:Include="$includeFilter" `
/p:Exclude="$excludeFilter"

$openCoverAgs = "-target:$global:NunitCli", "-targetargs:/config:$env:MORYX_BUILD_CONFIG /result:$nunitXml $testAssembly"
}
Invoke-ExitCodeCheck $LastExitCode;

$openCoverAgs += "-log:Debug", "-register:administrator", "-output:$openCoverXml", "-hideskipped:all", "-skipautoprops";
$openCoverAgs += "-returntargetcode" # We need the nunit return code
$openCoverAgs += "-filter:$includeFilter $excludeFilter"
$testsDir = [System.IO.Path]::Combine([System.IO.Path]::GetDirectoryName($testProject), "TestResults");

& $global:OpenCoverCli $openCoverAgs

$exitCode = [int]::Parse($LastExitCode);
if ($exitCode -ne 0) {
$errorText = "";
switch ($exitCode) {
-1 { $errorText = "INVALID_ARG"; }
-2 { $errorText = "INVALID_ASSEMBLY"; }
-4 { $errorText = "INVALID_TEST_FIXTURE"; }
-5 { $errorText = "UNLOAD_ERROR"; }
Default { $errorText = "UNEXPECTED_ERROR"; }
}
$testResults = Get-ChildItem -Path $testsDir -Recurse -File
foreach ($resultFile in $testResults) {
$destinationFile = $resultFile.FullName.Replace($testsDir, $CoberturaReportsDir);
$destinationPath = [System.IO.Path]::GetDirectoryName($destinationFile);

if ($exitCode -gt 0) {
$errorText = "FAILED_TESTS ($exitCode)";
}
CreateFolderIfNotExists $destinationPath;

Write-Host-Error "Nunit exited with $errorText for $projectName";
Invoke-ExitCodeCheck $exitCode;
Move-Item -Path $resultFile -Destination $destinationFile
}

& $global:OpenCoverToCoberturaCli -input:$openCoverXml -output:$coberturaXml -sources:$rootPath
Invoke-ExitCodeCheck $LastExitCode;
}
}

Expand Down
30 changes: 22 additions & 8 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
branches:
- dev
- future
- release/3

env:
MORYX_OPTIMIZE_CODE: "false"
Expand All @@ -22,7 +23,7 @@ env:

jobs:
Build:
runs-on: windows-2019
runs-on: windows-2022
steps:
- uses: actions/checkout@v2

Expand All @@ -38,6 +39,11 @@ jobs:
with:
dotnet-version: '6'

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 14.21.x

- name: Build
shell: pwsh
run: ./Build.ps1 -Build -Pack
Expand All @@ -51,7 +57,7 @@ jobs:

UnitTests:
needs: [Build]
runs-on: windows-2019
runs-on: windows-2022
steps:
- uses: actions/checkout@v2

Expand All @@ -76,11 +82,12 @@ jobs:
with:
name: test-results
path: artifacts/Tests/
if-no-files-found: error
retention-days: 1

IntegrationTests:
needs: [Build]
runs-on: windows-2019
runs-on: windows-2022
steps:
- uses: actions/checkout@v2

Expand All @@ -103,28 +110,35 @@ jobs:
- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: test-results
name: integration-test-results
path: artifacts/Tests/
if-no-files-found: error
retention-days: 1

Codecov:
needs: [UnitTests, IntegrationTests]
runs-on: windows-2019
runs-on: windows-2022
steps:
- name: Download test results
uses: actions/download-artifact@v4
with:
name: test-results
path: artifacts/Tests/

- name: Download test results
uses: actions/download-artifact@v4
with:
name: integration-test-results
path: artifacts/Tests/

- name: Codecov
uses: codecov/codecov-action@v1
with:
files: '*.OpenCover.xml'
files: '*coverage.cobertura.xml'

Documentation:
needs: [Build]
runs-on: windows-2019
runs-on: windows-2022
steps:
- uses: actions/checkout@v2

Expand All @@ -142,7 +156,7 @@ jobs:
Publish:
needs: [Build, UnitTests, IntegrationTests]
if: ${{ github.event_name == 'push' }}
runs-on: windows-2019
runs-on: windows-2022
steps:
- uses: actions/checkout@v2

Expand Down
1 change: 1 addition & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<PackageReference Update="Moq" Version="4.16.1" />
<PackageReference Update="NUnit" Version="3.13.2" />
<PackageReference Update="NUnit3TestAdapter" Version="4.1.0" />
<PackageReference Update="coverlet.collector" Version="5.8.0" />

<PackageReference Update="CommandLineParser" Version="2.8.0" />
<PackageReference Update="System.ComponentModel.Annotations" Version="4.7.0" />
Expand Down
1 change: 1 addition & 0 deletions src/Moryx.Maintenance.Web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"@types/react-redux": "^7.0.5",
"@types/reactstrap": "^7.1.3",
"@types/uuid": "^3.4.4",
"@types/minimatch": "^5.1.2",
"bootstrap": "4.3.1",
"bootstrap-toggle": "^2.2.2",
"chart.js": "^2.8.0",
Expand Down
80 changes: 79 additions & 1 deletion src/Moryx.Runtime.Wcf/BindingFactories.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public static class BindingFactory
/// <summary>
/// Creates a new basic http binding with our default configuration.
/// Most parts are set to nearly int max, timeouts are set to 5 min.
/// Encoding is Text and TransferMode is bufferd.
/// Encoding is Text and TransferMode is buffered.
/// </summary>
/// <param name="requiresAuthentication">Is authentication required?</param>
/// <returns>The new created binding.</returns>
Expand Down Expand Up @@ -115,5 +115,83 @@ public static Binding CreateNetTcpBinding(bool requiresAuthentication)

return binding;
}

/// <summary>
/// Creates a new Web Https Binding with our default configuration.
/// Most values are set to nearly int max, timeouts are set to 5 min.
/// </summary>
/// <returns>A new Web Https binding.</returns>
public static Binding CreateWebHttpsBinding()
{
var binding = new WebHttpBinding()
{
MaxBufferSize = int.MaxValue,
MaxReceivedMessageSize = int.MaxValue,
MaxBufferPoolSize = int.MaxValue,
CloseTimeout = TimeSpan.FromSeconds(30),
OpenTimeout = TimeSpan.FromSeconds(30),
ReceiveTimeout = TimeSpan.FromSeconds(30),
SendTimeout = TimeSpan.FromSeconds(30),
TransferMode = TransferMode.Buffered,
UseDefaultWebProxy = true,
ReaderQuotas =
{
MaxStringContentLength = int.MaxValue,
MaxArrayLength = int.MaxValue,
MaxBytesPerRead = int.MaxValue,
MaxNameTableCharCount = int.MaxValue
},
Security =
{
Mode = WebHttpSecurityMode.Transport
}
};
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.None;
return binding;
}

/// <summary>
/// Creates a new basic https binding with our default configuration.
/// Most parts are set to nearly int max, timeouts are set to 5 min.
/// Encoding is Text and TransferMode is buffered.
/// </summary>
/// <param name="requiresAuthentication">Is authentication required?</param>
/// <returns>The new created binding.</returns>
public static Binding CreateBasicHttpsBinding(bool requiresAuthentication)
{
var basicHttpBinding = new BasicHttpBinding
{
MaxBufferSize = int.MaxValue,
MaxReceivedMessageSize = int.MaxValue,
MaxBufferPoolSize = int.MaxValue,
CloseTimeout = TimeSpan.FromSeconds(30),
OpenTimeout = TimeSpan.FromSeconds(30),
ReceiveTimeout = TimeSpan.FromSeconds(30),
SendTimeout = TimeSpan.FromSeconds(30),
MessageEncoding = WSMessageEncoding.Text,
TransferMode = TransferMode.Buffered,
UseDefaultWebProxy = true,
ReaderQuotas =
{
MaxStringContentLength = int.MaxValue,
MaxArrayLength = int.MaxValue,
MaxBytesPerRead = int.MaxValue,
MaxNameTableCharCount = int.MaxValue
}
};

if (requiresAuthentication)
{
basicHttpBinding.Security.Mode = BasicHttpSecurityMode.Transport;
basicHttpBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Ntlm;
}
else
{
basicHttpBinding.Security.Mode = BasicHttpSecurityMode.Transport;
basicHttpBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.None;
}

return basicHttpBinding;
}
}
}
Loading
Loading