Skip to content

Commit

Permalink
Fixed a boneheaded mistake...
Browse files Browse the repository at this point in the history
  • Loading branch information
tippmar-nr committed Oct 10, 2024
1 parent 25311f9 commit e0b2e0f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/Agent/NewRelic/Profiler/Configuration/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ namespace NewRelic { namespace Profiler { namespace Configuration {

bool IsAzureFunctionModeEnabled() const
{
auto azureFunctionModeEnabled = _systemCalls->TryGetEnvironmentVariable(_X("AZURE_FUNCTION_MODE_ENABLED"));
auto azureFunctionModeEnabled = _systemCalls->TryGetEnvironmentVariable(_X("NEW_RELIC_AZURE_FUNCTION_MODE_ENABLED"));

if (azureFunctionModeEnabled == nullptr || azureFunctionModeEnabled->length() == 0) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ namespace NewRelic { namespace Profiler { namespace Configuration { namespace Te
}

// tests to verify that "legacy" behavior (before azure function support) is retained.
// If AZURE_FUNCTION_MODE_ENABLED environment variable is not set or is set to false,
// If NEW_RELIC_AZURE_FUNCTION_MODE_ENABLED environment variable is not set or is set to false,
// we should behave as if no azure function support has been added.
TEST_METHOD(azure_function_should_behave_as_legacy_if_azure_function_mode_not_specified)
{
Expand All @@ -94,7 +94,7 @@ namespace NewRelic { namespace Profiler { namespace Configuration { namespace Te
}

// tests to verify that "legacy" behavior (before azure function support) is retained.
// If AZURE_FUNCTION_MODE_ENABLED environment variable is not set or is set to false,
// If NEW_RELIC_AZURE_FUNCTION_MODE_ENABLED environment variable is not set or is set to false,
// we should behave as if no azure function support has been added.
TEST_METHOD(azure_function_should_behave_as_legacy_if_azure_function_mode_disabled)
{
Expand All @@ -107,7 +107,7 @@ namespace NewRelic { namespace Profiler { namespace Configuration { namespace Te

auto systemCalls = std::make_shared<NewRelic::Profiler::Logger::Test::SystemCalls>();
systemCalls->environmentVariables[L"FUNCTIONS_WORKER_RUNTIME"] = L"dotnet-isolated";
systemCalls->environmentVariables[L"AZURE_FUNCTION_MODE_ENABLED"] = L"0";
systemCalls->environmentVariables[L"NEW_RELIC_AZURE_FUNCTION_MODE_ENABLED"] = L"0";

Configuration configuration(configurationXml, _missingConfig, L"", systemCalls);

Expand All @@ -125,7 +125,7 @@ namespace NewRelic { namespace Profiler { namespace Configuration { namespace Te

auto systemCalls = std::make_shared<NewRelic::Profiler::Logger::Test::SystemCalls>();
systemCalls->environmentVariables[L"FUNCTIONS_WORKER_RUNTIME"] = L"dotnet-isolated";
systemCalls->environmentVariables[L"AZURE_FUNCTION_MODE_ENABLED"] = L"true";
systemCalls->environmentVariables[L"NEW_RELIC_AZURE_FUNCTION_MODE_ENABLED"] = L"true";

Configuration configuration(configurationXml, _missingConfig, L"", systemCalls);

Expand All @@ -143,7 +143,7 @@ namespace NewRelic { namespace Profiler { namespace Configuration { namespace Te

auto systemCalls = std::make_shared<NewRelic::Profiler::Logger::Test::SystemCalls>();
systemCalls->environmentVariables[L"FUNCTIONS_WORKER_RUNTIME"] = L"dotnet-isolated";
systemCalls->environmentVariables[L"AZURE_FUNCTION_MODE_ENABLED"] = L"true";
systemCalls->environmentVariables[L"NEW_RELIC_AZURE_FUNCTION_MODE_ENABLED"] = L"true";

Configuration configuration(configurationXml, _missingConfig, L"", systemCalls);

Expand All @@ -161,7 +161,7 @@ namespace NewRelic { namespace Profiler { namespace Configuration { namespace Te

auto systemCalls = std::make_shared<NewRelic::Profiler::Logger::Test::SystemCalls>();
systemCalls->environmentVariables[L"FUNCTIONS_WORKER_RUNTIME"] = L"dotnet-isolated";
systemCalls->environmentVariables[L"AZURE_FUNCTION_MODE_ENABLED"] = L"true";
systemCalls->environmentVariables[L"NEW_RELIC_AZURE_FUNCTION_MODE_ENABLED"] = L"true";

Configuration configuration(configurationXml, _missingConfig, L"", systemCalls);

Expand All @@ -179,7 +179,7 @@ namespace NewRelic { namespace Profiler { namespace Configuration { namespace Te

auto systemCalls = std::make_shared<NewRelic::Profiler::Logger::Test::SystemCalls>();
systemCalls->environmentVariables[L"FUNCTIONS_WORKER_RUNTIME"] = L"dotnet-isolated";
systemCalls->environmentVariables[L"AZURE_FUNCTION_MODE_ENABLED"] = L"true";
systemCalls->environmentVariables[L"NEW_RELIC_AZURE_FUNCTION_MODE_ENABLED"] = L"true";

Configuration configuration(configurationXml, _missingConfig, L"", systemCalls);

Expand Down

0 comments on commit e0b2e0f

Please sign in to comment.