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

Fixed ms test runnner #203

Closed andyfenna closed 8 years ago

andyfenna commented 8 years ago

the test runner must be called with the is_ms_test parameter set... see below:-

    desc "Run unit tests"
    test_runner :sqltest do |mstest|
        mstest.files = ['C:\dbgit\db\build\SqlTests.dll']
        mstest.is_ms_test
        mstest.exe = "C:/Program Files (x86)/Microsoft Visual Studio 11.0/Common7/IDE/MSTest.exe"
        mstest.native_exe
    end
haf commented 8 years ago

Excellent =)

Write a blurb in the wiki that is_ms_test exists, and I'll merge this.

andyfenna commented 8 years ago

updated wiki to correspond to changes

haf commented 8 years ago

Put in a few comments. There's also the unless keyword that checks for the inverse of if. If @nuspec is nil by default then you could do unless @nuspec ; ... normal path ... ; else ...

andyfenna commented 8 years ago

maybe your ci test needs changing to refect these changes. how do i go about changing these?

haf commented 8 years ago

No the test is correct...

You just haven't changed all of your checks == ''. Like this one: https://github.com/andyfenna/albacore/blob/master/lib/albacore/task_types/nugets_pack.rb#L248

View the diff of this PR to see all the places you have edited. If you can split this into two separate PRs; one for the msbuild flag which was correct then I can help you correct your other nuspec code separately.

andyfenna commented 8 years ago

Thanks for the help. It's much appreciated? I'll check through things later. On a curve ball does your gem PUSH? To a source?

Sent from my iPhone

On 5 May 2016, at 21:07, Henrik Feldt notifications@github.com<mailto:notifications@github.com> wrote:

No the test is correct...

You just haven't changed all of your checks == ''. Like this one: https://github.com/andyfenna/albacore/blob/master/lib/albacore/task_types/nugets_pack.rb#L248

View the diff of this PR to see all the places you have edited. If you can split this into two separate PRs; one for the msbuild flag which was correct then I can help you correct your other nuspec code separately.

You are receiving this because you authored the thread. Reply to this email directly or view it on GitHubhttps://github.com/Albacore/albacore/pull/203#issuecomment-217263308

haf commented 8 years ago

Yes, the release task does

andyfenna commented 8 years ago

i've resolved that earlier problem, however the CI has still failed - unsure why.

I'm calling the task like this...

desc 'package nugets - finds all projects and package them'
nugets_pack :pack => [:versioning] do |p|
    p.nuspec   = 'nuget/app.nuspec'
    p.out     = "#{configatron.dir.build}"
    p.exe     = "#{configatron.dir.rake_tools}/nuget-v2/nuget.exe"
end

and the console returns the below..

C:\dbgit\App>rake nuget:pack C:\dbgit\App\rake-tools\nuget-v2\NuGet.exe Pack -OutputDirectory C:/dbgit/App/build C:/dbgit/App/nuget/App.nuspec Attempting to build package from 'App.nuspec'. Successfully created package 'C:/dbgit/App/build\App.0.1.0.0.nupkg'. I 2016-05-06T10:44:04.272779+01:00: symbols not configured for generation, use Config#gen_symbols to do so [nugets pack: cmd]

So i think we need a new CI test as we are passing in p.nuspec attribute.

andyfenna commented 8 years ago

All tests are now passing. I'll update wiki now with new feature for nugests_pack - can this be merged once done?

andyfenna commented 8 years ago

The UNLESS statement gets your head in a spin sometimes lol, all code changes have been made as above.

I have looked at the release task, how would I call it from a rake file like the nugets_pack task?

At the minute I'm using it like this... i'm sure its correct though...

namespace :nuget do
   Albacore::Tasks::Release.new :release,
        pkg_dir: "#{configatron.dir.build}",
        nuget_exe: "#{configatron.dir.rake_tools}/nuget-v2/nuget.exe",
        nuget_source: "http://nuget.source.com",
        api_key: 'xxxxxxx'
end

This is throwing this error when trying to execute.

"rake nuget:release"

"Don't know how to build task 'nuget:release'"

Any ideas?

haf commented 8 years ago

I think that the release task doesn't take its surrounding namespace. You should be able to call it with :release plainly.

haf commented 8 years ago

@andyfenna Thank you!

andyfenna commented 8 years ago

When will this be available for release? v2.5.8 does not include this change

haf commented 8 years ago

v2.5.9 released