-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dockertest script to run the test on any img
- run the build image task every time to avoid running the test on stale code - run the test from a script, so that we can run the test on different pre-built images. like: # build an image now and run tests on it make test # run tests on previously built image ./run-test-on-img.sh ipfs-stable # TODO: run test on git ref ./run-test-on-git-ref.sh <git-ref>
- Loading branch information
Showing
2 changed files
with
40 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/sh | ||
if [ "$#" -ne 1 ]; then | ||
echo "usage: $0 <docker-image-ref>" | ||
echo "runs this test on image matching <docker-image-ref>" | ||
exit 1 | ||
fi | ||
|
||
# this tag is used by the dockerfiles in | ||
# {data, server, client, bootstrap} | ||
tag=zaqwsx_ipfs-test-img | ||
|
||
# could use set -v, but i dont want to see the comments... | ||
|
||
img=$(docker images | grep $1 | awk '{print $3}') | ||
echo "using docker image: $img ($1)" | ||
|
||
echo docker tag -f $img $tag | ||
docker tag -f $img $tag | ||
|
||
echo "fig build --no-cache" | ||
fig build --no-cache | ||
|
||
echo "fig up --no-color | tee build/fig.log" | ||
fig up --no-color | tee build/fig.log | ||
|
||
# save the ipfs logs for inspection | ||
echo "make save_logs" | ||
make save_logs | ||
|
||
# fig up won't report the error using an error code, so we grep the | ||
# fig.log file to find out whether the call succeeded | ||
echo 'tail build/fig.log | grep "exited with code 0"' | ||
tail build/fig.log | grep "exited with code 0" |