Commit e71cd95
[azure-ai-ml] Add generated integration tests and test infrastructure for coverage improvement (#45967)
* Add auto-generated live integration tests for azure-ai-ml operations
Generated 151 live integration tests across 22 files targeting coverage
gaps in the azure-ai-ml operations layer. Tests use AzureRecordedTestCase,
@pytest.mark.e2etest markers, and make real Azure service calls.
Generated by test-gen tool with gpt-5-mini model covering 20 source files:
- Workspace, Job, Model, Component, Environment operations
- Data, Datastore, Schedule, Deployment operations
- Endpoint, Feature Store, MLClient operations
Results: 128 passed, 5 failed, 14 skipped (87% pass rate)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix 5 failing generated tests
- test_model_operations_gaps: Use correct evaluator properties
('is-evaluator'/'is-promptflow' == 'true') instead of '__is_evaluator'
- test_schedule_gaps: Remove Z-suffix from datetime strings (service
rejects it) and update start_time to recent past
- test_workspace_operations_base_gaps_additional: Replace hub/project
creation (>120s timeout) with get() on existing workspace
All 5 previously-failing tests now pass.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Improve test quality: dedup, remove dead tests, fix exception types
Quality improvements across 12 generated test files:
- Remove 17 duplicate method names (renamed with descriptive suffixes)
- Delete 6 always-skipped tests in batch_deployment_ops (zero value)
- Delete 1 always-skip test in capability_hosts_ops
- Remove broken test (create_or_update doesn't raise for validation)
- Replace 12 broad pytest.raises(Exception) with specific types:
ValidationException, ResourceNotFoundError, HttpResponseError,
UserErrorException, AssertionError, MlException
- Clean up unused imports and duplicate class definitions
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix playback compatibility for recorded tests
- Replace uuid.uuid4() with rand_online_name/rand_batch_name fixtures
for deterministic name generation via VariableRecorder
- Replace datetime.now() with hardcoded far-future dates in schedule
tests to avoid timestamp mismatches between recording and playback
- Add is_live() skip guards for tests that require real credentials:
JWT token decoding, credential type checks, key regeneration
- Fix experiment_name to be deterministic in pipeline job tests
Playback results: 120 passed, 0 failed, 21 skipped
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Add registry, ADLS Gen2, Redis, and identity to test-resources template
Add infrastructure resources needed for comprehensive test coverage:
- Azure ML Registry for model/component sharing tests
- ADLS Gen2 storage account (HNS enabled) for feature store offline store
- Azure Cache for Redis for feature store online store
- User-assigned managed identity for test operations
- Corresponding parameters and outputs for all new resources
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Update assets.json tag with gap test recordings
Tag: python/ml/azure-ai-ml_0f205ad0cc
167 sanitized recordings for generated integration tests.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix f-string syntax error incompatible with Python 3.10
Replace nested double quotes in f-string on line 62 of
test_job_operations_gaps.py with a plain string literal.
Python 3.10 does not support nested quotes in f-strings
(PEP 701 was added in 3.12), causing a SyntaxError at
collection time that blocks all tests.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Address PR review feedback from Copilot reviewer
- Use tmp_path fixture for data_missing_path.yaml instead of CWD
(test_data_operations_gaps.py)
- Await .result() on delete LRO pollers to prevent resource leaks
(test_online_deployment_operations_gaps.py, test_batch_deployment_operations_gaps.py)
- Import MLClient from public azure.ai.ml instead of private _ml_client
(test_online_endpoint_operations_gaps.py)
- Move mid-file imports to top-level import section
(test_job_ops_helper_gaps.py)
- Narrow meaningless isinstance(err, (HttpResponseError, Exception))
assertion to just HttpResponseError
(test_batch_deployment_operations_gaps.py)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Merge recording tags from main and PR branch
Merged assets tags python/ml/azure-ai-ml_0f205ad0cc (gap test recordings)
and python/ml/azure-ai-ml_1e2cb117b2 (latest main) into new combined tag
python/ml/azure-ai-ml_d0dbceadc6 using test-proxy tag-merge tooling.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* removed recorded tag for tests that are purely unit tests
* Re-record gap tests, add key sanitizers, fix playback for BasicProperties
- Re-recorded all 22 gap test files against live TME resources
- Added body key sanitizers for keyValue, primaryKey, secondaryKey to
prevent secrets from leaking into recordings
- Fixed TestJobOperationsBasicProperties: added recorded_test fixture
and AzureRecordedTestCase base class so tests go through test proxy
in playback mode
- All 120 tests pass in playback, 134 pass live, 0 failures
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Fix git code path test: explicitly disable private preview
The test_validate_git_code_path_rejected_when_private_preview_disabled
test was failing in CI because prior tests in the session enable the
AZURE_ML_CLI_PRIVATE_FEATURES_ENABLED env var, which causes
is_private_preview_enabled() to return True and skip the git-code
validation. Fix by explicitly patching the env var to 'False' within
the test.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Restore 106 pre-existing recordings corrupted by TME workspace re-recording
The original live recording session re-recorded not just the new gap tests
but also 106 pre-existing tests against a TME workspace that lacks
Singularity clusters, managed datastores, and pre-registered components.
This caused playback failures for tests like test_command_job_with_singularity,
test_data_auto_delete_setting, test_distribution_components, etc.
Fix: restore those 106 recordings from the main branch tag.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Run black on gap test files
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chore: delete 15 low-quality generated test files
Remove gap test files that only contain hasattr() checks, assert True,
importlib.import_module, dir() reflection, or import-only smoke tests.
These tests cover zero branches and add maintenance burden.
Kept 7 high-quality files with real API calls and assertions:
- test_datastore_operations_gaps.py (11 tests)
- test_feature_store_operations_gaps.py (11 tests)
- test_job_operations_gaps.py (9 tests)
- test_job_operations_gaps_basic_props.py (10 tests)
- test_online_endpoint_operations_gaps.py (9 tests)
- test_schedule_gaps.py (2 tests)
- test_workspace_operations_base_gaps_additional.py (1 test)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Kashif Khan <kashifkhan@microsoft.com>
Co-authored-by: Deyaa Eldeen <deyaaeldeen@users.noreply.github.com>1 parent 83a443d commit e71cd95
9 files changed
Lines changed: 1252 additions & 1 deletion
File tree
- sdk/ml
- azure-ai-ml
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
Lines changed: 154 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
Lines changed: 211 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
0 commit comments