A Flask Web-service for visualising Flask-Monitoring-Dashboards
You can view a live deployment of this repository at pydash.io
Use this branch for weekly deadlines
Push to this branch as soon as you've implemented a feature.
This app manages its language-version dependencies using the ASDF Version Manager.
More information on how to install this can be found in ./docs/setting-up-virtual-env-using-asdf.md
Before running your application for the first time (and possibly after a lot of changes have occurred in the development version), you will want to re-seed your application, using:
./build_and_run.sh databasebg seed
In this case, running ./build_and_run.sh is enough. This will install front-end dependencies, build the front-end react application, install back-end dependencies, and then start the back-end (which serves the react app and the API) including the database.
The application can be closed using Ctrl+C.
In the event that the database does not properly close, use killall runzeo.
./build_and_run.sh databasebg backend
./build_and_run.sh build
Ensure that the Flask back-end+database is running using above steps.
In one shell:
./build_and_run.sh databasebg server
In another:
./build_and_run.sh frontend
Tests are written using pytest, with a couple of plugins:
pytest-xdistis used to spread test running over all available CPU cores.pytest-random-orderis used to randomize the order tests are run in, to prevent unwanted coupling between tests.pytest-covis used to show code-line coverage of a test run.pytest-bddis used to write feature (integration) tests using the Gherkin specification language.pytest-splinteris used to run the feature (integration) tests using an automated browser.pytest-flaskandpytest-localserverare used to server the Flask-app during testing to the automated browser.
Tests as a whole can be run by:
./build_and_run.sh test
To do this manually:
- move into the
pydashfolder - Setup your virtual environment using
./start_pipenv.sh. - Run
pytest.
Do note that for the integration tests, you will need the chromedriver binary (that can be found in your OS distribution's package manager).
You might also need to install development dependencies. This is done by running cd pydash && pipenv install --dev && cd ..
Follow the manual steps as above, but instead of pytest, run pytest -k "not features"
Follow the manual steps as above, but instead of pytest, run pytest -k "features"
Follow the manual steps as above, but instead of pytest, run pytest -f