From 336a98dc70b5fd4cf872a95442f20befe4807733 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 3 Mar 2026 18:26:33 +0000 Subject: [PATCH 1/5] Initial plan From fe1c15580ff0784d2ea51e304a241eecf1e5a720 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 3 Mar 2026 18:31:22 +0000 Subject: [PATCH 2/5] Add CI workflow for C++ GSDK unit tests on PRs Co-authored-by: dgkanatsios <8256138+dgkanatsios@users.noreply.github.com> --- .github/workflows/cpp-tests.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/cpp-tests.yml diff --git a/.github/workflows/cpp-tests.yml b/.github/workflows/cpp-tests.yml new file mode 100644 index 00000000..a299717f --- /dev/null +++ b/.github/workflows/cpp-tests.yml @@ -0,0 +1,28 @@ +name: C++ GSDK Tests + +on: + pull_request: + paths: + - 'cpp/**' + - '.github/workflows/cpp-tests.yml' + +permissions: + contents: read + +jobs: + test: + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + + - name: Add MSBuild to PATH + uses: microsoft/setup-msbuild@v2 + + - name: Build + run: msbuild cpp\GSDK.sln /p:Configuration=Release /p:Platform=x64 + + - name: Test + shell: pwsh + run: | + $vsInstallPath = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath + & "$vsInstallPath\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" "cpp\x64\Release\GSDKCPPUnitTests\GSDK_CPP_UnitTests.dll" /Platform:x64 From cee72e6e9a7c4766e961af5c2381f25135b03c7e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 3 Mar 2026 18:36:50 +0000 Subject: [PATCH 3/5] Fix CI: override WindowsTargetPlatformVersion and add DLL paths for tests Co-authored-by: dgkanatsios <8256138+dgkanatsios@users.noreply.github.com> --- .github/workflows/cpp-tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cpp-tests.yml b/.github/workflows/cpp-tests.yml index a299717f..0858bf39 100644 --- a/.github/workflows/cpp-tests.yml +++ b/.github/workflows/cpp-tests.yml @@ -19,10 +19,11 @@ jobs: uses: microsoft/setup-msbuild@v2 - name: Build - run: msbuild cpp\GSDK.sln /p:Configuration=Release /p:Platform=x64 + run: msbuild cpp\GSDK.sln /p:Configuration=Release /p:Platform=x64 /p:WindowsTargetPlatformVersion=10.0 - name: Test shell: pwsh run: | + $env:PATH += ";$pwd\cpp\dependencies\libcurl-vc15-x64-release-dll-ssl-dll-ipv6-sspi\bin;$pwd\cpp\dependencies\openssl" $vsInstallPath = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath & "$vsInstallPath\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" "cpp\x64\Release\GSDKCPPUnitTests\GSDK_CPP_UnitTests.dll" /Platform:x64 From 4acaa021b5d9489b4314d2c74b95cbcf95c7ecb5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 3 Mar 2026 18:44:18 +0000 Subject: [PATCH 4/5] Fix CI: target only unit test project and fix uint32_t type mismatch in test Co-authored-by: dgkanatsios <8256138+dgkanatsios@users.noreply.github.com> --- .github/workflows/cpp-tests.yml | 2 +- cpp/unittests/gsdkTests.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cpp-tests.yml b/.github/workflows/cpp-tests.yml index 0858bf39..b407fbd9 100644 --- a/.github/workflows/cpp-tests.yml +++ b/.github/workflows/cpp-tests.yml @@ -19,7 +19,7 @@ jobs: uses: microsoft/setup-msbuild@v2 - name: Build - run: msbuild cpp\GSDK.sln /p:Configuration=Release /p:Platform=x64 /p:WindowsTargetPlatformVersion=10.0 + run: msbuild cpp\GSDK.sln /t:GSDK_CPP_UnitTests /p:Configuration=Release /p:Platform=x64 /p:WindowsTargetPlatformVersion=10.0 - name: Test shell: pwsh diff --git a/cpp/unittests/gsdkTests.cpp b/cpp/unittests/gsdkTests.cpp index 6581fad7..70468064 100644 --- a/cpp/unittests/gsdkTests.cpp +++ b/cpp/unittests/gsdkTests.cpp @@ -227,7 +227,7 @@ namespace Microsoft Assert::AreEqual(1523552310LL, _mkgmtime(&schedule.m_events[0].m_notBefore), L"Verify maintenance V2 callback with correct time was called."); Assert::AreEqual("eventDescription", schedule.m_events[0].m_description.c_str(), L"Verify maintenance V2 callback with correct description was called."); Assert::AreEqual("Platform", schedule.m_events[0].m_eventSource.c_str(), L"Verify maintenance V2 callback with correct source was called."); - Assert::AreEqual(3600, schedule.m_events[0].m_durationInSeconds, L"Verify maintenance V2 callback with correct duration was called."); + Assert::AreEqual(3600u, schedule.m_events[0].m_durationInSeconds, L"Verify maintenance V2 callback with correct duration was called."); } TEST_METHOD(DecodeAgentResponse_JsonDoesntCrash) From 9c973af72470b90ef7b9530eafc9e812ee12e4f1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 3 Mar 2026 22:23:37 +0000 Subject: [PATCH 5/5] Fix test JSON keys to match C++ parsing code casing (camelCase) Co-authored-by: dgkanatsios <8256138+dgkanatsios@users.noreply.github.com> --- cpp/unittests/gsdkTests.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/cpp/unittests/gsdkTests.cpp b/cpp/unittests/gsdkTests.cpp index 70468064..8350afd3 100644 --- a/cpp/unittests/gsdkTests.cpp +++ b/cpp/unittests/gsdkTests.cpp @@ -193,22 +193,22 @@ namespace Microsoft }, "maintenanceSchedule": { - "DocumentIncarnation": "IncarnationID", + "documentIncarnation": "IncarnationID", "Events": [ { - "EventId": "eventID", - "EventType": "Reboot", - "ResourceType": "VirtualMachine", + "eventId": "eventID", + "eventType": "Reboot", + "resourceType": "VirtualMachine", "Resources": [ "resourceName" ], - "EventStatus": "Scheduled", - "NotBefore": "2018-04-12T16:58:30.1458776Z", - "Description": "eventDescription", - "EventSource": "Platform", - "DurationInSeconds": 3600 + "eventStatus": "Scheduled", + "notBefore": "2018-04-12T16:58:30.1458776Z", + "description": "eventDescription", + "eventSource": "Platform", + "durationInSeconds": 3600 } ] },