Add organization to metrics table (#2599)
diff --git a/buildkite/collect_metrics.py b/buildkite/collect_metrics.py
index 3a5da43..0c8abb1 100644
--- a/buildkite/collect_metrics.py
+++ b/buildkite/collect_metrics.py
@@ -335,6 +335,7 @@
"created_at": timestamps.created_at,
"started_at": timestamps.started_at,
"pipeline": PIPELINE,
+ "org": ORG,
"platform": PLATFORM,
"agent_id": AGENT_ID,
"branch": BRANCH,
diff --git a/buildkite/collect_metrics_test.py b/buildkite/collect_metrics_test.py
index 33f622a..bb5534a 100644
--- a/buildkite/collect_metrics_test.py
+++ b/buildkite/collect_metrics_test.py
@@ -168,6 +168,7 @@
# Setup Environment
os.environ["BUILDKITE_BUILD_NUMBER"] = "500"
os.environ["BUILDKITE_PIPELINE_SLUG"] = "test-pipeline"
+ os.environ["BUILDKITE_ORGANIZATION_SLUG"] = "test-org"
# Setup Mocks
mock_git.return_value = 5 # 5 changed files
@@ -201,6 +202,7 @@
self.assertEqual(row["build_number"], 500)
self.assertEqual(row["pipeline"], "test-pipeline")
+ self.assertEqual(row["org"], "test-org")
self.assertEqual(row["changed_files_count"], 5)
self.assertEqual(row["failed_test_count"], 0)
self.assertEqual(row.get("queue_duration_s"), 300.0)