File tree Expand file tree Collapse file tree 2 files changed +23
-13
lines changed Expand file tree Collapse file tree 2 files changed +23
-13
lines changed Original file line number Diff line number Diff line change 1
1
FROM node:0.10-onbuild
2
2
MAINTAINER Selenium <
[email protected] >
3
3
4
- ENV TEST_CMD node smoke-chrome.js && node smoke-firefox.js
4
+ ENV TEST_CMD ""
5
5
# The remainder of this build will be completed by the upstream image's ONBUILD commands
Original file line number Diff line number Diff line change @@ -21,15 +21,28 @@ docker logs -f $NODE_CHROME &
21
21
docker logs -f $NODE_FIREFOX &
22
22
sleep 2
23
23
24
- echo Running test container...
25
- docker run -it --link $HUB_NAME :hub selenium/test:local
26
- STATUS=$?
27
- TEST_CONTAINER=$( docker ps -aq | head -1)
28
-
29
- if [ ! $STATUS == 0 ]; then
30
- echo Failed
31
- exit 1
32
- fi
24
+ function test_node {
25
+ BROWSER=$1
26
+ echo Running $BROWSER test...
27
+ TEST_CMD=" node smoke-$BROWSER .js"
28
+ docker run -it --link $HUB_NAME :hub -e TEST_CMD=" $TEST_CMD " selenium/test:local
29
+ STATUS=$?
30
+ TEST_CONTAINER=$( docker ps -aq | head -1)
31
+
32
+ if [ ! $STATUS == 0 ]; then
33
+ echo Failed
34
+ exit 1
35
+ fi
36
+
37
+ if [ ! " $CIRCLECI " == " true" ]; then
38
+ echo Removing the test container
39
+ docker rm $TEST_CONTAINER
40
+ fi
41
+
42
+ }
43
+
44
+ test_node chrome $DEBUG
45
+ test_node firefox $DEBUG
33
46
34
47
if [ ! " $CIRCLECI " == " true" ]; then
35
48
echo Tearing down Selenium Chrome Node container
@@ -43,9 +56,6 @@ if [ ! "$CIRCLECI" == "true" ]; then
43
56
echo Tearing down Selenium Hub container
44
57
docker stop $HUB
45
58
docker rm $HUB
46
-
47
- echo Removing the test container
48
- docker rm $TEST_CONTAINER
49
59
fi
50
60
51
61
echo Done
You can’t perform that action at this time.
0 commit comments