Skip to content

Commit

Permalink
Merge pull request #203 from buildkite/add-language-version
Browse files Browse the repository at this point in the history
Report Ruby version to Test Analytics
  • Loading branch information
gchan authored Sep 4, 2023
2 parents f60834e + 8dc5fcf commit 7ec7a43
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/buildkite/test_collector/ci.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def analytics_env
"message" => ENV["BUILDKITE_ANALYTICS_MESSAGE"],
"execution_name_prefix" => ENV["BUILDKITE_ANALYTICS_EXECUTION_NAME_PREFIX"],
"execution_name_suffix" => ENV["BUILDKITE_ANALYTICS_EXECUTION_NAME_SUFFIX"],
"language_version" => RUBY_VERSION,
"version" => Buildkite::TestCollector::VERSION,
"collector" => "ruby-#{Buildkite::TestCollector::NAME}",
}.select { |_, value| !value.nil? }
Expand Down
13 changes: 13 additions & 0 deletions spec/test_collector/ci_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
let(:job_id) { "242424" }
let(:message) { "bananas are tasty" }
let(:version) { Buildkite::TestCollector::VERSION }
let(:language_version) { RUBY_VERSION }
let(:name) { "ruby-#{Buildkite::TestCollector::NAME}" }
let(:test_value) { "test_value" }

Expand Down Expand Up @@ -64,6 +65,7 @@
"number" => bk_number,
"job_id" => bk_job_id,
"message" => bk_message,
"language_version" => language_version,
"version" => version,
"collector" => name,
"test" => test_value,
Expand Down Expand Up @@ -97,6 +99,7 @@
"message" => message,
"execution_name_prefix" => "execution_name_prefix",
"execution_name_suffix" => "execution_name_suffix",
"language_version" => language_version,
"version" => version,
"collector" => name,
"test" => test_value,
Expand Down Expand Up @@ -135,6 +138,7 @@
"branch" => gha_ref,
"commit_sha" => gha_sha,
"number" => gha_run_number,
"language_version" => language_version,
"version" => version,
"collector" => name,
"test" => test_value,
Expand Down Expand Up @@ -164,6 +168,7 @@
"number" => number,
"job_id" => job_id,
"message" => message,
"language_version" => language_version,
"version" => version,
"collector" => name,
"test" => test_value,
Expand Down Expand Up @@ -198,6 +203,7 @@
"branch" => c_branch,
"commit_sha" => c_sha,
"number" => c_number,
"language_version" => language_version,
"version" => version,
"collector" => name,
"test" => test_value,
Expand Down Expand Up @@ -227,6 +233,7 @@
"number" => number,
"job_id" => job_id,
"message" => message,
"language_version" => language_version,
"version" => version,
"collector" => name,
"test" => test_value,
Expand Down Expand Up @@ -262,6 +269,7 @@
"commit_sha" => c_sha,
"number" => nil,
"message" => c_message,
"language_version" => language_version,
"version" => version,
"collector" => name,
"test" => test_value,
Expand Down Expand Up @@ -292,6 +300,7 @@
"number" => number,
"job_id" => job_id,
"message" => message,
"language_version" => language_version,
"version" => version,
"collector" => name,
"test" => test_value,
Expand All @@ -313,6 +322,7 @@
expect(result).to match({
"CI" => "generic",
"key" => key,
"language_version" => language_version,
"version" => version,
"collector" => name,
"test" => test_value,
Expand Down Expand Up @@ -342,6 +352,7 @@
"number" => number,
"job_id" => job_id,
"message" => message,
"language_version" => language_version,
"version" => version,
"collector" => name,
"test" => test_value,
Expand All @@ -361,6 +372,7 @@
expect(result).to match({
"CI" => nil,
"key" => "845ac829-2ab3-4bbb-9e24-3529755a6d37",
"language_version" => language_version,
"version" => version,
"collector" => name,
"test" => test_value,
Expand Down Expand Up @@ -390,6 +402,7 @@
"number" => number,
"job_id" => job_id,
"message" => message,
"language_version" => language_version,
"version" => version,
"collector" => name,
"test" => test_value,
Expand Down
1 change: 1 addition & 0 deletions spec/test_collector/http_client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"run_env": {
"CI": nil,
"key": "build-123",
"language_version" => RUBY_VERSION,
"version": Buildkite::TestCollector::VERSION,
"collector": "ruby-buildkite-test_collector",
"test": "test_value"
Expand Down

0 comments on commit 7ec7a43

Please sign in to comment.