0

We're looking to setup Jenkins and have deployed. Oddly enough, the results for the unit tests are showing 7 failures, and on our local machine, we don't get any failures.

Why would the results on the testing server be different?

I have verified that they are using the appropriate database and environment...

user577808
  • 2,317
  • 4
  • 21
  • 31
  • Surely the biggest clue will be in what the failures are - you have that information, but we don't. – Jon Skeet Apr 16 '12 at 06:06
  • @Jon, 5 against 1 it's one of the two possibilities I've indicated in my answer. In that case logs will only clutter the question. If it's not one of those possibilities, then we can probe further, look at the logs, etc. – malenkiy_scot Apr 16 '12 at 07:22
  • @malenkiy_scot: Surely *some* indication of what's wrong (the *nature* of the test failure, not necessarily full logs) would have helped to start with? – Jon Skeet Apr 16 '12 at 08:29
  • There are about 2000 tests. Of which, 7 fail. And all 7 are related to rspec matchers like: [something].should have(#).things. The number are things like got 6, should be 2. So the numbers of things are way off for those tests. I made sure the database is being cleaned before the next test ran and everything, but beyond that, it doesn't make much sense why only 7 would be off. – user577808 Apr 16 '12 at 14:06

1 Answers1

0

Chances are you have one of the following:

--You are running Jenkins in the background and the tests need to run in the foreground. See this answer.

--You are running Jenkins as a different user, so your tests do not have all the necessary permissions. Check user for Jenkins process (e.g. with ps on Unix-like systems).

Community
  • 1
  • 1
malenkiy_scot
  • 16,415
  • 6
  • 64
  • 87
  • why would the tests need to be run in the foreground? I outputted "whoami" from the build script and it's running as the user I expected. – user577808 Apr 16 '12 at 14:07
  • The tests may want for some reason to have a terminal. Just try running it in the foreground and see if it helps. Just thought of another possibility: make sure that the directory where the tests run have proper permissions all the way up (see [this answer](http://stackoverflow.com/a/9795554/1178189) and comments to it). – malenkiy_scot Apr 16 '12 at 14:19