Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
29 changes: 29 additions & 0 deletions .github/workflows/cpp-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
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 /t:GSDK_CPP_UnitTests /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
20 changes: 10 additions & 10 deletions cpp/unittests/gsdkTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
]
},
Expand All @@ -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)
Expand Down