Skip to content

WIP: ci: add tests for cw logs #621

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
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
12 changes: 12 additions & 0 deletions tests/integrations/aws_lambda/test_aws.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import base64
import json
import os
import re
import shutil
import subprocess
import sys
Expand Down Expand Up @@ -145,6 +146,17 @@ def test_handler(event, context):
assert exception["mechanism"] == {"type": "aws_lambda", "handled": False}

assert event["extra"]["lambda"]["function_name"].startswith("test_function_")
assert event["extra"]["cloudwatch logs"]["url"].startswith(
"https://console.aws.amazon.com/cloudwatch/home?region="
)
assert event["extra"]["cloudwatch logs"]["url"]["log_group"].startswith(
"/aws/lambda/test_function_"
)

log_group_re = "^[0-9]{4}/[0-9]{2}/[0-9]{2}/\\[[^\\]]+][a-f0-9]+$"
log_group = event["extra"]["cloudwatch logs"]["url"]["log_stream"]

assert re.match(log_group_re, log_group)


def test_initialization_order(run_lambda_function):
Expand Down