blob: 210b285bbb677622e54caee78d1ca8623098ffe0 [file] [log] [blame]
Robert Collins18c9bbd2015-07-10 14:00:11 +12001#!/bin/bash
2#
3# An example hook script to verify what is about to be committed
4# by applypatch from an e-mail message.
5#
6# The hook should exit with non-zero status after issuing an
7# appropriate message if it wants to stop the commit.
8#
9# To enable this hook, rename this file to "pre-applypatch".
10
11set -eu
12
13#. git-sh-setup
14echo "** in hook **"
15
16function test_version {
17 version=$1
18 host=$(ls ~/.virtualenvs/mock-$version-* -d | sed -e "s/^.*mock-$version-//")
19 if [ -z "$host" ]; then
20 echo "No host found for $version"
21 return 1
22 fi
23 echo testing $version in virtualenv mock-$version-$host on ssh host $host
24 ssh $host "cd work/mock && . ~/.virtualenvs/mock-$version-$host/bin/activate && pip install .[test] && unit2"
25}
26
27find . -name "*.pyc" -exec rm "{}" \;
28
Robert Collins8747bf42015-07-15 18:37:33 +120029test_version 2.6
Robert Collins18c9bbd2015-07-10 14:00:11 +120030test_version 2.7
31test_version 3.2
32test_version 3.3
33test_version 3.4
34test_version 3.5
35test_version cpython
36test_version pypy
37
38echo '** pre-apply complete and successful **'