Skip to content

Commit

Permalink
Created scripts to run the unit and integration tests
Browse files Browse the repository at this point in the history
- Also updated the README with these new commands

[#154301749] https://www.pivotaltracker.com/story/show/154301749

Signed-off-by: Bruce Ricard <[email protected]>
  • Loading branch information
DennisDenuto authored and bruce-ricard committed Mar 7, 2018
1 parent 5a8c489 commit cc5601d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 15 deletions.
22 changes: 7 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,9 @@ grant, the same as used by a client like CF.

You can run the integration tests with docker

$ docker run --privileged -t -i --shm-size=1G -v ~/workspace/uaa:/root/uaa cfidentity/uaa-mysql /root/uaa/scripts/integration-tests.sh mysql,default
$ docker run --privileged -t -i --shm-size=1G -v ~/workspace/uaa:/root/uaa cfidentity/uaa-postgresql /root/uaa/scripts/integration-tests.sh postgresql,default
$ docker run --privileged -t -i --shm-size=1G -v ~/workspace/uaa:/root/uaa cfidentity/uaa-sqlserver /root/uaa/scripts/integration-tests.sh sqlserver,default
$ ~/workspace/uaa/run-integration-tests.sh mysql
$ ~/workspace/uaa/run-integration-tests.sh postgresql
$ ~/workspace/uaa/run-integration-tests.sh sqlserver

will create a docker container running uaa + ldap + database whereby integration tests are run against.

Expand Down Expand Up @@ -282,19 +282,11 @@ Notice how uaa.url can be converted into an environment variable called UAA_URL

The default uaa unit tests (./gradlew test integrationTest) use hsqldb.

To run the unit tests using postgresql:
To run the unit tests with docker:

$ docker run --privileged -t -i -v ~/workspace/uaa:/root/uaa cfidentity/uaa-postgresql /root/uaa/scripts/unit-tests.sh postgresql,default


To run the unit tests using mysql:

$ docker run --privileged -t -i -v ~/workspace/uaa:/root/uaa cfidentity/uaa-mysql /root/uaa/scripts/unit-tests.sh mysql,default


To run the unit tests using sqlserver:

$ docker run --privileged -t -i -v ~/workspace/uaa:/root/uaa cfidentity/uaa-sqlserver /root/uaa/scripts/unit-tests.sh sqlserver,default
$ ~/workspace/uaa/run-unit-tests.sh mysql
$ ~/workspace/uaa/run-unit-tests.sh postgresql
$ ~/workspace/uaa/run-unit-tests.sh sqlserver

## Inventory

Expand Down
8 changes: 8 additions & 0 deletions run-integration-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

set -xeu
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

DB_IMAGE_NAME="$1"

docker run --privileged -t -i --shm-size=1G -v ${SCRIPT_DIR}:/root/uaa cfidentity/uaa-${DB_IMAGE_NAME} /root/uaa/scripts/integration-tests.sh ${DB_IMAGE_NAME},default
8 changes: 8 additions & 0 deletions run-unit-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

set -xeu
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

DB_IMAGE_NAME="$1"

docker run --privileged -t -i --shm-size=1G -v ${SCRIPT_DIR}:/root/uaa cfidentity/uaa-${DB_IMAGE_NAME} /root/uaa/scripts/unit-tests.sh ${DB_IMAGE_NAME},default

0 comments on commit cc5601d

Please sign in to comment.