Repository navigation
Howie/provision on fly - #49750
Howie/provision on fly#49750Howie Leung (howieleung) wants to merge 48 commits into
Conversation
…ng state - Introduced `GetEnvironmentFileVariables.Tests.ps1` to validate environment variable parsing from .env files. - Added `GetSampleRequiredEnvironmentVariables.Tests.ps1` to ensure required environment variables are correctly identified for samples. - Created `InvokeSampleTest.Integration.Tests.ps1` and `InvokeSampleTest.Tests.ps1` for testing sample execution in various modes, including playback and recording. - Implemented `ResetRecordingState.Tests.ps1` to verify cleanup of recording state and pytest cache. - Developed `ResolveSampleTest.Tests.ps1` to test sample resolution and error handling for ambiguous or missing files. - Added `TestRecordingGitConflicts.Tests.ps1` to check for recording conflicts in git repositories. - Created `TestHelpers.ps1` to provide reusable functions for test setup and synthetic package creation. - Updated `conftest.py` to support command-line options for environment variable configuration.
…rsion to 2.10.0 (#49650)
#49613) * Add comprehensive tests for environment variable handling and recording state - Introduced `GetEnvironmentFileVariables.Tests.ps1` to validate environment variable parsing from .env files. - Added `GetSampleRequiredEnvironmentVariables.Tests.ps1` to ensure required environment variables are correctly identified for samples. - Created `InvokeSampleTest.Integration.Tests.ps1` and `InvokeSampleTest.Tests.ps1` for testing sample execution in various modes, including playback and recording. - Implemented `ResetRecordingState.Tests.ps1` to verify cleanup of recording state and pytest cache. - Developed `ResolveSampleTest.Tests.ps1` to test sample resolution and error handling for ambiguous or missing files. - Added `TestRecordingGitConflicts.Tests.ps1` to check for recording conflicts in git repositories. - Created `TestHelpers.ps1` to provide reusable functions for test setup and synthetic package creation. - Updated `conftest.py` to support command-line options for environment variable configuration. * Update cspell configuration and improve test assertions for multiline values
- Introduced SampleCiHelpers.ps1 for Azure CLI operations and manifest handling. - Created Test-BicepTemplates.ps1 to validate Bicep template compilation. - Added Bicep templates for resource group and sample resources. - Implemented sample-resources.bicepparam for parameter bindings. - Developed run_samples.py to execute pytest nodes against Bicep-created projects. - Added select_samples.py for resolving sample test queries. - Created test_run_samples.py for validating sample test invocation. - Implemented test_select_samples.py for testing sample selection logic. - Included standard-setup.lock.json for dependency management.
…pdate README; add tests for automatic provisioning flow
…viewToolboxTool; add VoiceAgentProfanityFilterMode; update apiHash and CrossLanguageVersion (#49708)
…Azure/azure-sdk-for-python into feature/azure-ai-projects/vnext
…uality parameters in API documentation
There was a problem hiding this comment.
🟡 Changes recommended
Numbered log entries can bypass credential redaction and expose secrets in published attachments, while reused artifact names cause publication failures when jobs rerun in the same build.
2 open issues
What changed in this PR
Adds on-demand live testing for azure-ai-projects samples, provisioning temporary Foundry environments around the existing synchronous and asynchronous test harness.
Changes:
- Selects and distributes samples across up to four workers with identity, quota, provisioning, and cleanup checks.
- Adds shared-identity bootstrap templates and temporary workload infrastructure.
- Adds sanitized log attachments, validation-endpoint handling, documentation, and regression tests.
| File | Description |
|---|---|
sdk/ai/azure-ai-projects/tests/samples/shared-identities/infra/main.bicep |
Creates the permanent identity group and role assignments. |
sdk/ai/azure-ai-projects/tests/samples/shared-identities/infra/IdentityConfiguration.json |
Defines shared identities and required roles. |
sdk/ai/azure-ai-projects/tests/samples/shared-identities/infra/identities.bicep |
Creates and tags managed identities. |
sdk/ai/azure-ai-projects/tests/samples/shared-identities/infra/Deploy-Identities.ps1 |
Previews or deploys shared identity infrastructure. |
sdk/ai/azure-ai-projects/tests/samples/sample_log.py |
Centralizes credential redaction and bounded log writing. |
sdk/ai/azure-ai-projects/tests/samples/sample_executor.py |
Integrates sanitized logs and configurable capture directories. |
sdk/ai/azure-ai-projects/tests/samples/ci/validation/Test-BicepTemplates.ps1 |
Checks compiled infrastructure contracts and source provenance. |
sdk/ai/azure-ai-projects/tests/samples/ci/validation/SamplePreflight.Tests.ps1 |
Tests regional eligibility and quota checks. |
sdk/ai/azure-ai-projects/tests/samples/ci/validation/SampleCiHelpers.Tests.ps1 |
Tests target, ownership, identity, and diagnostic safeguards. |
sdk/ai/azure-ai-projects/tests/samples/ci/validation/Remove-SampleResources.Tests.ps1 |
Tests cleanup confirmation and ownership enforcement. |
sdk/ai/azure-ai-projects/tests/samples/ci/validation/New-SampleDeploymentPlan.Tests.ps1 |
Tests offline planning and unsupported-input rejection. |
sdk/ai/azure-ai-projects/tests/samples/ci/validation/Invoke-SampleProvisioning.Tests.ps1 |
Tests rejection before resource mutation. |
sdk/ai/azure-ai-projects/tests/samples/ci/validation/IdentityResolution.Tests.ps1 |
Tests shared-identity resolution and metadata validation. |
sdk/ai/azure-ai-projects/tests/samples/ci/test_validation_environment.py |
Tests validation-endpoint precedence. |
sdk/ai/azure-ai-projects/tests/samples/ci/test_select_samples.py |
Tests wildcard selection and queue partitioning. |
sdk/ai/azure-ai-projects/tests/samples/ci/test_sample_ci_attachments.py |
Tests redaction and per-result JUnit attachments. |
sdk/ai/azure-ai-projects/tests/samples/ci/test_run_samples.py |
Tests runner arguments, readiness, and environment isolation. |
sdk/ai/azure-ai-projects/tests/samples/ci/test_pipeline.py |
Checks pipeline structure and execution safeguards. |
sdk/ai/azure-ai-projects/tests/samples/ci/select_samples.py |
Collects, selects, and partitions existing sample tests. |
sdk/ai/azure-ai-projects/tests/samples/ci/sample_ci_attachments.py |
Publishes sanitized executor logs through JUnit markers. |
sdk/ai/azure-ai-projects/tests/samples/ci/run_samples.py |
Checks readiness and executes selected live tests. |
sdk/ai/azure-ai-projects/tests/samples/ci/Remove-SampleResources.ps1 |
Deletes verified run-owned temporary resources. |
sdk/ai/azure-ai-projects/tests/samples/ci/README.md |
Documents setup, execution, safety, and maintainer checks. |
sdk/ai/azure-ai-projects/tests/samples/ci/New-SampleDeploymentPlan.ps1 |
Generates queue-bound deployment plans. |
sdk/ai/azure-ai-projects/tests/samples/ci/Invoke-SampleProvisioning.ps1 |
Performs admission checks and provisions workloads. |
sdk/ai/azure-ai-projects/tests/samples/ci/infra/standard-shared-identities.bicep |
Defines Foundry dependencies using existing identities. |
sdk/ai/azure-ai-projects/tests/samples/ci/infra/standard-setup.lock.json |
Pins upstream reference sources and checksums. |
sdk/ai/azure-ai-projects/tests/samples/ci/infra/sample-resources.bicepparam |
Supplies environment-backed deployment parameters. |
sdk/ai/azure-ai-projects/tests/samples/ci/infra/sample-resources.bicep |
Deploys the sample model and GitHub MCP connection. |
sdk/ai/azure-ai-projects/tests/samples/ci/infra/resource-group.bicep |
Creates temporary groups with ownership and expiry tags. |
sdk/ai/azure-ai-projects/tests/conftest.py |
Preserves the environment-supplied validation endpoint. |
sdk/ai/azure-ai-projects/tests.yml |
Orchestrates planning, admission, live tests, cleanup, and results. |
Review effort: Balanced
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
[Pilot] PR Pipeline Failure AnalysisWhat failedAzure DevOps pipeline python - pullrequest (build 7017292) failed in the CSpell spelling validation step for Relevant pipeline output(additional repeated Root causeSeveral new identifiers/technical terms introduced by this PR's sample-provisioning scripts and bicep infra files (e.g. Recommended next steps
Automated fix: Requested
|
The base branch was changed.
There was a problem hiding this comment.
🟡 Changes recommended
Live sample output validation targets the sanitized playback URL instead of the configured project because pytest CLI mode overwrites the endpoint passed through the environment.
1 open issue
2 resolved since last review
Review effort: Balanced
| environment = os.environ.copy() | ||
| environment.update(state["environment"]) |
There was a problem hiding this comment.
🔵 Needs a closer look
The pytest configuration hook overwrites the environment-provided validation endpoint with a sanitized default, causing both default samples to attempt validation against a placeholder after provisioning billable resources.
Review effort: Balanced
6350435 to
7e1f9b7
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
The pytest configure hook overwrites the environment-supplied validation endpoint with a sanitized placeholder, causing both sample validators to target the wrong endpoint even in correctly configured live runs.
Review effort: Balanced
7e1f9b7 to
b5410d6
Compare
b5410d6 to
635b121
Compare


Description
Please add an informative description that covers that changes made by the pull request and link all relevant issues.
If an SDK is being regenerated based on a new API spec, a link to the pull request containing these API spec changes should be included above.
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines