test-kitchen / busser-serverspec

A Busser runner plugin for the serverspec testing library
Other
54 stars 41 forks source link

No output present in command().stdout and SSH exited (1) #34

Closed imechemi closed 9 years ago

imechemi commented 9 years ago

My integration test is not stable because sometime all tests are passing but sometimes one or two fails. The error message shows that there was not output from command().stdout and the kitchen verify exited.

My kitchen verify fails with

Failure/Error: expect(cmd).to match 'Cache-Control: max-age=86400'
expected "" to match "200 OK"

 >>>>>> ------Exception-------
 >>>>>> Class: Kitchen::ActionFailed
 >>>>>> Message: SSH exited (1) for command: [sh -c '

BUSSER_ROOT="/tmp/verifier"; export BUSSER_ROOT
GEM_HOME="/tmp/verifier/gems"; export GEM_HOME
GEM_PATH="/tmp/verifier/gems"; export GEM_PATH
GEM_CACHE="/tmp/verifier/gems/cache"; export GEM_CACHE

My Integration Test has:

context 'some test group' do
before do
  command("sudo mkdir -p #{path}").stdout
  command("sudo touch #{path}test.txt #{path}test.js ").stdout
end

after(:all) do
  command('sudo rm -rf some-file').stdout
end

it 'serves files in its directory' do
  expect(command('curl -I some-url').stdout).to match '200 OK'
end

it 'does not serve directories in its hosted assets directory' do
  expect(command('curl -I some-url').stdout).to match '403 Forbidden'
end
end
imechemi commented 9 years ago

It's working now, my Gemfile has chef 12 but Gemfile.lock has chef 11. So bundle install wasn't working. So I removed Gemfile.lock and did bundle once again. Now kitchen verify is successful.

d-higuchi commented 9 years ago

ic, closing.