Skip to content

Commit 01debb5

Browse files
author
Aaron Delaney
committed
Add run_test.sh to run tests in build container
1 parent 46d76f8 commit 01debb5

File tree

6 files changed

+38
-3
lines changed

6 files changed

+38
-3
lines changed

build_container/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ RUN pip3 install grpcio grpcio-tools googleapis-common-protos
2121
# Dependencies for skinny server
2222
RUN go get -u github.com/gorilla/mux
2323

24-
CMD ["/repo/build_container/build.sh"]
24+
CMD ["/repo/build_container/entry.sh"]

build_container/entry.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env sh
2+
3+
set -e
4+
5+
export LOCAL_USER_ID
6+
export TEST_RABBLE
7+
8+
/repo/build_container/build.sh
9+
10+
if [ -n "${TEST_RABBLE}" ]
11+
then
12+
/repo/build_container/test.sh
13+
fi

build_container/test.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env sh
2+
3+
set -e
4+
5+
cd /repo
6+
7+
cd chump/ && npm run lint && npm run test && cd ..
8+
9+
# once we clean up the go build management, we should just be
10+
# able to run go test /go/src/github.com/cppsd/rabble/...
11+
# for all go dependencies
12+
13+
go test skinny/*.go

chump/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"build:prod": "webpack --config webpack.config.js -d --mode production",
99
"start": "webpack-dev-server --mode development --content-base ./dist --hot --inline --colors --port 3000 --open",
1010
"lint": "tslint --project .",
11-
"clean": "rm -rf dist/*"
11+
"clean": "rm -rf dist/*",
12+
"test": "echo 'testing'"
1213
},
1314
"repository": {
1415
"type": "git",

run_build.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#!/usr/bin/env sh
2-
32
set -e
43

4+
# run_build.sh builds all of docker's build using the build_container.
5+
# if _TEST_RABBLE is set, then it also runs the test script.
6+
57
USER_ID=`id -u $USER`
68

79
REPO_ROOT="$(git rev-parse --show-toplevel)"
@@ -27,6 +29,7 @@ docker run \
2729
--rm \
2830
--volume $REPO_ROOT:/repo \
2931
-e LOCAL_USER_ID=$USER_ID \
32+
-e TEST_RABBLE=$_TEST_RABBLE \
3033
rabble_build:latest
3134

3235
echo "Done build"

run_test.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env sh
2+
3+
set -e
4+
5+
_TEST_RABBLE=ALL ./run_build.sh

0 commit comments

Comments
 (0)