Skip to content

Commit 55eaba6

Browse files
authored
Fix failing ACA apps when run together (#9561)
1 parent f2c7aa1 commit 55eaba6

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

src/containerapp/azext_containerapp/tests/latest/test_containerapp_function.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,22 @@
2828

2929

3030
class ContainerappFunctionTests(ScenarioTest):
31+
@classmethod
32+
def setUpClass(cls):
33+
super().setUpClass()
34+
# Install application-insights extension if not already installed
35+
try:
36+
result = run(['az', 'extension', 'show', '--name', 'application-insights'],
37+
capture_output=True, text=True)
38+
if result.returncode != 0:
39+
cmd = ['azdev', 'extension', 'add', 'application-insights']
40+
run(cmd, check=True)
41+
sleep(120)
42+
except Exception:
43+
pass
44+
3145
def __init__(self, *arg, **kwargs):
3246
super().__init__(*arg, random_config_dir=True, **kwargs)
33-
cmd = ['azdev', 'extension', 'add', 'application-insights']
34-
run(cmd, check=True)
35-
sleep(120)
3647

3748

3849
@AllowLargeResponse(8192)

0 commit comments

Comments
 (0)