Skip to content

Commit 51a0414

Browse files
committed
Fix CI/CD: Add @live_only decorator to bicep scenario tests
- Add @live_only() decorator to BicepTemplateSizeOptimizationScenarioTest methods - Aligns with existing bicep test patterns (test_bicep_generate_params_*, test_bicep_lint_*, etc.) - Prevents Bicep CLI dependency issues in CI/CD playback mode - Removes redundant import statements (tempfile, os already imported at module level) - Unit tests continue to run in CI/CD ensuring core functionality validation
1 parent 5e12fa0 commit 51a0414

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/azure-cli/azure/cli/command_modules/resource/tests/latest/test_resource_custom.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -884,6 +884,7 @@ class BicepTemplateSizeOptimizationScenarioTest(ScenarioTest):
884884
correctly in real deployment scenarios and generates recordings for CI/CD.
885885
"""
886886

887+
@live_only()
887888
@ResourceGroupPreparer(name_prefix='cli_test_bicep_size_opt')
888889
def test_bicep_deployment_size_optimization(self, resource_group):
889890
"""Test that bicep deployments work correctly with size optimization.
@@ -924,8 +925,6 @@ def test_bicep_deployment_size_optimization(self, resource_group):
924925
'''
925926

926927
# Create a temporary bicep file
927-
import tempfile
928-
import os
929928
with tempfile.NamedTemporaryFile(mode='w', suffix='.bicep', delete=False) as f:
930929
f.write(bicep_content)
931930
bicep_file_path = f.name
@@ -955,6 +954,7 @@ def test_bicep_deployment_size_optimization(self, resource_group):
955954
if os.path.exists(bicep_file_path):
956955
os.unlink(bicep_file_path)
957956

957+
@live_only()
958958
@ResourceGroupPreparer(name_prefix='cli_test_bicep_vs_arm_opt')
959959
def test_bicep_vs_arm_template_deployment(self, resource_group):
960960
"""Test both bicep and ARM template deployments work correctly.
@@ -1037,9 +1037,6 @@ def test_bicep_vs_arm_template_deployment(self, resource_group):
10371037
}
10381038
}'''
10391039

1040-
import tempfile
1041-
import os
1042-
10431040
# Create temporary files
10441041
with tempfile.NamedTemporaryFile(mode='w', suffix='.bicep', delete=False) as f:
10451042
f.write(bicep_content)

0 commit comments

Comments
 (0)