adamralph / bau

The C# task runner
MIT License
152 stars 17 forks source link

Acceptance tests cannot be run with scriptcs 0.14.1 #198

Closed eatdrinksleepcode closed 9 years ago

eatdrinksleepcode commented 9 years ago

What is the current state of the acceptance tests? I am unable to get them to run successfully.

  1. The path to the output folder as defined in Bau.Test.Acceptance/Support/Baufile.cs line 33-39 does not exist. To workaround this I replaced the entire #if DEBUG withPath.GetDirectoryName(Assembly.GetExecutingAssembly().Location)`.
  2. In the Run method in the same file, the FileName to run is set to "scriptcs". Windows complains that it can't find this file, since it is actually called "scriptcs.bat". Changing the FileName to "scriptcs.bat" allowed me to continue.
  3. Now, for all tests, scriptcs always returns an exit code of -1, causing the tests to fail, even though running scriptcs from the command line seems to succeed.

Any ideas? Is anyone running the acceptance tests on a regular basis?

aarondandy commented 9 years ago

I ran them last night. I just run "build accept" from the repository root. They all worked me using the command line, and take forever. Running the from ncrunch most of them fail, even after setting up certain folders.

aarondandy commented 9 years ago

Also, I had to upgrade scriptcs, I am at the latest version: "cup scriptcs"

eatdrinksleepcode commented 9 years ago

I am still unable to run them, nor do I see how they could run in their current state given the problems I noted in my issue description. Here's what I have:

Windows 7 64-bit Dev branch (5c23bd63209df43b013615c61e7e24112ee1d92b) ScriptCS 0.14.1 (latest version) cmd (also tried Visual Studio 2013 Developer Command Prompt) build accept

This results in the problems I described. Any idea why this doesn't work for me?

aarondandy commented 9 years ago
  1. For me these folders map to src\Bau\bin\Release for release builds and a similar folder for Bau.Exec. Also the build based on baufile.csx appears to be hard coded to Release.
  2. I'm not sure how but it appears that the tests are running for me through NCrunch using a leftover ScriptCs.0.13.2 I have instead of the ScriptCs.0.14.1 it should be using. I'm going to look into that.
  3. I'm seeing some of the non-zero codes in my VS runners, possibly related to the version of scriptcs it is using.

Try this, I'm curious if it changes anything for you.

  1. Nuke all bin directories under all projects
  2. Nuke the artifacts folder
  3. Run build accept
aarondandy commented 9 years ago

I fixed my scriptcs install so it is now using 0.14.1 and as a result I get 2 failures when running build accept and 5 when running them through NCrunch for that commit. Very strange! I guess one thing to do is make sure you actually have 0.14.1 used when you run scriptcs as there was a change in how it was installed a few months back. It used to be installed to the user folder for only one user per system which was odd, they changed it to be a system wide install. I don't think the scriptcs upgrade worked for me correctly so I had to take care of some leftovers manually.

aarondandy commented 9 years ago

A second run of build accept passed all 288 tests. I think they need some love!

eatdrinksleepcode commented 9 years ago

Deleting all "bin" directories and the "artifacts" directory did not help. Nor does #199.

(1) does not seem to be a problem any more (not sure what happened, will investigate this further), but I am still stuck at (2) (unless I change the FileName from "scriptcs" to "scriptcs.bat"). Are you building on Windows 8? Or are there any other differences from my setup above that could be causing different behavior here?

adamralph commented 9 years ago

@eatdrinksleepcode I guess it's scriptcs.bat for you because you installed scriptcs via svm?

Even so, things should work in the general case. I'll take a look at @aarondandy's PR.

It's highly possible that something was broken here by scriptcs 0.14, which contained breaking changes.

aarondandy commented 9 years ago

bin was changed to scriptcs_bin causing it to only copy the bau.dll and bau.exec.dll files once, ignoring changes to them. The PR fixes that for sure. I am not using svm and may keep it that way so I can be a test case for chocolatey. The only differences with my setup are that I use cinst and Windows 8.1 .

adamralph commented 9 years ago

@eatdrinksleepcode this should all be fixed now.

As long as you have scriptcs 0.14.1 installed either via svm or chocolatey, the acceptance tests should now work for you. I'm not really sure where you got scriptcs.bat from. Are you perhaps using a very old version of chocolatey?

adamralph commented 9 years ago

BTW - feel free to re-open this issue if you are still having problems.

eatdrinksleepcode commented 9 years ago

I have scriptcs installed via Chocolatey. My Chocolatey version is probably pretty old, I will try a newer version later today.

On Apr 25, 2015, at 12:46 PM, Adam Ralph notifications@github.com wrote:

BTW - feel free to re-open this issue if you are still having problems.

— Reply to this email directly or view it on GitHub.

eatdrinksleepcode commented 9 years ago

It was the old version of Chocolatey. Updated and then re-installed scriptcs and the acceptance tests now all pass (although at one point I got a Watson error saying Bau.Test.Acceptance.CreateFile stopped working; but that didn't seem to cause a test failure).