-
-
Notifications
You must be signed in to change notification settings - Fork 530
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix fatal git failures in tests #832
Conversation
@@ -17,6 +17,12 @@ def run_suspenders(arguments = nil) | |||
` | |||
#{suspenders_bin} #{APP_NAME} #{arguments} | |||
` | |||
Dir.chdir(APP_NAME) do | |||
with_env("HOME", tmp_path) do |
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.
Prefer single-quoted strings when you don't need string interpolation or special symbols.
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.
This file is all over the double quotes.
@@ -17,6 +17,12 @@ def run_suspenders(arguments = nil) | |||
` | |||
#{suspenders_bin} #{APP_NAME} #{arguments} | |||
` | |||
Dir.chdir(APP_NAME) do | |||
with_env("HOME", tmp_path) do |
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.
Prefer single-quoted strings when you don't need string interpolation or special symbols.
@@ -17,6 +17,12 @@ def run_suspenders(arguments = nil) | |||
` | |||
#{suspenders_bin} #{APP_NAME} #{arguments} | |||
` | |||
Dir.chdir(APP_NAME) do | |||
with_env("HOME", tmp_path) do |
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.
Prefer single-quoted strings when you don't need string interpolation or special symbols.
The tests had started printing git error messages: ``` fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree. ``` These were coming from three places: - `suspenders.gemspec`, which collects all `Gem::Specification#files=` by shelling out to `git ls-files`. - `suspenders.gemspec`, which collects all `Gem::Specification#test_files=` by shelling out to `git ls-files -- {test,spec,features}/*`. - Honeybadger, which figures out which revision to tag the error with by invoking `rev-parse`: def from_git return nil unless File.directory?('.git') `git rev-parse HEAD`.strip rescue nil end Although I am unsure why these things started to matter now, I found two changes that improve the situation: - In the test suite, make an initial commit after suspender'ing a project. - When suspender'ing a project, make the git repo last.
f5200e8
to
718fb7a
Compare
The tests had started printing git error messages:
These were coming from three places:
suspenders.gemspec
, which collects allGem::Specification#files=
by shelling out to
git ls-files
.suspenders.gemspec
, which collects allGem::Specification#test_files=
by shelling out togit ls-files -- {test,spec,features}/*
.Honeybadger, which figures out which revision to tag the error with by
invoking
rev-parse
:Although I am unsure why these things started to matter now, I found two
changes that improve the situation:
project.