-
Notifications
You must be signed in to change notification settings - Fork 2
Testing locally
lefreud edited this page May 1, 2021
·
4 revisions
Requirements:
- terraform installed and available in PATH
- clouds.yaml and OS_CLOUD configured
- cloudflare API environment variables configured
If you want to run tests and the server locally without Docker:
- git clone the repo :
git clone https://www.github.com/ComputeCanada/mc-hub.git
- Create a virtual environment :
python3 -m venv venv
- Source the environment:
source venv/bin/activate
- Install the Python dependencies:
pip install -r mc-hub/app/requirements.txt
- Create a
configuration.json
that fits the requirements details in MC-Hub documentation - Create the folder hierarchy:
mkdir -p clusters database
- Configure the following environment variables:
export MCH_CONFIGURATION_FILE_PATH=$PWD
export MCH_APP_PATH=$PWD/mc-hub/app
export MCH_CLUSTERS_PATH=$PWD/clusters
export MCH_DATABASE_PATH=$PWD/database
- Build the frontend:
cd mc-hub/frontend
npm install
npm run build
cd -
- Create a link to frontend build:
cd mc-hub
ln -s frontend/dist dist
cd -
- Run the backend tests
python -m pytest
python -m pytest --build-live-cluster
- Run the frontend tests
cd mc-hub/frontend
npm run test:unit