Open gloriajw opened 2 months ago
cp .env.unit_test .env
export $(grep -v '^#' .env | xargs)
export PGPASSWORD=$DATABASE_PASSWORD
psql -h $DATABASE_HOST -p $DATABASE_PORT -U $DATABASE_USER -c "DROP DATABASE IF EXISTS $DATABASE_NAME;"
psql -h $DATABASE_HOST -p $DATABASE_PORT -U $DATABASE_USER -c "CREATE DATABASE $DATABASE_NAME;"
alembic upgrade head
coverage run -m pytest
psql -h $DATABASE_HOST -p $DATABASE_PORT -U $DATABASE_USER -c "DROP DATABASE IF EXISTS $DATABASE_NAME;"
@gloriajw here is the setup when run tests with create and destroy the database
Here is the result when I run coverage report
Beautiful! Try to get it as close to 100 as possible. very good.
cp .env.unit_test .env export $(grep -v '^#' .env | xargs) export PGPASSWORD=$DATABASE_PASSWORD psql -h $DATABASE_HOST -p $DATABASE_PORT -U $DATABASE_USER -c "DROP DATABASE IF EXISTS $DATABASE_NAME;" psql -h $DATABASE_HOST -p $DATABASE_PORT -U $DATABASE_USER -c "CREATE DATABASE $DATABASE_NAME;" alembic upgrade head coverage run -m pytest psql -h $DATABASE_HOST -p $DATABASE_PORT -U $DATABASE_USER -c "DROP DATABASE IF EXISTS $DATABASE_NAME;"
@gloriajw here is the setup when run tests with create and destroy the database
Please use the same backend settings convention for test configuration as we use for standard configuration. Call the test config file test_config.py, place it in the same config dir as the server one, and use it to do this configuration. The rest looks good!
Please add pycoverage test results here for the asset code you've completed. Thank you!
Hi @gloriajw
Here is the current coverage tests Next path , I will add coverage test for stage module and fix for asset module
Report 26/09/2024 Hi @gloriajw Here is the current coverage tests I'm adding for module and fix for asset module
Report 27/09/2024
Hi @gloriajw Here is the current coverage tests
Report 3/10/2024
Writing coverage tests for stages and studio module
Report 06/10/2024
Hi @gloriajw Here is the current coverage test result
Report 7/10/2024 Hi @gloriajw I'm adding pycoverage test for studio module
Hi @gloriajw Report 10/10/2024 Here is the current coverage test result
Unit tests for each module should be invoked by pycoverage. Please create and destroy the test DB outside of the test framework, so that each setUp and tearDown is not recreating it. This implies the need for a control script that does setup, runs all tests under pycoverage, and then does the teardown.
Please start with the auth system and the current tests you have, and let's see the coverage we're getting.