Closed NickLaMuro closed 4 months ago
I was not able to reproduce the failure that you're guarding against. Where does the Procfile need to be to trigger the failure?
Not going to lie... this is from 4 years ago and 2 jobs ago... I kinda forget the context at this point...
I can maybe take a look later today.
Okay, took another look at this, and I think I understand what I was trying to do at the time. However, since this is so old, I don't have any logs of what I was doing, but here is a guess at the series of a events:
Procfile
in the root of my local copy of this project. I did not Profile
from the first PR was still around.Procfile
in the root dirBut again, this is just a guess... I can try pulling this branch down and testing to see (as well doing a git rebase
off main
).
Thanks. I’ll take a look as well and see if I can figure out what might be going on.
Got it, thanks for identifying the issue!
While developing specs for https://github.com/ddollar/foreman/pull/770 I ran into this scenario (only a problem currently with those changes from #770 in place and a empty Procfile present).
Issue
With a present and empty
Procfile
in the root directory of the project, this has the potential to cause specs incli_spec.rb
to fail in a non-obvious way, and is not simple to debug the root cause.Because of how
forked_foreman
is implemented, it doesn't included theFakeFs
context to the subprocess, so it is pretty hard to deduce that it is running outside of that context, and that any generatedProcfile
(usingwrite_procfile
for example) will not be visible to the sub process.To avoid this confusion and errors that might be caused from this, this error is in place to warn the user if the file currently exists and prevents running the specs with it in place.