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

test_runner changing working dir, Albacore::CommandNotFoundError - unable to find NUnit exe #110

Closed
mobill opened this issue Apr 7, 2014 · 7 comments

Comments

@mobill
Copy link

mobill commented Apr 7, 2014

I've tried rc12.

The problem is that Albacore is not finding the Nunit executable after the noted change of working directory (see Issue 109).

I understand your point about the test data location, but you're assuming that test data will be local to the test assembly. Forcing the working directory just isn't a good solution. It is hidden, unexpected behavior. It should be parameterized and under my control.

NOTE the results xml file specified in the command parameter, shown in issue 109, will now end up in a completely unknown location, assuming it's created at all.

Both rc11 and rc12 fail to find the Nunit executable because the working directory has been changed. rc11 seemingly didn't account for the working dir change at all. rc12 does a bunch of ../../..'s but apparently it isn't correct.

2014-04-07T18:36:23.204638+01:00: executing in directory './../source/App1.Tests/bin/release' build 07-Apr-2014 12:36:23 ..........\deploy\Tools\NUnit.2.5.10.11092\nunit-console.exe App1.Tests.dll /xml=../Build/Output/unit_test_results.xml error 07-Apr-2014 12:36:23 rake aborted! error 07-Apr-2014 12:36:23 Albacore::CommandNotFoundError: Command failed with status (127) - number 127 in particular means that the operating system could not find the executable: error 07-Apr-2014 12:36:23 ..........\deploy\Tools\NUnit.2.5.10.11092\nunit-console.exe App1.Tests.dll /xml=../Build/Output/unit_test_results.xml
@haf
Copy link
Member

haf commented Apr 7, 2014

You need to post your configuration.

@haf
Copy link
Member

haf commented Apr 7, 2014

An alternative way of doing it is to have leave both exe and dll paths alone, and having a method #work_dir= that allows you to change it and 'take care of it yourself'.

@mobill
Copy link
Author

mobill commented Apr 7, 2014

sorry, not sure what you mean by configuration.

I'd be good with #work_dir.

@haf
Copy link
Member

haf commented Apr 7, 2014

I mean what you have written in the rakefile.

@mobill
Copy link
Author

mobill commented Apr 7, 2014

namespace :test do
  desc "Runs all unit tests"
  test_runner :unit => [:build] do |nunit|
    run_tests :unit_test, nunit
  end
end

def run_tests(test_type, nunit)
  assemblies = []
  @application_definitions.each_pair do |name, config|
    assemblies << File.join(config[:build][:object_path], "#{config[:assembly]}.dll") if  config[:type] == test_type
  end

  configure_test assemblies, test_type, nunit
end

def configure_test(assemblies, test_type, nunit)
    nunit.exe = "Tools/NUnit.2.5.10.11092/nunit-console.exe"
    nunit.files = assemblies
    nunit.add_parameter "/xml=#{File.join(@temp_root, test_type.to_s + '_results.xml')}"
end

@mobill
Copy link
Author

mobill commented Apr 11, 2014

@haf Any idea on availability of #work_dir change? Thanks.

@haf haf added this to the v2.0 Release milestone Aug 1, 2014
@haf
Copy link
Member

haf commented Aug 21, 2014

I'm closing this as a duplicate of #111

@haf haf closed this as completed Aug 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants