-
Notifications
You must be signed in to change notification settings - Fork 511
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix lint issue, and reconfigure build scripts so db test and integrat…
…ion test are separate. Signed-off-by: Ying Li <[email protected]>
- Loading branch information
Showing
10 changed files
with
92 additions
and
66 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 |
---|---|---|
@@ -1,19 +1,17 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
set +x | ||
case $CIRCLE_NODE_INDEX in | ||
0) docker run --rm -e NOTARY_BUILDTAGS=pkcs11 --env-file buildscripts/env.list --user notary notary_client bash -c "make ci && codecov" | ||
;; | ||
1) docker run --rm -e NOTARY_BUILDTAGS=none --env-file buildscripts/env.list --user notary notary_client bash -c "make ci && codecov" | ||
;; | ||
2) SKIPENVCHECK=1 make TESTDB=mysql integration | ||
2) SKIPENVCHECK=1 make TESTDB=mysql testdb | ||
SKIPENVCHECK=1 make TESTDB=mysql integration | ||
;; | ||
3) SKIPENVCHECK=1 make TESTDB=rethink integration | ||
3) SKIPENVCHECK=1 make TESTDB=rethink testdb | ||
SKIPENVCHECK=1 make TESTDB=rethink integration | ||
;; | ||
4) docker run --rm -e NOTARY_BUILDTAGS=pkcs11 notary_client make vet lint fmt misspell | ||
;; | ||
esac | ||
|
||
set +e | ||
set +x |
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,52 @@ | ||
#!/usr/bin/env bash | ||
|
||
db="$1" | ||
|
||
case ${db} in | ||
mysql*) | ||
db="mysql" | ||
dbContainerOpts="--name mysql_tests mysql mysqld --innodb_file_per_table" | ||
DBURL="server@tcp(mysql_tests:3306)/notaryserver?parseTime=True" | ||
;; | ||
rethink*) | ||
db="rethink" | ||
dbContainerOpts="--name rethinkdb_tests rdb-01 --bind all --driver-tls-key /tls/key.pem --driver-tls-cert /tls/cert.pem" | ||
DBURL="rethinkdb_tests" | ||
;; | ||
esac | ||
|
||
composeFile="development.${db}.yml" | ||
project=dbtests | ||
|
||
function cleanup { | ||
rm -f bin/notary | ||
docker-compose -p "${project}_${db}" -f "${composeFile}" kill | ||
# if we're in CircleCI, we cannot remove any containers | ||
if [[ -z "${CIRCLECI}" ]]; then | ||
docker-compose -p "${project}_${db}" -f "${composeFile}" down -v --remove-orphans | ||
fi | ||
} | ||
|
||
clientCmd="make test" | ||
if [[ -z "${CIRCLECI}" ]]; then | ||
BUILDOPTS="--force-rm" | ||
else | ||
clientCmd="make ci && codecov" | ||
fi | ||
|
||
set -e | ||
set -x | ||
|
||
cleanup | ||
|
||
docker-compose -p "${project}_${db}" -f ${composeFile} build ${BUILDOPTS} client | ||
|
||
trap cleanup SIGINT SIGTERM EXIT | ||
|
||
# run the unit tests that require a DB | ||
|
||
docker-compose -p "${project}_${db}" -f "${composeFile}" run --no-deps -d ${dbContainerOpts} | ||
docker-compose -p "${project}_${db}" -f "${composeFile}" run --no-deps \ | ||
-e NOTARY_BUILDTAGS="${db}db" -e DBURL="${DBURL}" \ | ||
-e PKGS="github.com/docker/notary/server/storage" \ | ||
client bash -c "${clientCmd}" |
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 |
---|---|---|
|
@@ -38,3 +38,5 @@ WORKSPACE | |
# TRAVIS_REPO_SLUG | ||
# TRAVIS_COMMIT | ||
# TRAVIS_BUILD_DIR | ||
|
||
SKIPENVCHECK=1 |
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
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
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