Merge lp:~ubuntuone-hackers/selenium-simple-test/new-ci-script into lp:selenium-simple-test

Proposed by Corey Goldberg
Status: Merged
Approved by: Corey Goldberg
Approved revision: 327
Merged at revision: 327
Proposed branch: lp:~ubuntuone-hackers/selenium-simple-test/new-ci-script
Merge into: lp:selenium-simple-test
Diff against target: 145 lines (+67/-41)
2 files modified
.bzrignore (+1/-0)
ci.sh (+66/-41)
To merge this branch: bzr merge lp:~ubuntuone-hackers/selenium-simple-test/new-ci-script
Reviewer Review Type Date Requested Status
Corey Goldberg (community) Approve
Review via email: mp+140304@code.launchpad.net

Commit message

new CI script

Description of the change

moved runacceptance.sh to ci.sh

added options for running unit tests with nose and acceptance tests with sst.

To post a comment you must log in.
Revision history for this message
Corey Goldberg (coreygoldberg) wrote :

merging/pushing manually as tarmac is down.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.bzrignore'
2--- .bzrignore 2012-12-14 00:42:59 +0000
3+++ .bzrignore 2012-12-17 22:07:33 +0000
4@@ -4,6 +4,7 @@
5 ENV
6 functest.wpu
7 MANIFEST
8+nosetests.xml
9 pep8.log
10 results
11 src/sst.egg-info
12
13=== renamed file 'runacceptance.sh' => 'ci.sh'
14--- runacceptance.sh 2012-12-16 15:33:31 +0000
15+++ ci.sh 2012-12-17 22:07:33 +0000
16@@ -2,7 +2,7 @@
17
18 # bootstrap and run acceptance selftests with browser.
19 #
20-# Invoke script with a browser name as an argument.
21+# Invoke script with a browser name as an argument.
22 # Available browsers are: Firefox and Chrome (Chromium).
23 #
24 # run this script from main directory after getting a branch of SST:
25@@ -10,55 +10,80 @@
26 #
27
28
29-if [ "$1" == "Firefox" ]; then
30- BROWSER="Firefox"
31-elif [ "$1" == "Chrome" ]; then
32- BROWSER="Chrome"
33-elif [ -z "$1" ]; then
34- BROWSER="Firefox"
35-else
36- echo "$1 not recognized. (try: $0 Firefox, or: $0 Chrome)"
37- exit
38-fi
39-
40-rm -rf ENV results *.log
41-
42-virtualenv ENV
43-source ENV/bin/activate
44-
45-if [ -d sst-deps ]; then
46- cd sst-deps
47- bzr pull
48- cd ..
49-else
50- bzr branch lp:~ubuntuone-hackers/selenium-simple-test/sst-deps
51-fi
52-
53+while [ $# -gt 0 ]; do # until you run out of parameters
54+ case "$1" in
55+ --bootstrap)
56+ BOOTSTRAP=1
57+ ;;
58+ --flake8)
59+ FLAKE8=1
60+ ;;
61+ -u|--unit)
62+ UNIT=1
63+ ;;
64+ -a|--acceptance)
65+ BROWSER="$2"
66+ shift
67+ if [[ "$BROWSER" == "Firefox" || "$BROWSER" == "firefox" ]]; then
68+ BROWSER="Firefox"
69+ elif [[ "$BROWSER" == "Chrome" || "$BROWSER" == "chrome" ]]; then
70+ BROWSER="Chrome"
71+ else
72+ echo "browser format $1 not recognized."
73+ echo "(try: -a Firefox, or: $0 -a Chrome)"
74+ exit
75+ fi
76+ ;;
77+ esac
78+ shift # check next set of parameters
79+done
80+
81+if [ -n "$BOOTSTRAP" ]; then
82+ echo "cleaning up..."
83+ rm -rf ENV results *.log *.xml
84+ echo "getting dependencies..."
85+ if [ -d sst-deps ]; then
86+ cd sst-deps
87+ bzr pull
88+ cd ..
89+ else
90+ bzr branch lp:~ubuntuone-hackers/selenium-simple-test/sst-deps
91+ fi
92+ echo "creating virtualenv..."
93+ virtualenv ENV
94+ source ENV/bin/activate
95+ echo "installing modules from depenencies branch..."
96+ pip install sst-deps/*.tar.gz
97+else
98+ source ENV/bin/activate
99+fi
100+
101+echo "setting path..."
102 PATH=sst-deps:$PATH # so bindings find chromedriver
103
104-pip install sst-deps/*.tar.gz
105-
106-echo "running flake8 (pyflakes/pep8) checks..."
107-flake8 src/ docs/ sst-remote sst-run *.py > flake8.log
108-echo "flake8 checks done."
109-
110-echo "----------------"
111+if [ -n "$FLAKE8" ]; then
112+ echo "running flake8 (pyflakes/pep8) checks..."
113+ flake8 src/ docs/ sst-* *.py > flake8.log
114+fi
115+
116+echo "-----------------"
117 echo "environment info:"
118-echo "----------------"
119+echo "-----------------"
120
121 python -V
122 python -c "import django; print 'Django %s' % django.get_version()"
123 python -c "import selenium; print 'Selenium %s' % selenium.__version__"
124 ./sst-run -V
125
126-case "$BROWSER" in
127- "Firefox")
128+if [ -n "$UNIT" ]; then
129+ nosetests --with-xunit -e ENV -e testproject
130+fi
131+
132+if [ -n "$BROWSER" ]; then
133+ if [ "$BROWSER" == "Firefox" ]; then
134 firefox -v
135- ./sst-run --test -x -s -r xml -b Firefox --extended-tracebacks
136- ;;
137- "Chrome")
138- ./sst-run --test -x -s -r xml -b Chrome --extended-tracebacks
139- ;;
140-esac
141+ fi
142+ ./sst-run --test -x -s -r xml -b $BROWSER --extended-tracebacks
143+fi
144
145 echo "Done."

Subscribers

People subscribed via source and target branches