Project

General

Profile

Running tests » History » Revision 6

Revision 5 (Tom Clegg, 10/09/2014 03:40 PM) → Revision 6/64 (Ward Vandewege, 12/29/2014 03:33 PM)

h1. Running tests 

 {{toc}} 

 The arvados-dev git repository has a @run-tests.sh@ script which tests (nearly) all of the components in the arvados source tree. Jenkins at https://ci.curoverse.com uses this exact script, so running it _before pushing a new master_ is a good way to predict whether Jenkins will fail your build and start pestering you by IRC. 

 h2. Background 

 You have the arvados source tree at @~/arvados@ and you might have local modifications. 

 h2. Download/update the test script 

 First time: 

 <pre> 
 cd 
 git clone git://git.curoverse.com:arvados-dev.git 
 </pre> 

 Next times, to get any updates: 

 <pre> 
 cd ~/arvados-dev 
 git pull 
 </pre> 

 

 h2. Install prerequisites 

 The test script doesn't (yet) check for all prerequisites up front, so you'll save some time by installing these things before going any attempting to run tests: 
 * [[Go]] 
 * "API server dependencies":http://doc.arvados.org/install/install-api-server.html (Install debian packages, ruby, bundler. Create "arvados" postgres user with permission to create databases. user. You don't need to run "bundle install", though.) 
 * "Workbench dependencies":http://doc.arvados.org/install/install-workbench-app.html (Currently just graphviz. Skip "bundle install".) 
 * doc build dependencies: <pre>sudo apt-get install python-epydoc linkchecker</pre> 
 * Workbench test suite dependencies (see [[Hacking Workbench]]): <pre> 
 sudo apt-get install xvfb iceweasel 
 (set -e 
  PJS=phantomjs-1.9.7-linux-x86_64 
  wget -P /tmp https://bitbucket.org/ariya/phantomjs/downloads/$PJS.tar.bz2 
  sudo tar -C /usr/local -xjf /tmp/$PJS.tar.bz2 
  sudo ln -s ../$PJS/bin/phantomjs /usr/local/bin/ 
 ) 
 </pre> 

 


 h2. Run all tests 

 Basic usage: 

 <pre> 
 ~/arvados-dev/jenkins/run-tests.sh WORKSPACE=~/arvados 
 </pre> 

 h2. Save time by skipping some tests 

 Running all tests takes a while. You don't want to do this after each tiny change. You can use the --skip and --only arguments to select specific components. Some components also accept component-specific arguments to select specific test classes/cases. 

 h2. Save more time by skipping install 

 Normally, even when you're running only one component's test suite, @run-tests.sh@ still runs the _install_ recipe for all of the components. This addresses dependencies between components: for example, Workbench tests expect the Python and CLI SDKs to be installed. 

 When you're not worried about these dependencies going out of sync (e.g., you're only touching Workbench tests) you can install everything once this way: 

 <pre> 
 ~/arvados-dev/jenkins/run-tests.sh --only install --leave-temp WORKSPACE=~/arvados 
 </pre> 

 After running everything, you'll see something like this: 

 <pre> 
 Leaving behind temp dirs:    VENVDIR="/tmp/tmp.y3tsTmigio" GOPATH="/tmp/tmp.3r4sSA9F3l" 
 </pre> 

 Copy these temp dirs to the end of your run-tests.sh command line, add @--skip-install@, and choose a test suite to run, like this: 

 <pre> 
 ~/arvados-dev/jenkins/run-tests.sh --only workbench --skip-install WORKSPACE=~/arvados VENVDIR="/tmp/tmp.y3tsTmigio" GOPATH="/tmp/tmp.3r4sSA9F3l" 
 </pre> 

 h2. Other options 

 For more usage info, try: 

 <pre> 
 ~/arvados-dev/jenkins/run-tests.sh --help 
 </pre> 

 h1. Deficiencies 

 There's currently nowhere to add... 
 * Unit tests for Workbench JavaScript assets (see #4132) 
 * Unit/functional tests for crunch-job (see #4156) 
 * Tests for anything in arvados-cli package that actually get exercised by @run-tests.sh@ (see #4156) 
 * Tests for "arv" 
 * Tests for "arv-run-pipeline-instance" 
 * Tests for crunchstat