From 873244b7d354a38c775a7327fb3353632d45d53b Mon Sep 17 00:00:00 2001 From: Shishir Bhat Date: Wed, 11 May 2022 10:49:04 -0700 Subject: [PATCH 1/2] DO SDK: Specify windows-2019 build VM image * Default image has moved to windows-2022 which has VS2022 installed by default instead of VS2019. We have not yet tested builds with VS2022, so go back to windows-2019 for now. See https://github.com/actions/virtual-environments/issues/4856. --- azure-pipelines/build/windows/dosdkcpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines/build/windows/dosdkcpp.yml b/azure-pipelines/build/windows/dosdkcpp.yml index 0b4552bc..92492a72 100644 --- a/azure-pipelines/build/windows/dosdkcpp.yml +++ b/azure-pipelines/build/windows/dosdkcpp.yml @@ -32,7 +32,7 @@ pr: - sdk-cpp/build/cleanup-install.sh pool: - vmImage: "windows-latest" + vmImage: "windows-2019" jobs: - job: Debug From 176a0bd22eac40734290f12e506a072640f16218 Mon Sep 17 00:00:00 2001 From: Shishir Bhat Date: Wed, 11 May 2022 11:25:07 -0700 Subject: [PATCH 2/2] DO SDK test: Updates for the set_property workaround --- sdk-cpp/tests/com/download_properties_tests.cpp | 7 ++++--- sdk-cpp/tests_nothrow/download_properties_tests.cpp | 5 ++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sdk-cpp/tests/com/download_properties_tests.cpp b/sdk-cpp/tests/com/download_properties_tests.cpp index 2124ce74..2d8d7be2 100644 --- a/sdk-cpp/tests/com/download_properties_tests.cpp +++ b/sdk-cpp/tests/com/download_properties_tests.cpp @@ -106,18 +106,19 @@ TEST_F(DownloadPropertyTestsDOSVC, InvalidPhfDigestTest) { auto simpleDownload = msdo::download::make(g_smallFileUrl, g_tmpFileName); + msdo::download_property_value integrityCheckInfo = msdo::download_property_value::make("blah"); try { - msdo::download_property_value integrityCheckInfo = msdo::download_property_value::make("blah"); + // Call fails only on 19041+ builds of Windows. Earlier versions did not support setting + // PHF info through IDODownload and the SDK has a workaround to ignore that error. simpleDownload->set_property(msdo::download_property::integrity_check_info, integrityCheckInfo); } catch (const msdo::exception& e) { - std::vector expectedErrors = { static_cast(msdo::errc::invalid_arg), static_cast(msdo::errc::do_e_unknown_property_id) }; + std::vector expectedErrors = { static_cast(msdo::errc::invalid_arg) }; VerifyError(e.error_code().value(), expectedErrors); return; } - ASSERT_TRUE(false); } // For some reason, custom headers are getting rejected and returning E_INVALIDARG now, disabling test for now diff --git a/sdk-cpp/tests_nothrow/download_properties_tests.cpp b/sdk-cpp/tests_nothrow/download_properties_tests.cpp index 57319ec8..f5037966 100644 --- a/sdk-cpp/tests_nothrow/download_properties_tests.cpp +++ b/sdk-cpp/tests_nothrow/download_properties_tests.cpp @@ -126,12 +126,11 @@ TEST_F(DownloadPropertyTestsDOSVC_NoThrow, InvalidPhfDigestTest) auto simpleDownload = g_MakeDownload(g_smallFileUrl, g_tmpFileName); msdo::download_property_value integrityCheckInfo = g_MakePropertyValue("blah"); - std::vector expectedErrors = { static_cast(msdo::errc::invalid_arg), - static_cast(msdo::errc::do_e_unknown_property_id) }; + std::vector expectedErrors = { 0, static_cast(msdo::errc::invalid_arg) }; VerifyCallWithExpectedErrors([&]() { return simpleDownload->set_property_nothrow(msdo::download_property::integrity_check_info, integrityCheckInfo); - }, { static_cast(msdo::errc::invalid_arg), static_cast(msdo::errc::do_e_unknown_property_id) }); + }, expectedErrors); } // For some reason, custom headers are getting rejected and returning E_INVALIDARG now, disabling test for now