This repo hosts the test-runner scripts that are used throughout cbioportal applications. The tests themselves vary from repo to repo, and are contained within the source code (e.g. cbioportal-frontend hosts specs for the frontend).
Before running any of the scripts, make sure to export the required environment variables shown below. If you need access to default values, get in touch with Zain.
set -o allexport
export DOCKER_USERNAME=<docker-username>
export DOCKER_PASSWORD=<docker-password>
export DOCKER_IMAGE_CBIOPORTAL=<docker-compose-image-tag>
export DOCKER_TAG=<build-tag>
export DB_MYSQL_USERNAME=<mysql-username>
export DB_MYSQL_PASSWORD=<mysql-password>
export DB_MYSQL_URL=<mysql-url>
export DB_CLICKHOUSE_USERNAME=<clickhouse-username>
export DB_CLICKHOUSE_PASSWORD=<clickhouse-password>
export DB_CLICKHOUSE_URL=<clickhouse-url>
set +o allexport
All scripts are standalone and can be run independently. They can also be configured by setting the appropriate environment variables and flags.
NOTE: Call scripts from the root directory. If called from any other subdirectory, the relative paths used by scripts will not work.
Build a docker image using the source code provided.
- --src=/path/to/dockerfile (REQUIRED)
- --push=false (If true, push to cbioportal/cbioportal-dev on dockerhub)
- --skip_web=false (If true, skip building the web-shenandoah image)
- --skip_web_and_data=false (If true, skip building the web-and-data image)
# To also push image to DockerHub, set --push=true. Default is false.
sh ./scripts/build-push-image.sh --src=/path/to/dockerfile --push=false
Start a cbioportal instance at localhost:8080. Set the appropriate environment variables to configure the database and docker image to use.
- --portal_type=web (If --portal_type=web-and-data, launch the web-and-data image.)
- --docker_args (Optional docker compose args, e.g. '--detach --build')
- --compose_extensions (Additional compose files to override default, e.g. '-f docker-compose.test.yml')
sh ./scripts/docker-compose.sh --portal_type=web [--docker_args='-d'] [--compose_extensions='-f docker-compose.test.yml']
Import test data into a cbioportal instance running at localhost:8080.
- --seed=/path/to/seed.sql.gz (REQUIRED)
- --schema=/path/to/schema.sql (REQUIRED)
- --studies=/path/to/studies-dir (REQUIRED)
sh ./scripts/import-data.sh --seed=/path/to/seed.sql.gz --schema=/path/to/schema.sql --studies=/path/to/studies-dir
utils is a collection of scripts that are used in main scripts for improved modularity. See documentation for usage instructions.
If docker compose gets stuck at "Database not available yet (first time can take a few minutes to load seed database)... Attempting reconnect...", try pruning the docker system and rerun script:
docker system prune --all --volumes
./scripts/docker-compose.sh