File tree 5 files changed +17
-4
lines changed
5 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -7,4 +7,8 @@ services:
7
7
8
8
before_install :
9
9
- docker build -t eficode/wait-for .
10
+
11
+ script :
12
+ - npm install
13
+ - ./run_tests.sh
10
14
- docker run eficode/wait-for
Original file line number Diff line number Diff line change @@ -8,4 +8,5 @@ WORKDIR /app
8
8
COPY . /app
9
9
RUN npm install
10
10
11
- CMD ./node_modules/.bin/bats wait-for.bats
11
+ # On launch, run the test suite via npm
12
+ CMD npm test
Original file line number Diff line number Diff line change 2
2
"name" : " wait-for" ,
3
3
"version" : " 0.1.0" ,
4
4
"scripts" : {
5
- "test" : " ./node_modules/.bin/bats wait-for.bats "
5
+ "test" : " ./run_tests.sh "
6
6
},
7
7
"dependencies" : {
8
8
"bats" : " ^0.4.2"
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ # Although it would be possible to just call this directly from the Dockerfile,
4
+ # centralizing tests in this file allows both the docker container and the
5
+ # CI machine to run the same set of tests for an additional datapoint --
6
+ # which gives a better chance of turning up POSIX noncompliance
7
+
8
+ ./node_modules/.bin/bats wait-for.bats
Original file line number Diff line number Diff line change 1
- #! /bin/sh
1
+ #! /usr/ bin/env bash
2
2
3
3
OLD_TIMEOUT=$TIMEOUT
4
4
OLD_QUIET=$QUIET
34
34
35
35
test_connection () {
36
36
# force a 1-second timeout on darwin (https://stackoverflow.com/a/20460402/2063546)
37
- if [ -z " ${$ OSTYPE##* darwin* } " ] ; then
37
+ if [ -z " ${OSTYPE##* darwin* } " ] ; then
38
38
nc -w 1 -G 1 " $1 " " $2 " > /dev/null 2>&1
39
39
else
40
40
nc -w 1 " $1 " " $2 " > /dev/null 2>&1
You can’t perform that action at this time.
0 commit comments