Vagrant won't run nosetests under ssh -c

34 views
Skip to first unread message

Kevin Engle

unread,
Jun 12, 2015, 4:11:31 PM6/12/15
to vagra...@googlegroups.com

I wanted to write a command to ssh into vagrant, change the current working directory, and then run nosetests.


I found in the documentation for vagrant that this could be done with vagrant ssh -c COMMAND

http://docs.vagrantup.com/v2/cli/ssh.html


The problem is I'm getting different results if I run nose through -c or manually after SSH.


Command:

vagrant ssh -c 'pwd && cd core && pwd && nosetests -x --failed' web


Output:

/web
/web/core

----------------------------------------------------------------------
Ran 0 tests in 4.784s

OK
Connection to 127.0.0.1 closed.

Commands:

vagrant ssh web

/web$ pwd && cd core && pwd && nosetests -x --failed


Output:

/web                                                     
/web/core                                                
.........................................................
.........................................................
.........................................................
.........................................................
<snip>
...............................                          
---------------------------------------------------------

Ran 1399 tests in 180.325s

I don't understand why it makes a difference.

Kevin Engle

unread,
Jun 23, 2015, 6:56:11 PM6/23/15
to vagra...@googlegroups.com
I haven't made any progress on this issue.

Chris Baldauf

unread,
Jun 23, 2015, 7:57:38 PM6/23/15
to vagra...@googlegroups.com
Hi Kevin,

I'm no nose expert, but it might help to increase the verbosity of nosetests with the -v flag to see if it provides any more clues. Based on the output that you posted, I can't see why the two invocations would be different. 


-Chris

Kevin Engle

unread,
Jun 24, 2015, 8:44:33 PM6/24/15
to vagra...@googlegroups.com
Hi Chris,

Running it with -v produces no additional output on the vagrant -c box:

$ vagrant ssh -c 'pwd && cd core && pwd && nosetests -v -x --failed' web
/web
/web/core

----------------------------------------------------------------------
Ran 0 tests in 13.182s


OK
Connection to 127.0.0.1 closed.

Unfortunately on the manual box it just adds more information about the individual tests.

testA (myapp.tests.testFile.testClass) ... ok
testB (myapp.tests.testFile.testClass) ... ok
etc.

Thanks,
Kevin

Kevin Engle

unread,
Jun 25, 2015, 12:58:42 PM6/25/15
to vagra...@googlegroups.com
In case someone else runs into this, I was able to resolve the issue.

I changed my command to vagrant ssh -c 'cd core && nosetests -x --failed --exe' web.

It still isn't clear to me why it makes a difference between -c and manually going into the box, but it works now.



On Friday, June 12, 2015 at 1:11:31 PM UTC-7, Kevin Engle wrote:
Reply all
Reply to author
Forward
0 new messages