Temporarily disable Mac azuresdkforcpp tests (#6636)
* Temporarily disable Mac azuresdkforcpp tests
This commit is contained in:
parent
17563c7c01
commit
2626f12add
@ -41,7 +41,6 @@ namespace Azure { namespace Core { namespace Test {
|
||||
|
||||
/*********************** Unique Tests for Libcurl ********************************/
|
||||
#if defined(BUILD_CURL_HTTP_TRANSPORT_ADAPTER)
|
||||
|
||||
TEST(CurlConnectionPool, connectionPoolTest)
|
||||
{
|
||||
{
|
||||
@ -607,7 +606,11 @@ namespace Azure { namespace Core { namespace Test {
|
||||
}
|
||||
}
|
||||
|
||||
#if _azure_DISABLE_HTTP_BIN_TESTS
|
||||
TEST(CurlConnectionPool, DISABLED_forceConnectionClosed)
|
||||
#else
|
||||
TEST(CurlConnectionPool, forceConnectionClosed)
|
||||
#endif
|
||||
{
|
||||
Azure::Core::Http::Request req(
|
||||
Azure::Core::Http::HttpMethod::Get, Azure::Core::Url(AzureSdkHttpbinServer::Status(101)));
|
||||
@ -630,7 +633,11 @@ namespace Azure { namespace Core { namespace Test {
|
||||
}
|
||||
}
|
||||
|
||||
#if _azure_DISABLE_HTTP_BIN_TESTS
|
||||
TEST(CurlConnectionPool, DISABLED_connectionClose)
|
||||
#else
|
||||
TEST(CurlConnectionPool, connectionClose)
|
||||
#endif
|
||||
{
|
||||
/// When getting the header connection: close from an HTTP response, the connection should not
|
||||
/// be moved back to the pool.
|
||||
|
||||
@ -60,7 +60,11 @@ namespace Azure { namespace Core { namespace Test {
|
||||
}
|
||||
|
||||
/******************************* SSL options. ************************/
|
||||
TEST(CurlTransportOptions, noRevoke)
|
||||
#if _azure_DISABLE_HTTP_BIN_TESTS
|
||||
TEST(CurlConnectionPool, DISABLED_noRevoke)
|
||||
#else
|
||||
TEST(CurlConnectionPool, noRevoke)
|
||||
#endif
|
||||
{
|
||||
Azure::Core::Http::CurlTransportOptions curlOptions;
|
||||
curlOptions.SslOptions.EnableCertificateRevocationListCheck = true;
|
||||
@ -197,7 +201,11 @@ namespace Azure { namespace Core { namespace Test {
|
||||
}
|
||||
*/
|
||||
|
||||
TEST(CurlTransportOptions, sslVerifyOff)
|
||||
#if _azure_DISABLE_HTTP_BIN_TESTS
|
||||
TEST(CurlConnectionPool, DISABLED_sslVerifyOff)
|
||||
#else
|
||||
TEST(CurlConnectionPool, sslVerifyOff)
|
||||
#endif
|
||||
{
|
||||
Azure::Core::Http::CurlTransportOptions curlOptions;
|
||||
// If ssl verify is not disabled, this test would fail because the caInfo is not OK
|
||||
@ -295,7 +303,11 @@ namespace Azure { namespace Core { namespace Test {
|
||||
#endif
|
||||
}
|
||||
|
||||
TEST(CurlTransportOptions, httpsDefault)
|
||||
#if _azure_DISABLE_HTTP_BIN_TESTS
|
||||
TEST(CurlConnectionPool, DISABLED_httpsDefault)
|
||||
#else
|
||||
TEST(CurlConnectionPool, httpsDefault)
|
||||
#endif
|
||||
{
|
||||
auto transportAdapter = std::make_shared<Azure::Core::Http::CurlTransport>();
|
||||
Azure::Core::Http::Policies::TransportOptions options;
|
||||
@ -327,7 +339,11 @@ namespace Azure { namespace Core { namespace Test {
|
||||
.ConnectionPoolIndex.clear());
|
||||
}
|
||||
|
||||
TEST(CurlTransportOptions, disableKeepAlive)
|
||||
#if _azure_DISABLE_HTTP_BIN_TESTS
|
||||
TEST(CurlConnectionPool, DISABLED_disableKeepAlive)
|
||||
#else
|
||||
TEST(CurlConnectionPool, disableKeepAlive)
|
||||
#endif
|
||||
{
|
||||
Azure::Core::Http::CurlTransportOptions curlOptions;
|
||||
curlOptions.HttpKeepAlive = false;
|
||||
@ -365,7 +381,11 @@ namespace Azure { namespace Core { namespace Test {
|
||||
0);
|
||||
}
|
||||
|
||||
TEST(CurlTransportOptions, disableSslCaching)
|
||||
#if _azure_DISABLE_HTTP_BIN_TESTS
|
||||
TEST(CurlConnectionPool, DISABLED_disableSslCaching)
|
||||
#else
|
||||
TEST(CurlConnectionPool, disableSslCaching)
|
||||
#endif
|
||||
{
|
||||
Azure::Core::Http::CurlTransportOptions curlOptions;
|
||||
curlOptions.EnableCurlSslCaching = false;
|
||||
@ -401,5 +421,4 @@ namespace Azure { namespace Core { namespace Test {
|
||||
EXPECT_NO_THROW(Azure::Core::Http::_detail::CurlConnectionPool::g_curlConnectionPool
|
||||
.ConnectionPoolIndex.clear());
|
||||
}
|
||||
|
||||
}}} // namespace Azure::Core::Test
|
||||
|
||||
@ -17,7 +17,11 @@ namespace Azure { namespace Core { namespace Test {
|
||||
|
||||
using namespace Azure::Core::Json::_internal;
|
||||
|
||||
#if _azure_DISABLE_HTTP_BIN_TESTS
|
||||
TEST_P(TransportAdapter, DISABLED_get)
|
||||
#else
|
||||
TEST_P(TransportAdapter, get)
|
||||
#endif
|
||||
{
|
||||
Azure::Core::Url host(AzureSdkHttpbinServer::Get());
|
||||
|
||||
@ -42,7 +46,11 @@ namespace Azure { namespace Core { namespace Test {
|
||||
EXPECT_EQ(jsonBody["headers"]["123"].get<std::string>(), std::string("456"));
|
||||
}
|
||||
|
||||
#if _azure_DISABLE_HTTP_BIN_TESTS
|
||||
TEST_P(TransportAdapter, DISABLED_get204)
|
||||
#else
|
||||
TEST_P(TransportAdapter, get204)
|
||||
#endif
|
||||
{
|
||||
Azure::Core::Url host("http://mt3.google.com/generate_204");
|
||||
|
||||
@ -63,7 +71,11 @@ namespace Azure { namespace Core { namespace Test {
|
||||
CheckBodyFromBuffer(*response, expectedResponseBodySize);
|
||||
}
|
||||
|
||||
#if _azure_DISABLE_HTTP_BIN_TESTS
|
||||
TEST_P(TransportAdapter, DISABLED_getLoop)
|
||||
#else
|
||||
TEST_P(TransportAdapter, getLoop)
|
||||
#endif
|
||||
{
|
||||
Azure::Core::Url host(AzureSdkHttpbinServer::Get());
|
||||
|
||||
@ -79,7 +91,11 @@ namespace Azure { namespace Core { namespace Test {
|
||||
}
|
||||
}
|
||||
|
||||
#if _azure_DISABLE_HTTP_BIN_TESTS
|
||||
TEST_P(TransportAdapter, DISABLED_head)
|
||||
#else
|
||||
TEST_P(TransportAdapter, head)
|
||||
#endif
|
||||
{
|
||||
Azure::Core::Url host(AzureSdkHttpbinServer::Get());
|
||||
auto expectedResponseBodySize = 0;
|
||||
@ -94,7 +110,11 @@ namespace Azure { namespace Core { namespace Test {
|
||||
EXPECT_GT(contentLengthHeader, 0);
|
||||
}
|
||||
|
||||
#if _azure_DISABLE_HTTP_BIN_TESTS
|
||||
TEST_P(TransportAdapter, DISABLED_put)
|
||||
#else
|
||||
TEST_P(TransportAdapter, put)
|
||||
#endif
|
||||
{
|
||||
Azure::Core::Url host(AzureSdkHttpbinServer::Put());
|
||||
|
||||
@ -117,7 +137,11 @@ namespace Azure { namespace Core { namespace Test {
|
||||
EXPECT_EQ(responseJson["data"].get<std::string>(), bodyAsString);
|
||||
}
|
||||
|
||||
#if _azure_DISABLE_HTTP_BIN_TESTS
|
||||
TEST_P(TransportAdapter, DISABLED_deleteRequest)
|
||||
#else
|
||||
TEST_P(TransportAdapter, deleteRequest)
|
||||
#endif
|
||||
{
|
||||
Azure::Core::Url host(AzureSdkHttpbinServer::Delete());
|
||||
|
||||
@ -133,7 +157,11 @@ namespace Azure { namespace Core { namespace Test {
|
||||
CheckBodyFromBuffer(*response, expectedResponseBodySize);
|
||||
}
|
||||
|
||||
#if _azure_DISABLE_HTTP_BIN_TESTS
|
||||
TEST_P(TransportAdapter, DISABLED_patch)
|
||||
#else
|
||||
TEST_P(TransportAdapter, patch)
|
||||
#endif
|
||||
{
|
||||
Azure::Core::Url host(AzureSdkHttpbinServer::Patch());
|
||||
|
||||
@ -149,7 +177,11 @@ namespace Azure { namespace Core { namespace Test {
|
||||
CheckBodyFromBuffer(*response, expectedResponseBodySize);
|
||||
}
|
||||
|
||||
#if _azure_DISABLE_HTTP_BIN_TESTS
|
||||
TEST_P(TransportAdapter, DISABLED_getChunk)
|
||||
#else
|
||||
TEST_P(TransportAdapter, getChunk)
|
||||
#endif
|
||||
{
|
||||
Azure::Core::Url host("http://anglesharp.azurewebsites.net/Chunked");
|
||||
auto expectedResponseBodySize = -1; // chunked will return unknown body length
|
||||
@ -167,7 +199,11 @@ namespace Azure { namespace Core { namespace Test {
|
||||
CheckBodyFromBuffer(*response, expectedResponseBodySize, expectedChunkResponse);
|
||||
}
|
||||
|
||||
#if _azure_DISABLE_HTTP_BIN_TESTS
|
||||
TEST_P(TransportAdapter, DISABLED_putErrorResponse)
|
||||
#else
|
||||
TEST_P(TransportAdapter, putErrorResponse)
|
||||
#endif
|
||||
{
|
||||
Azure::Core::Url host(AzureSdkHttpbinServer::Get());
|
||||
|
||||
@ -188,7 +224,11 @@ namespace Azure { namespace Core { namespace Test {
|
||||
// ***Same tests but getting stream to pull from socket, simulating the Download Op
|
||||
// **********************
|
||||
|
||||
#if _azure_DISABLE_HTTP_BIN_TESTS
|
||||
TEST_P(TransportAdapter, DISABLED_getWithStream)
|
||||
#else
|
||||
TEST_P(TransportAdapter, getWithStream)
|
||||
#endif
|
||||
{
|
||||
Azure::Core::Url host(AzureSdkHttpbinServer::Get());
|
||||
|
||||
@ -213,7 +253,11 @@ namespace Azure { namespace Core { namespace Test {
|
||||
EXPECT_EQ(jsonBody["headers"]["123"].get<std::string>(), std::string("456"));
|
||||
}
|
||||
|
||||
#if _azure_DISABLE_HTTP_BIN_TESTS
|
||||
TEST_P(TransportAdapter, DISABLED_getLoopWithStream)
|
||||
#else
|
||||
TEST_P(TransportAdapter, getLoopWithStream)
|
||||
#endif
|
||||
{
|
||||
Azure::Core::Url host(AzureSdkHttpbinServer::Get());
|
||||
|
||||
@ -229,7 +273,11 @@ namespace Azure { namespace Core { namespace Test {
|
||||
}
|
||||
}
|
||||
|
||||
#if _azure_DISABLE_HTTP_BIN_TESTS
|
||||
TEST_P(TransportAdapter, DISABLED_headWitHStream)
|
||||
#else
|
||||
TEST_P(TransportAdapter, headWithStream)
|
||||
#endif
|
||||
{
|
||||
Azure::Core::Url host(AzureSdkHttpbinServer::Get());
|
||||
auto expectedResponseBodySize = 0;
|
||||
@ -244,7 +292,11 @@ namespace Azure { namespace Core { namespace Test {
|
||||
EXPECT_GT(contentLengthHeader, 0);
|
||||
}
|
||||
|
||||
#if _azure_DISABLE_HTTP_BIN_TESTS
|
||||
TEST_P(TransportAdapter, DISABLED_putWithStream)
|
||||
#else
|
||||
TEST_P(TransportAdapter, putWithStream)
|
||||
#endif
|
||||
{
|
||||
Azure::Core::Url host(AzureSdkHttpbinServer::Put());
|
||||
|
||||
@ -260,7 +312,11 @@ namespace Azure { namespace Core { namespace Test {
|
||||
CheckBodyFromStream(*response, expectedResponseBodySize);
|
||||
}
|
||||
|
||||
#if _azure_DISABLE_HTTP_BIN_TESTS
|
||||
TEST_P(TransportAdapter, DISABLED_deleteRequestWithStream)
|
||||
#else
|
||||
TEST_P(TransportAdapter, deleteRequestWithStream)
|
||||
#endif
|
||||
{
|
||||
Azure::Core::Url host(AzureSdkHttpbinServer::Delete());
|
||||
|
||||
@ -276,7 +332,11 @@ namespace Azure { namespace Core { namespace Test {
|
||||
CheckBodyFromStream(*response, expectedResponseBodySize);
|
||||
}
|
||||
|
||||
#if _azure_DISABLE_HTTP_BIN_TESTS
|
||||
TEST_P(TransportAdapter, DISABLED_patchWithStream)
|
||||
#else
|
||||
TEST_P(TransportAdapter, patchWithStream)
|
||||
#endif
|
||||
{
|
||||
Azure::Core::Url host(AzureSdkHttpbinServer::Patch());
|
||||
|
||||
@ -313,7 +373,11 @@ namespace Azure { namespace Core { namespace Test {
|
||||
CheckBodyFromStream(*response, expectedResponseBodySize, expectedChunkResponse);
|
||||
}
|
||||
|
||||
#if _azure_DISABLE_HTTP_BIN_TESTS
|
||||
TEST_P(TransportAdapter, DISABLED_createResponseT)
|
||||
#else
|
||||
TEST_P(TransportAdapter, createResponseT)
|
||||
#endif
|
||||
{
|
||||
Azure::Core::Url host(AzureSdkHttpbinServer::Get());
|
||||
std::string expectedType("This is the Response Type");
|
||||
@ -338,7 +402,11 @@ namespace Azure { namespace Core { namespace Test {
|
||||
EXPECT_STREQ(result.data(), std::string("").data());
|
||||
}
|
||||
|
||||
#if _azure_DISABLE_HTTP_BIN_TESTS
|
||||
TEST_P(TransportAdapter, DISABLED_customSizePut)
|
||||
#else
|
||||
TEST_P(TransportAdapter, customSizePut)
|
||||
#endif
|
||||
{
|
||||
Azure::Core::Url host(AzureSdkHttpbinServer::Put());
|
||||
|
||||
@ -356,7 +424,11 @@ namespace Azure { namespace Core { namespace Test {
|
||||
}
|
||||
}
|
||||
|
||||
#if _azure_DISABLE_HTTP_BIN_TESTS
|
||||
TEST_P(TransportAdapter, DISABLED_putWithStreamOnFail)
|
||||
#else
|
||||
TEST_P(TransportAdapter, putWithStreamOnFail)
|
||||
#endif
|
||||
{
|
||||
// point to bad address pah to generate server MethodNotAllowed error
|
||||
Azure::Core::Url host(AzureSdkHttpbinServer::Get());
|
||||
@ -399,7 +471,11 @@ namespace Azure { namespace Core { namespace Test {
|
||||
t1.join();
|
||||
}
|
||||
|
||||
#if _azure_DISABLE_HTTP_BIN_TESTS
|
||||
TEST_P(TransportAdapter, DISABLED_redirectsNotFollowed)
|
||||
#else
|
||||
TEST_P(TransportAdapter, redirectsNotFollowed)
|
||||
#endif
|
||||
{
|
||||
// We don't expect the transport adapter to follow redirects automatically to this url.
|
||||
std::string redirectToUrl = AzureSdkHttpbinServer::ResponseHeaders("foo=bar");
|
||||
@ -548,7 +624,11 @@ namespace Azure { namespace Core { namespace Test {
|
||||
}
|
||||
#endif
|
||||
|
||||
#if _azure_DISABLE_HTTP_BIN_TESTS
|
||||
TEST_P(TransportAdapter, DISABLED_SizePutFromFile)
|
||||
#else
|
||||
TEST_P(TransportAdapter, SizePutFromFile)
|
||||
#endif
|
||||
{
|
||||
Azure::Core::Url host(AzureSdkHttpbinServer::Put());
|
||||
std::string testDataPath(AZURE_TEST_DATA_PATH);
|
||||
@ -573,7 +653,11 @@ namespace Azure { namespace Core { namespace Test {
|
||||
}
|
||||
}
|
||||
|
||||
#if _azure_DISABLE_HTTP_BIN_TESTS
|
||||
TEST_P(TransportAdapter, DISABLED_SizePutFromFileDefault)
|
||||
#else
|
||||
TEST_P(TransportAdapter, SizePutFromFileDefault)
|
||||
#endif
|
||||
{
|
||||
Azure::Core::Url host(AzureSdkHttpbinServer::Put());
|
||||
std::string testDataPath(AZURE_TEST_DATA_PATH);
|
||||
@ -599,7 +683,11 @@ namespace Azure { namespace Core { namespace Test {
|
||||
}
|
||||
}
|
||||
|
||||
#if _azure_DISABLE_HTTP_BIN_TESTS
|
||||
TEST_P(TransportAdapter, DISABLED_SizePutFromFileBiggerPage)
|
||||
#else
|
||||
TEST_P(TransportAdapter, SizePutFromFileBiggerPage)
|
||||
#endif
|
||||
{
|
||||
Azure::Core::Url host(AzureSdkHttpbinServer::Put());
|
||||
std::string testDataPath(AZURE_TEST_DATA_PATH);
|
||||
@ -683,5 +771,4 @@ namespace Azure { namespace Core { namespace Test {
|
||||
EXPECT_STREQ(expectedBody.data(), bodyString.data());
|
||||
}
|
||||
}
|
||||
|
||||
}}} // namespace Azure::Core::Test
|
||||
|
||||
@ -12,12 +12,17 @@
|
||||
#include <azure/core/http/http.hpp>
|
||||
#include <azure/core/internal/http/pipeline.hpp>
|
||||
#include <azure/core/io/body_stream.hpp>
|
||||
#include <azure/core/platform.hpp>
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#if defined(AZ_PLATFORM_MAC)
|
||||
#define _azure_DISABLE_HTTP_BIN_TESTS 1
|
||||
#endif
|
||||
|
||||
namespace Azure { namespace Core { namespace Test {
|
||||
|
||||
namespace _detail {
|
||||
|
||||
@ -13,6 +13,7 @@
|
||||
#include "azure/core/internal/json/json.hpp"
|
||||
#include "azure/core/platform.hpp"
|
||||
#include "azure/core/response.hpp"
|
||||
#include "transport_adapter_base_test.hpp"
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
@ -23,10 +24,6 @@
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
namespace Azure { namespace Core { namespace Test {
|
||||
namespace {
|
||||
constexpr static const char AzureSdkHttpbinServerSchema[] = "https";
|
||||
constexpr static const char AzureSdkHttpbinHost[] = "azuresdkforcpp.azurewebsites.net";
|
||||
} // namespace
|
||||
class TransportAdapterOptions : public ::testing::Test {
|
||||
|
||||
public:
|
||||
@ -34,36 +31,39 @@ namespace Azure { namespace Core { namespace Test {
|
||||
{
|
||||
inline static std::string Get()
|
||||
{
|
||||
return std::string(AzureSdkHttpbinServerSchema) + "://" + std::string(AzureSdkHttpbinHost)
|
||||
+ "/get";
|
||||
return std::string(_detail::AzureSdkHttpbinServerSchema) + "://"
|
||||
+ std::string(_detail::AzureSdkHttpbinServer) + "/get";
|
||||
}
|
||||
inline static std::string Headers()
|
||||
{
|
||||
return std::string(AzureSdkHttpbinServerSchema) + "://" + std::string(AzureSdkHttpbinHost)
|
||||
+ "/headers";
|
||||
return std::string(_detail::AzureSdkHttpbinServerSchema) + "://"
|
||||
+ std::string(_detail::AzureSdkHttpbinServer) + "/headers";
|
||||
}
|
||||
inline static std::string WithPort()
|
||||
{
|
||||
return std::string(AzureSdkHttpbinServerSchema) + "://" + std::string(AzureSdkHttpbinHost)
|
||||
+ ":443/get";
|
||||
return std::string(_detail::AzureSdkHttpbinServerSchema) + "://"
|
||||
+ std::string(_detail::AzureSdkHttpbinServer) + ":443/get";
|
||||
}
|
||||
inline static std::string Put()
|
||||
{
|
||||
return std::string(AzureSdkHttpbinServerSchema) + "://" + std::string(AzureSdkHttpbinHost)
|
||||
+ "/put";
|
||||
return std::string(_detail::AzureSdkHttpbinServerSchema) + "://"
|
||||
+ std::string(_detail::AzureSdkHttpbinServer) + "/put";
|
||||
}
|
||||
inline static std::string Delete()
|
||||
{
|
||||
return std::string(AzureSdkHttpbinServerSchema) + "://" + std::string(AzureSdkHttpbinHost)
|
||||
+ "/delete";
|
||||
return std::string(_detail::AzureSdkHttpbinServerSchema) + "://"
|
||||
+ std::string(_detail::AzureSdkHttpbinServer) + "/delete";
|
||||
}
|
||||
inline static std::string Patch()
|
||||
{
|
||||
return std::string(AzureSdkHttpbinServerSchema) + "://" + std::string(AzureSdkHttpbinHost)
|
||||
+ "/patch";
|
||||
return std::string(_detail::AzureSdkHttpbinServerSchema) + "://"
|
||||
+ std::string(_detail::AzureSdkHttpbinServer) + "/patch";
|
||||
}
|
||||
inline static std::string Host() { return std::string(_detail::AzureSdkHttpbinServer); }
|
||||
inline static std::string Schema()
|
||||
{
|
||||
return std::string(_detail::AzureSdkHttpbinServerSchema);
|
||||
}
|
||||
inline static std::string Host() { return std::string(AzureSdkHttpbinHost); }
|
||||
inline static std::string Schema() { return std::string(AzureSdkHttpbinServerSchema); }
|
||||
};
|
||||
|
||||
static Azure::Core::Http::_internal::HttpPipeline CreateHttpPipeline(
|
||||
@ -427,7 +427,11 @@ namespace Azure { namespace Core { namespace Test {
|
||||
|
||||
#endif // defined(ENABLE_PROXY_TESTS)
|
||||
|
||||
#if _azure_DISABLE_HTTP_BIN_TESTS
|
||||
TEST_F(TransportAdapterOptions, DISABLED_DisableCrlValidation)
|
||||
#else
|
||||
TEST_F(TransportAdapterOptions, DisableCrlValidation)
|
||||
#endif
|
||||
{
|
||||
Azure::Core::Url testUrl(AzureSdkHttpbinServer::Get());
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user