diff --git a/Makefile b/Makefile index f163804..e70388b 100644 --- a/Makefile +++ b/Makefile @@ -38,7 +38,7 @@ check-pep8: cd web && pycodestyle --config=.pycodestyle . check-python: - cd web && python regression/runtests.py --exclude feature_tests + PYTHONPATH=$(PWD)/web pytest -q web/pgadmin check-feature: install-node bundle cd web && python regression/runtests.py --pkg feature_tests diff --git a/README b/README index 2b2cddc..6acf950 100644 --- a/README +++ b/README @@ -116,7 +116,7 @@ process is fairly simple - adapt as required for your distribution: (pgadmin4) $ PATH=$PATH:/usr/local/pgsql/bin pip install -r $PGADMIN4_SRC/requirements.txt - If you are planning to run the regression tests, you also need to install + To run the regression tests, you also need to install additional requirements from web/regression/requirements.txt: (pgadmin4) $ pip install -r $PGADMIN4_SRC/web/regression/requirements.txt @@ -218,6 +218,36 @@ can be used: C:\$PGADMIN4_SRC\web> yarn install C:\$PGADMIN4_SRC\web> yarn run bundle +Testing the application +-------------------- + +The application has tests for the Javascript and Python code, they can be run separatly or all together. +To ensure that the python tests run the PYTHONPATH variable need to exist in the environment, in order to create it +execute the following command: + + $ export PYTHONPATH=$PGADMIN4_SRC/web + $ cd $PYTHONPATH + +To run the Javascript only test the following command can be used: + + (pgadmin4) $ yarn test:karma-once + +To run the Unit Tests on the python code the following command can be used: + + (pgadmin4) $ yarn run test:unit + +To run the Feature Tests on the python code the following command can be used: + + (pgadmin4) $ yarn run test:feature + +To run the All Python Tests the following command can be used: + + (pgadmin4) $ pytest -q pgadmin + +To run the All Tests the following command can be used: + + (pgadmin4) $ yarn run test + Configuring the Runtime ----------------------- diff --git a/web/package.json b/web/package.json index a86d191..9029ae9 100644 --- a/web/package.json +++ b/web/package.json @@ -99,7 +99,7 @@ "bundle": "cross-env NODE_ENV=production yarn run bundle:dev", "test:karma-once": "yarn run linter && yarn run karma start --single-run", "test:karma": "yarn run linter && yarn run karma start", - "test:unit": "yarn run linter && pytest -q pgadmin", + "test:unit": "yarn run pep8 && pytest -q pgadmin", "test:feature": "yarn run bundle && python regression/runtests.py --pkg feature_tests", "test": "yarn run test:karma-once && yarn run bundle && yarn test:unit && python regression/runtests.py --pkg feature_tests", "pep8": "pycodestyle --config=.pycodestyle ."