Skip to content

Integration test: add log-level control for all-types run and switch default region to centralus#73

Closed
EMaher wants to merge 1 commit into
mainfrom
copilot/verify-integration-test-premium-sku
Closed

Integration test: add log-level control for all-types run and switch default region to centralus#73
EMaher wants to merge 1 commit into
mainfrom
copilot/verify-integration-test-premium-sku

Conversation

@EMaher
Copy link
Copy Markdown
Contributor

@EMaher EMaher commented May 19, 2026

This pull request introduces significant improvements to the integration test infrastructure, focusing on enhanced logging, improved security through sensitive data masking, and better deployment reliability for Azure API Management (APIM) resources. The changes add log level controls, ensure sensitive values are masked in logs and outputs, provide more robust error reporting, and automate additional steps for APIM Classic SKUs. Additionally, new helper modules are introduced, and existing scripts are refactored for clarity and maintainability.

Key changes include:

Logging and Security Enhancements

  • Added a log_level input to the GitHub Actions workflow (integration-test.yml) and corresponding support in deployment scripts, allowing Info, Verbose, or Debug output for easier troubleshooting and more granular logging. The default region was also updated to centralus. [1] [2] [3] [4] [5] [6]
  • All sensitive identifiers (subscription IDs, resource group names, APIM names) are now masked in logs and command outputs using new or updated helper functions. This is reflected in both deployment scripts and the printed example commands. [1] [2] [3] [4]

Deployment Reliability and Automation

  • Added a new module, DeploymentHelpers.psm1, providing Write-DeploymentFailureDetails for detailed error reporting and Wait-ApimActivation to ensure APIM is fully provisioned before proceeding. These are used in both source and target APIM deployment scripts for more robust automation and diagnostics. [1] [2] [3]
  • The source APIM deployment script now automatically creates a policyRestriction for Classic SKUs (Developer, Premium) after deployment, ensuring the environment matches expected test requirements.

New and Refactored Scripts

  • Introduced Deploy-TargetApim.ps1 for deploying the target APIM instance, following the same best practices as the source deployment script: parameter validation, log level control, and sensitive data masking.
  • Added Microsoft.AlertsManagement to the list of required resource providers for APIM deployments, improving compatibility with newer features.

Documentation and Learnings

  • Updated .squad/agents/securityexpert/history.md and .squad/agents/testengineer/history.md with new learnings about PowerShell logging, Azure async-operation masking, and technical gotchas for future development. [1] [2]
  • Added research notes on policyRestrictions.scope grammar and validation to .squad/agents/apimexpert/history.md.

These improvements collectively make the integration test infrastructure more secure, maintainable, and developer-friendly, while also providing a better foundation for debugging and future enhancements.The all-types integration run was failing in Premium validation scenarios, and the workflow needed better diagnostics plus a region default aligned with SKU availability. This updates the integration workflow/script contract to support explicit log verbosity and sets region defaults to centralus.

  • Workflow contract updates (.github/workflows/integration-test.yml)

    • Added log_level input (Info / Verbose / Debug), defaulting to Verbose.
    • Passed log_level through to run-roundtrip-test.ps1.
    • Changed default location from eastus2 to centralus for both workflow_dispatch and workflow_call.
    • Added runtime guardrails to reject invalid log_level values early.
  • All-types orchestrator updates (tests/integration/all-resource-types/run-roundtrip-test.ps1)

    • Added LogLevel parameter with ValidateSet('Info','Verbose','Debug'), default Verbose.
    • Wired log-level behavior to $VerbosePreference / $DebugPreference.
    • Propagated log-level intent into subordinate script invocations (Deploy-SourceApim.ps1, artifact validation, APIM compare) so diagnostics are consistent across phases.
  • Docs alignment (tests/integration/all-resource-types/README.md)

    • Updated default region references to centralus.
    • Documented the new log-level option and defaults for manual workflow usage.
# integration-test.yml (workflow input)
log_level:
  description: 'PowerShell log level (Info, Verbose, Debug)'
  required: false
  type: string
  default: Verbose

@EMaher EMaher marked this pull request as draft May 19, 2026 18:44
@EMaher EMaher marked this pull request as ready for review May 20, 2026 03:12
@EMaher EMaher requested a review from petehauge May 20, 2026 03:13
@EMaher EMaher force-pushed the copilot/verify-integration-test-premium-sku branch from 9ddd52d to efe1b74 Compare May 20, 2026 16:08
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this log file be included in the PR?

@EMaher EMaher marked this pull request as draft May 21, 2026 22:07
Agent-Logs-Url: https://github.com/Azure/apiops-cli/sessions/08964b6c-4c8a-4dda-bcb9-17322e0e16bb

Co-authored-by: EMaher <9244742+EMaher@users.noreply.github.com>
@EMaher EMaher force-pushed the copilot/verify-integration-test-premium-sku branch from a14e834 to 525913a Compare May 22, 2026 06:03
@EMaher EMaher closed this May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants