Skip to content
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

Appraisal as default rake task doesn't run additional tasks #144

Open
jeremywadsack opened this issue Sep 26, 2018 · 1 comment
Open

Appraisal as default rake task doesn't run additional tasks #144

jeremywadsack opened this issue Sep 26, 2018 · 1 comment

Comments

@jeremywadsack
Copy link

When I use the following in my Rakefile it runs all the tasks listed:

if !ENV["APPRAISAL_INITIALIZED"]
  task default: %i[rubocop bundle:audit appraisal]
else
  task default: %i[spec]
end

When I change the order of default dependencies to run appraisal first it runs the suites through Appraisal (successfully) and then exits without running bundle:audit or rubocop tasks.

if !ENV["APPRAISAL_INITIALIZED"]
  task default: %i[appraisal rubocop bundle:audit]
else
  task default: %i[spec]
end

I presume this has something to do with an exit code for the appraisal task but the actual value of $? in the shell in both cases is 0, so I'm not sure where to look.

@inkstak
Copy link

inkstak commented Aug 10, 2023

Got the same problem.
Fixed it by calling rake tasks in a spawn process :

task :default do
  if ENV["APPRAISAL_INITIALIZED"]
    Rake::Task["spec"].invoke
  else
    # Standard & appraisal requires each a spawn process.

    # Additional tasks won't run after appraisal because of
    # something to do with the exit code.
    # https://github.com/thoughtbot/appraisal/issues/144

    # Standard may be tainted by the rubocop task and
    # report offenses from other plugins putted in .rubocop_todo.yml
    # https://github.com/testdouble/standard/issues/480

    fail unless system "bundle exec appraisal rspec"
    fail unless system "bundle exec rubocop"
    fail unless system "bundle exec rake standard"
  end
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants