Albacore / albacore

Albacore is a professional quality suite of Rake tasks for building .NET or Mono based systems.
www.albacorebuild.net
221 stars 64 forks source link

test_runner does not seem to accept task parameters #192

Closed antonialvarez closed 8 years ago

antonialvarez commented 8 years ago

Given this sample task:

test_runner :unit_tests, :path do |nunit, args|
#args is nil in here
end

then calling rake unit_tests[custompath] does not populate the args variable in the block above. The root of the issue seems to be in dsl.rb in the definition of test_runner:

Albacore.define_task *args do
  c = Albacore::TestRunner::Config.new
  yield c
  Albacore::TestRunner::Task.new(c.opts).execute
end

the following implementation solves the issue

Albacore.define_task *args do |task_name, args|
  c = Albacore::TestRunner::Config.new
  yield c, args
  Albacore::TestRunner::Task.new(c.opts).execute
end
haf commented 8 years ago

I see. Perhaps you'd PR that change? THanks.

antonialvarez commented 8 years ago

Since many methods in dsl.rb use the same task creation pattern, should they all be fixed in the same way?

And yes, I can create a pull request.

haf commented 8 years ago

Yes, that's the way to go! =)

antonialvarez commented 8 years ago

Deal! :)

jaredreynolds commented 8 years ago

@haf, I also need this fix, noticed @antonialvarez's build failed, forked, and attempted to make the same fix. However, the travis build also failed for me. I made another branch with just a change to allow branch builds (and removing your email)--it, too, fails in travis. Can you rerun master in travis to make sure it still works? Otherwise, any help would be appreciated.

haf commented 8 years ago

Restarted!

jaredreynolds commented 8 years ago

@haf, thank you! The build worked fine. The main difference I see is that the Albacore repo runs on travis' legacy infrastructure while mine runs on their "new platform for Precise builds." I will try to see if their support can help.

haf commented 8 years ago

Strange. But when I test locally it's also passing. Also, there are no sudo calls or other strange things going on, so I can't spot why it would fail off the bat.

jaredreynolds commented 8 years ago

@haf, travis support pointed out that the installed version of bundler is old so I've submitted PR #195 to pre-install it.

haf commented 8 years ago

Released v2.5.13 that would seem to be able to do this.