Skip to content

Commit

Permalink
test: Emit buildkite slug and build number as CW properties
Browse files Browse the repository at this point in the history
To make it easier to cross-reference buildkite logs to their emitted
cloudwatch logs/metrics, emit buildkite slug and build number. This
combination should uniquely identify logs/metrics from a build, without
us having to print instance ids to stdout (which also do not uniquely
identify, as the same instance could run multiple builds).

Signed-off-by: Patrick Roy <roypat@amazon.co.uk>
  • Loading branch information
roypat committed Sep 29, 2023
1 parent 1986cdd commit 3d2a61f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/framework/properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"""
Metadata we want to attach to tests for further analysis and troubleshooting
"""

import os
import platform
import re
import subprocess
Expand Down Expand Up @@ -57,6 +57,8 @@ def __init__(self):
self.git_branch = run_cmd("git show -s --pretty=%D HEAD")
self.git_origin_url = run_cmd("git config --get remote.origin.url")
self.rust_version = run_cmd("rustc --version |awk '{print $2}'")
self.buildkite_pipeline_slug = os.environ.get("BUILDKITE_PIPELINE_SLUG")
self.buildkite_build_number = os.environ.get("BUILDKITE_BUILD_NUMBER")

self.environment = self._detect_environment()
if self.is_ec2:
Expand Down

0 comments on commit 3d2a61f

Please sign in to comment.