File tree Expand file tree Collapse file tree 5 files changed +17
-4
lines changed Expand file tree Collapse file tree 5 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -7,4 +7,8 @@ services:
77
88before_install :
99 - docker build -t eficode/wait-for .
10+
11+ script :
12+ - npm install
13+ - ./run_tests.sh
1014 - docker run eficode/wait-for
Original file line number Diff line number Diff line change @@ -8,4 +8,5 @@ WORKDIR /app
88COPY . /app
99RUN npm install
1010
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 22 "name" : " wait-for" ,
33 "version" : " 0.1.0" ,
44 "scripts" : {
5- "test" : " ./node_modules/.bin/bats wait-for.bats "
5+ "test" : " ./run_tests.sh "
66 },
77 "dependencies" : {
88 "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
22
33OLD_TIMEOUT=$TIMEOUT
44OLD_QUIET=$QUIET
3434
3535test_connection () {
3636 # 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
3838 nc -w 1 -G 1 " $1 " " $2 " > /dev/null 2>&1
3939 else
4040 nc -w 1 " $1 " " $2 " > /dev/null 2>&1
You can’t perform that action at this time.
0 commit comments