You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is not an issue about fastlane itself — it is not preventing fastlane to run or making it crash — but an issue about the Unit Tests (aka Specs), and only when running those fastlane tests locally.
Some of our unit tests (specs) are testing cases for when an action's parameter is not provided. But if the ConfigItem being tested by that spec/test happens to have an env_name: attribute—allowing the value of that action's ConfigItem to be provided by an ENV var instead of explicitly—then running the test on a local machine might accidentally pick up environment variables from the user running the test on their machine, making the test fail or not test what it's supposed to.
So far I've encountered the case with SENTRY_AUTH_TOKEN local env var which was messing up our upload_symbols_to_sentry_spec.rb test, and I've already fixed that specific case in #21586.
But we should probably audit our tests' codebase to check if there aren't any other specs testing cases relying on the values of some ConfigItems that could be muddied by local ENV vars, and fix all of them in a similar way (aka allow(ENV).to receive(:[]).and_return(nil))
Note that this issue only affects when running the test suite on a local machine, and does not affect CI (because the environment variables set on CI machines is predictable)
Command executed
bundle exec rspec
The text was updated successfully, but these errors were encountered:
New Issue Checklist
Issue Description
Note
This is not an issue about fastlane itself — it is not preventing fastlane to run or making it crash — but an issue about the Unit Tests (aka Specs), and only when running those fastlane tests locally.
Some of our unit tests (specs) are testing cases for when an action's parameter is not provided. But if the
ConfigItem
being tested by that spec/test happens to have anenv_name:
attribute—allowing the value of that action'sConfigItem
to be provided by anENV
var instead of explicitly—then running the test on a local machine might accidentally pick up environment variables from the user running the test on their machine, making the test fail or not test what it's supposed to.So far I've encountered the case with
SENTRY_AUTH_TOKEN
local env var which was messing up ourupload_symbols_to_sentry_spec.rb
test, and I've already fixed that specific case in #21586.But we should probably audit our tests' codebase to check if there aren't any other specs testing cases relying on the values of some
ConfigItem
s that could be muddied by local ENV vars, and fix all of them in a similar way (akaallow(ENV).to receive(:[]).and_return(nil)
)Note that this issue only affects when running the test suite on a local machine, and does not affect CI (because the environment variables set on CI machines is predictable)
Command executed
bundle exec rspec
The text was updated successfully, but these errors were encountered: