Skip to content

Commit

Permalink
Add buildkite_token to buildkite_trigger_build_action in tests
Browse files Browse the repository at this point in the history
The tests passed on my machine but failed in CI, see
https://buildkite.com/automattic/release-toolkit/builds/1602#018f0986-a43b-49d1-884d-50c62e8af094

It turns out I had a `BUILDKITE_TOKEN` in my environment which I had
forgotten about...
  • Loading branch information
mokagio committed Apr 24, 2024
1 parent 2a8515c commit 657c422
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions spec/buildkite_trigger_build_action_spec.rb
Expand Up @@ -21,6 +21,7 @@
# rubocop:enable RSpec/VerifiedDoubles

url = run_described_fastlane_action(
buildkite_token: 'fake-token',

This comment has been minimized.

Copy link
@AliSoftware

AliSoftware Apr 24, 2024

Contributor

It turns out I had a BUILDKITE_TOKEN in my environment which I had
forgotten about...

We should probably add allow(ENV).to receive(:[]).and_return(nil) to all our tests (via test_helper.rb and/or Rspec.configure?) to avoid any local ENV var of the tester's machine to impact the test, otherwise tests won't be reliable.

This comment has been minimized.

Copy link
@AliSoftware

AliSoftware Apr 24, 2024

Contributor

Reminds me of when the same thing happened to me when working on fastlane btw: fastlane/fastlane#21586

branch: 'branch',
commit: '1a2b3c',
pipeline_file: 'pipeline.yml',
Expand All @@ -43,6 +44,7 @@
expect(FastlaneCore::UI).to receive(:crash!)

run_described_fastlane_action(
buildkite_token: 'fake-token',
branch: 'branch',
commit: '1a2b3c',
pipeline_file: 'pipeline.yml',
Expand Down

0 comments on commit 657c422

Please sign in to comment.