Skip to content

Commit 78d60bd

Browse files
author
rubytester
committed
Merge pull request SeleniumHQ#67 from SeleniumHQ/fix_issue_49
test.sh sanity script fails to run Firefox tests
2 parents 52233f0 + c774c2a commit 78d60bd

File tree

2 files changed

+23
-13
lines changed

2 files changed

+23
-13
lines changed

Test/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
FROM node:0.10-onbuild
22
MAINTAINER Selenium <[email protected]>
33

4-
ENV TEST_CMD node smoke-chrome.js && node smoke-firefox.js
4+
ENV TEST_CMD ""
55
# The remainder of this build will be completed by the upstream image's ONBUILD commands

test.sh

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,28 @@ docker logs -f $NODE_CHROME &
2121
docker logs -f $NODE_FIREFOX &
2222
sleep 2
2323

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
3346

3447
if [ ! "$CIRCLECI" == "true" ]; then
3548
echo Tearing down Selenium Chrome Node container
@@ -43,9 +56,6 @@ if [ ! "$CIRCLECI" == "true" ]; then
4356
echo Tearing down Selenium Hub container
4457
docker stop $HUB
4558
docker rm $HUB
46-
47-
echo Removing the test container
48-
docker rm $TEST_CONTAINER
4959
fi
5060

5161
echo Done

0 commit comments

Comments
 (0)