Skip to content
Merged
Show file tree
Hide file tree
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
7 changes: 6 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,12 @@ def pytest_addoption(parser):

def pytest_report_header():
"""Pytest hook to print relevant metadata in the logs"""
return f"EC2 AMI: {global_props.ami}"
return "\n".join(
[
f"EC2 AMI: {global_props.ami}",
f"EC2 Instance ID: {global_props.instance_id}",
]
)


@pytest.hookimpl(wrapper=True, tryfirst=True)
Expand Down
2 changes: 2 additions & 0 deletions tests/framework/properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,11 @@ def __init__(self):
self.environment = self._detect_environment()
if self.is_ec2:
self.instance = imdsv2_get("/meta-data/instance-type")
self.instance_id = imdsv2_get("/meta-data/instance-id")
self.ami = imdsv2_get("/meta-data/ami-id")
else:
self.instance = "NA"
self.instance_id = "NA"
self.ami = "NA"

@property
Expand Down