From 8748c76034ab156eac23d20d601d794574935f04 Mon Sep 17 00:00:00 2001 From: apmmachine Date: Fri, 13 Jan 2023 07:30:07 +0000 Subject: [PATCH] test: synchronizing gherkin specs --- .../features/azure_functions_metadata.feature | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 tests/bdd/features/azure_functions_metadata.feature diff --git a/tests/bdd/features/azure_functions_metadata.feature b/tests/bdd/features/azure_functions_metadata.feature new file mode 100644 index 000000000..aabb10d6f --- /dev/null +++ b/tests/bdd/features/azure_functions_metadata.feature @@ -0,0 +1,70 @@ +Feature: Extracting Metadata for Azure Function Apps + + Background: + Given an agent configured with + | setting | value | + | cloud_provider | azure | + + Scenario Outline: Azure Function App with minimum set of environment variables present in expected format + Given the following environment variables are present + | name | value | + | FUNCTIONS_EXTENSION_VERSION | version | + | WEBSITE_OWNER_NAME | d2cd53b3-acdc-4964-9563-3f5201556a81+faas_group-CentralUSwebspace-Linux | + | WEBSITE_SITE_NAME | site_name | + When cloud metadata is collected + Then cloud metadata is not null + And cloud metadata 'account.id' is 'd2cd53b3-acdc-4964-9563-3f5201556a81' + And cloud metadata 'provider' is 'azure' + And cloud metadata 'service.name' is 'functions' + And cloud metadata 'instance.name' is 'site_name' + And cloud metadata 'project.name' is 'faas_group' + And cloud metadata 'region' is 'CentralUS' + + Scenario Outline: Azure Function App with typical set of environment variables present in expected format + Given the following environment variables are present + | name | value | + | FUNCTIONS_EXTENSION_VERSION | version | + | WEBSITE_OWNER_NAME | d2cd53b3-acdc-4964-9563-3f5201556a81+faas_group-CentralUSwebspace-Linux | + | WEBSITE_SITE_NAME | site_name | + | REGION_NAME | Central US | + | WEBSITE_RESOURCE_GROUP | faas_group_from_env | + When cloud metadata is collected + Then cloud metadata is not null + And cloud metadata 'account.id' is 'd2cd53b3-acdc-4964-9563-3f5201556a81' + And cloud metadata 'provider' is 'azure' + And cloud metadata 'service.name' is 'functions' + And cloud metadata 'instance.name' is 'site_name' + And cloud metadata 'project.name' is 'faas_group_from_env' + And cloud metadata 'region' is 'Central US' + + Scenario: WEBSITE_OWNER_NAME environment variable not expected format + Given the following environment variables are present + | name | value | + | WEBSITE_OWNER_NAME | d2cd53b3-acdc-4964-9563-3f5201556a81-faas_group-CentralUSwebspace-Linux | + | WEBSITE_SITE_NAME | site_name | + When cloud metadata is collected + Then cloud metadata is null + + Scenario: Missing FUNCTIONS_EXTENSION_VERSION environment variable + Given the following environment variables are present + | name | value | + | WEBSITE_OWNER_NAME | d2cd53b3-acdc-4964-9563-3f5201556a81+faas_group-CentralUSwebspace-Linux | + | WEBSITE_SITE_NAME | site_name | + When cloud metadata is collected + Then cloud metadata is null + + Scenario: Missing WEBSITE_OWNER_NAME environment variable + Given the following environment variables are present + | name | value | + | FUNCTIONS_EXTENSION_VERSION | version | + | WEBSITE_SITE_NAME | site_name | + When cloud metadata is collected + Then cloud metadata is null + + Scenario: Missing WEBSITE_SITE_NAME environment variable + Given the following environment variables are present + | name | value | + | FUNCTIONS_EXTENSION_VERSION | version | + | WEBSITE_OWNER_NAME | d2cd53b3-acdc-4964-9563-3f5201556a81+faas_group-CentralUSwebspace-Linux | + When cloud metadata is collected + Then cloud metadata is null