Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
2f051a6
add trigger event span tags
DylanLovesCoffee Dec 8, 2020
d6fbf3e
add tests and sample events
DylanLovesCoffee Dec 8, 2020
ce92c3f
Merge branch 'master' into dylan/trigger-tags
DylanLovesCoffee Dec 8, 2020
64fb4ec
update snapshots
DylanLovesCoffee Dec 8, 2020
080f007
lint
DylanLovesCoffee Dec 8, 2020
1d611c0
implement feedback
DylanLovesCoffee Dec 10, 2020
d83ee4e
refactor adding tags
DylanLovesCoffee Dec 11, 2020
b840c3d
black
DylanLovesCoffee Dec 11, 2020
d731561
include alb for http tags
DylanLovesCoffee Dec 14, 2020
15c4610
add s3 test
DylanLovesCoffee Dec 17, 2020
ec51ccd
nits and add CN and Gov arn regions
DylanLovesCoffee Dec 22, 2020
f275936
always add trigger tags to xray subseg
DylanLovesCoffee Dec 22, 2020
9cfaedc
implement feedback
DylanLovesCoffee Dec 24, 2020
1965908
handle Lambda response status code
DylanLovesCoffee Dec 28, 2020
e680aff
renaming for specificity
DylanLovesCoffee Dec 28, 2020
c0bc254
carry response status_code to xray
DylanLovesCoffee Jan 4, 2021
eaa952d
cleanup
DylanLovesCoffee Jan 4, 2021
195a6aa
fix merge conflicts
DylanLovesCoffee Jan 7, 2021
369bdfc
add xray dummy subsegment for trigger tags at end of invocation
DylanLovesCoffee Jan 8, 2021
79140cf
rename trigger tag and update snapshots
DylanLovesCoffee Jan 20, 2021
a02c289
lint EOF extra line
DylanLovesCoffee Jan 20, 2021
a9bbf0c
update with feedback
DylanLovesCoffee Jan 21, 2021
5375952
Merge branch 'main' into dylan/trigger-tags
DylanLovesCoffee Jan 21, 2021
0e71a7e
update snapshots
DylanLovesCoffee Jan 21, 2021
20b4945
fix
DylanLovesCoffee Jan 21, 2021
3190475
fix my fix
DylanLovesCoffee Jan 21, 2021
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
lint
  • Loading branch information
DylanLovesCoffee committed Dec 8, 2020
commit 080f007e40b4956220c601632c60839758180e21
28 changes: 7 additions & 21 deletions tests/test_trigger.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@
function_arn = "arn:aws:lambda:us-west-1:123457598159:function:python-layer-test"


def get_mock_context(
invoked_function_arn=function_arn,
):
def get_mock_context(invoked_function_arn=function_arn):
lambda_context = MagicMock()
lambda_context.invoked_function_arn = invoked_function_arn
return lambda_context
Expand Down Expand Up @@ -50,8 +48,7 @@ def test_event_source_cloudfront(self):
event_source_arn = get_event_source_arn(event_source, event, ctx)
self.assertEqual(event_source, event_sample_source)
self.assertEqual(
event_source_arn,
"arn:aws:cloudfront::123457598159:distribution/EXAMPLE",
event_source_arn, "arn:aws:cloudfront::123457598159:distribution/EXAMPLE"
)

def test_event_source_cloudwatch_events(self):
Expand All @@ -64,8 +61,7 @@ def test_event_source_cloudwatch_events(self):
event_source_arn = get_event_source_arn(event_source, event, ctx)
self.assertEqual(event_source, event_sample_source)
self.assertEqual(
event_source_arn,
"arn:aws:events:us-east-1:123456789012:rule/ExampleRule",
event_source_arn, "arn:aws:events:us-east-1:123456789012:rule/ExampleRule"
)

def test_event_source_cloudwatch_logs(self):
Expand Down Expand Up @@ -105,10 +101,7 @@ def test_event_source_kinesis(self):
event_source = get_event_source(event)
event_source_arn = get_event_source_arn(event_source, event, ctx)
self.assertEqual(event_source, event_sample_source)
self.assertEqual(
event_source_arn,
"arn:aws:kinesis:EXAMPLE",
)
self.assertEqual(event_source_arn, "arn:aws:kinesis:EXAMPLE")

def test_event_source_sns(self):
event_sample_source = "sns"
Expand All @@ -120,8 +113,7 @@ def test_event_source_sns(self):
event_source_arn = get_event_source_arn(event_source, event, ctx)
self.assertEqual(event_source, event_sample_source)
self.assertEqual(
event_source_arn,
"arn:aws:sns:us-east-1:123456789012:ExampleTopic",
event_source_arn, "arn:aws:sns:us-east-1:123456789012:ExampleTopic"
)

def test_event_source_sqs(self):
Expand All @@ -133,10 +125,7 @@ def test_event_source_sqs(self):
event_source = get_event_source(event)
event_source_arn = get_event_source_arn(event_source, event, ctx)
self.assertEqual(event_source, event_sample_source)
self.assertEqual(
event_source_arn,
"arn:aws:sqs:us-east-1:123456789012:MyQueue",
)
self.assertEqual(event_source_arn, "arn:aws:sqs:us-east-1:123456789012:MyQueue")

def test_event_source_unsupported(self):
event_sample_source = "custom"
Expand All @@ -147,10 +136,7 @@ def test_event_source_unsupported(self):
event_source = get_event_source(event)
event_source_arn = get_event_source_arn(event_source, event, ctx)
self.assertEqual(event_source, None)
self.assertEqual(
event_source_arn,
None,
)
self.assertEqual(event_source_arn, None)


class GetTriggerTags(unittest.TestCase):
Expand Down