New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not change or generate README.md after running rspec #8629
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed those files too, and thought it's related to my machine somehow. Instead of adding those workarounds, can we just not generate those files at all instead? Maybe just mock the method that writes out the file?
@@ -50,6 +50,8 @@ | |||
expect do | |||
Fastlane::CLIToolsDistributor.take_off | |||
end.to raise_error(SystemExit) | |||
|
|||
`git checkout fastlane/README.md` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That seems like a hack, can we just not generate the file in the first place instead?
allow(FastlaneCore::FastlaneFolder).to receive(:path).and_return(fastlane_folder) | ||
end | ||
|
||
after(:all) do | ||
FileUtils.rm(File.join(fastlane_folder, 'README.md')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
fastlane/spec/lane_manager_spec.rb
Outdated
@@ -70,7 +72,11 @@ def ensure_dot_env_value_from_folders(folders, envs, expected_values) | |||
|
|||
describe "successfull init" do | |||
before do | |||
allow(FastlaneCore::FastlaneFolder).to receive(:path).and_return(File.absolute_path('./fastlane/spec/fixtures/fastfiles/')) | |||
allow(FastlaneCore::FastlaneFolder).to receive(:path).and_return(fastlane_folder) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
@@ -5,6 +5,8 @@ | |||
ENV['DOTENV'] = nil | |||
fastlane_folder = File.absolute_path('./fastlane/spec/fixtures/dotenvs/withFastfiles/parentonly/fastlane') | |||
allow(FastlaneCore::FastlaneFolder).to receive(:path).and_return(fastlane_folder) | |||
allow(FastlaneCore::Env).to receive(:truthy?).and_return(:default) | |||
allow(FastlaneCore::Env).to receive(:truthy?).with('FASTLANE_SKIP_DOCS').and_return(true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we set this for all tests inside the spec_helper?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes 馃憤
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@KrauseFx Uhh, no after all. I tried to define these in spec_helper, and it had other problems to cause test failure.
@@ -43,6 +43,8 @@ | |||
end | |||
|
|||
it "checks for updates even if the lane has an error" do | |||
allow(FastlaneCore::Env).to receive(:truthy?).and_return(:default) | |||
allow(FastlaneCore::Env).to receive(:truthy?).with('FASTLANE_SKIP_DOCS').and_return(true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is 3 duplication codes, so it is better to define helper in fastlane_core/spec/spec_helper.rb
or fastlane/spec/spec_helper.rb
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this solution is strange.
You should not stub this environment variables.
It's natural to skip executing DocsGenerator.run in testing.
Fastlane::DocsGenerator.run(ff) unless FastlaneCore::Env.truthy?("FASTLANE_SKIP_DOCS") |
Fastlane::DocsGenerator.run(ff) if !Helper.test? && !FastlaneCore::Env.truthy?("FASTLANE_SKIP_DOCS")
Hmm, CircleCI select Xcode 7.0 馃槗 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great 馃憤 Thanks @nafu
@nafu Sorry for my late reply. |
Hey @nafu 馃憢 Thank you for your contribution to fastlane and congrats on getting this pull request merged 馃帀 Please let us know if this change requires an immediate release by adding a comment here 馃憤 |
Congratulations! 馃帀 This was released as part of fastlane 2.25.0 馃殌 |
Checklist
bundle exec rspec
from the root directory to see all new and existing tests passbundle exec rubocop -a
to ensure the code style is validDescription
Do not change or generate README.md after running rspec.
If anybody knows better way for handling this, please feedback to this PR. 馃檹
Motivation and Context
After running rspec, it generates some README.md on my machine that is not needed without this patch.