##// END OF EJS Templates
scripts/validate-commits: use direct /bin/bash interpreter...
Thomas De Schampheleire -
r7789:37ac2ac0 default
parent child Browse files
Show More
@@ -1,64 +1,64 b''
1 #!/usr/bin/env bash
1 #!/bin/bash
2 2 # Validate the specified commits against test suite and other checks.
3 3
4 4 if [ -n "$VIRTUAL_ENV" ]; then
5 5 echo "Please run this script from outside a virtualenv."
6 6 exit 1
7 7 fi
8 8
9 9 if ! hg update --check -q .; then
10 10 echo "Working dir is not clean, please commit/revert changes first."
11 11 exit 1
12 12 fi
13 13
14 14 venv=$(mktemp -d kallithea-validatecommits-env-XXXXXX)
15 15 resultfile=$(mktemp kallithea-validatecommits-result-XXXXXX)
16 16 echo > "$resultfile"
17 17
18 18 cleanup()
19 19 {
20 20 rm -rf /tmp/kallithea-test*
21 21 rm -rf "$venv"
22 22 }
23 23 finish()
24 24 {
25 25 cleanup
26 26 # print (possibly intermediate) results
27 27 cat "$resultfile"
28 28 rm "$resultfile"
29 29 }
30 30 trap finish EXIT
31 31
32 32 for rev in $(hg log -r "$1" -T '{node}\n'); do
33 33 hg log -r "$rev"
34 34 hg update "$rev"
35 35
36 36 cleanup
37 37 virtualenv -p "$(command -v python2)" "$venv"
38 38 source "$venv/bin/activate"
39 39 pip install --upgrade pip setuptools
40 40 pip install -e . -r dev_requirements.txt python-ldap python-pam
41 41
42 42 # run-all-cleanup
43 43 scripts/run-all-cleanup
44 44 if ! hg update --check -q .; then
45 45 echo "run-all-cleanup did not give clean results!"
46 46 result="NOK"
47 47 hg diff
48 48 hg revert -a
49 49 else
50 50 result=" OK"
51 51 fi
52 52 echo "$result: $rev (run-all-cleanup)" >> "$resultfile"
53 53
54 54 # pytest
55 55 if py.test; then
56 56 result=" OK"
57 57 else
58 58 result="NOK"
59 59 fi
60 60 echo "$result: $rev (pytest)" >> "$resultfile"
61 61
62 62 deactivate
63 63 echo
64 64 done
General Comments 0
You need to be logged in to leave comments. Login now