Skip to content

Commit 0400f4e

Browse files
Merge pull request #18 from khushishah513/function-tests
tests for keys and invocations commands
2 parents c4e7c37 + dafd802 commit 0400f4e

34 files changed

+34808
-13515
lines changed

src/containerapp/azext_containerapp/_clients.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ def get_function_invocation_traces(cls, cmd, resource_group_name, container_app_
409409
invocation_traces_query = (
410410
f"requests | extend functionNameFromCustomDimension = tostring(customDimensions['faas.name']) "
411411
f"| project timestamp, id, operation_Name, success, resultCode, duration, operation_Id, functionNameFromCustomDimension, "
412-
f"cloud_RoleName, invocationId=coalesce(tostring(customDimensions['InvocationId']), tostring(customDimensions['faas.invocation_id'])) "
412+
f"cloud_RoleName, cloud_RoleInstance, invocationId=coalesce(tostring(customDimensions['InvocationId']), tostring(customDimensions['faas.invocation_id'])) "
413413
f"| where timestamp > ago({timespan}) "
414414
f"| where cloud_RoleName =~ '{container_app_name}' "
415415
f"| where cloud_RoleInstance contains '{revision_name}' "

src/containerapp/azext_containerapp/_params.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -533,8 +533,8 @@ def load_arguments(self, _):
533533
c.argument('resource_group_name', arg_type=resource_group_name_type, id_part=None)
534534
c.argument('name', options_list=['--name', '-n'], help="The name of the managed environment.")
535535
c.argument('workload_profile_name', options_list=['--workload-profile-name', '-w'], help="The workload profile to run ingress replicas on. This profile must not be shared with any container app or job.")
536-
c.argument('min_replicas', options_list=['--min-replicas'], type=int, deprecate_info=c.deprecate(hide=True, expiration='2.78.0'), help="The workload profile minimum instances is used instead.")
537-
c.argument('max_replicas', options_list=['--max-replicas'], type=int, deprecate_info=c.deprecate(hide=True, expiration='2.78.0'), help="The workload profile maximum instances is used instead.")
536+
c.argument('min_replicas', options_list=['--min-replicas'], type=int, deprecate_info=c.deprecate(hide=True, expiration='2.79.0'), help="The workload profile minimum instances is used instead.")
537+
c.argument('max_replicas', options_list=['--max-replicas'], type=int, deprecate_info=c.deprecate(hide=True, expiration='2.79.0'), help="The workload profile maximum instances is used instead.")
538538
c.argument('termination_grace_period', options_list=['--termination-grace-period', '-t'], type=int, help="Time in seconds to drain requests during ingress shutdown. Default 500, minimum 0, maximum 3600.")
539539
c.argument('request_idle_timeout', options_list=['--request-idle-timeout'], type=int, help="Timeout in minutes for idle requests. Default 4, minimum 4, maximum 30.")
540540
c.argument('header_count_limit', options_list=['--header-count-limit'], type=int, help="Limit of http headers per request. Default 100, minimum 1.")

src/containerapp/azext_containerapp/_validators.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,9 +346,8 @@ def validate_functionapp_kind(cmd, resource_group_name, container_app_name):
346346
)
347347

348348
kind = safe_get(containerapp_def, "kind")
349-
managed_by = safe_get(containerapp_def, "managedBy")
350349

351-
if (managed_by and "providers/microsoft.web/sites" in managed_by.lower()) or (kind and kind.lower() == "functionapp"):
350+
if kind and kind.lower() == "functionapp":
352351
logger.debug("Container app '%s' validated as Azure Function App", container_app_name)
353352
return
354353

src/containerapp/azext_containerapp/tests/latest/recordings/test_container_app_mount_azurefile_e2e.yaml

Lines changed: 2409 additions & 1759 deletions
Large diffs are not rendered by default.

src/containerapp/azext_containerapp/tests/latest/recordings/test_container_app_mount_nfsazurefile_e2e.yaml

Lines changed: 2027 additions & 1855 deletions
Large diffs are not rendered by default.

src/containerapp/azext_containerapp/tests/latest/recordings/test_containerapp_env_logs_e2e.yaml

Lines changed: 4409 additions & 3408 deletions
Large diffs are not rendered by default.

src/containerapp/azext_containerapp/tests/latest/recordings/test_containerapp_env_msi_certificate.yaml

Lines changed: 1513 additions & 1167 deletions
Large diffs are not rendered by default.

src/containerapp/azext_containerapp/tests/latest/recordings/test_containerapp_env_msi_custom_domains.yaml

Lines changed: 1676 additions & 1584 deletions
Large diffs are not rendered by default.

src/containerapp/azext_containerapp/tests/latest/recordings/test_containerapp_function_invocations_summary_traces.yaml

Lines changed: 7578 additions & 0 deletions
Large diffs are not rendered by default.

src/containerapp/azext_containerapp/tests/latest/recordings/test_containerapp_function_keys.yaml

Lines changed: 7588 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)