Running tests » History » Version 1
Tom Clegg, 09/18/2014 05:53 PM
| 1 | 1 | Tom Clegg | h1. Running tests |
|---|---|---|---|
| 2 | |||
| 3 | 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. |
||
| 4 | |||
| 5 | h2. Background |
||
| 6 | |||
| 7 | You have the arvados source tree at @~/arvados@ and you might have local modifications. |
||
| 8 | |||
| 9 | h2. Download/update the test script |
||
| 10 | |||
| 11 | First time: |
||
| 12 | |||
| 13 | <pre> |
||
| 14 | cd |
||
| 15 | git clone git://git.curoverse.com:arvados-dev.git |
||
| 16 | </pre> |
||
| 17 | |||
| 18 | Next times, to get any updates: |
||
| 19 | |||
| 20 | <pre> |
||
| 21 | cd ~/arvados-dev |
||
| 22 | git pull |
||
| 23 | </pre> |
||
| 24 | |||
| 25 | h2. Install prerequisites |
||
| 26 | |||
| 27 | 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: |
||
| 28 | * [[Go]] |
||
| 29 | * "API server dependencies":http://doc.arvados.org/install/install-api-server.html (Install debian packages, ruby, bundler. Create "arvados" postgres user. You don't need to run "bundle install", though.) |
||
| 30 | * "Workbench dependencies":http://doc.arvados.org/install/install-workbench-app.html (Currently just graphviz. Skip "bundle install".) |
||
| 31 | |||
| 32 | h2. Run all tests |
||
| 33 | |||
| 34 | Basic usage: |
||
| 35 | |||
| 36 | <pre> |
||
| 37 | ~/arvados-dev/jenkins/run-tests.sh WORKSPACE=~/arvados |
||
| 38 | </pre> |
||
| 39 | |||
| 40 | h2. Save time by skipping some tests |
||
| 41 | |||
| 42 | 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. |
||
| 43 | |||
| 44 | h2. Save more time by skipping install |
||
| 45 | |||
| 46 | 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. |
||
| 47 | |||
| 48 | 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: |
||
| 49 | |||
| 50 | <pre> |
||
| 51 | ~/arvados-dev/jenkins/run-tests.sh --only install --leave-temp WORKSPACE=~/arvados |
||
| 52 | </pre> |
||
| 53 | |||
| 54 | After running everything, you'll see something like this: |
||
| 55 | |||
| 56 | <pre> |
||
| 57 | Leaving behind temp dirs: VENVDIR="/tmp/tmp.y3tsTmigio" GOPATH="/tmp/tmp.3r4sSA9F3l" |
||
| 58 | </pre> |
||
| 59 | |||
| 60 | 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: |
||
| 61 | |||
| 62 | <pre> |
||
| 63 | ~/arvados-dev/jenkins/run-tests.sh --only workbench --skip-install WORKSPACE=~/arvados VENVDIR="/tmp/tmp.y3tsTmigio" GOPATH="/tmp/tmp.3r4sSA9F3l" |
||
| 64 | </pre> |