Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,22 @@


class ContainerappFunctionTests(ScenarioTest):
@classmethod
def setUpClass(cls):
super().setUpClass()
# Install application-insights extension if not already installed
try:
result = run(['az', 'extension', 'show', '--name', 'application-insights'],
capture_output=True, text=True)
if result.returncode != 0:
cmd = ['azdev', 'extension', 'add', 'application-insights']
run(cmd, check=True)
sleep(120)
except Exception:
pass
Comment on lines +42 to +43
Copy link

Copilot AI Jan 29, 2026

Choose a reason for hiding this comment

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

Catching a broad Exception here and silently doing nothing can hide legitimate setup problems (e.g. az/azdev not being available or the extension add failing) and make later test failures harder to diagnose. Consider narrowing the exception to the specific failure modes you expect (such as subprocess.CalledProcessError / FileNotFoundError) and at least logging a message when extension installation is skipped or fails.

Copilot uses AI. Check for mistakes.

def __init__(self, *arg, **kwargs):
super().__init__(*arg, random_config_dir=True, **kwargs)
cmd = ['azdev', 'extension', 'add', 'application-insights']
run(cmd, check=True)
sleep(120)


@AllowLargeResponse(8192)
Expand Down
Loading