Scripts
Version 1 (Paul Carensac, 05/13/2016 03:50 pm) → Version 2/10 (Paul Carensac, 05/13/2016 03:59 pm)
h1. Scripts
Explanations about the scripts. They are located in src/scripts/ folder
---
h3. celery_test.sh
* *Goal*
Run tests using the production database in order to see the celery results (celery is always running on production database).
* *Argument(s)
*How it works ?*
* You need to give the app / TestClass / test_name to run it (prevents a fail test launching, polluting the production DB)
* *How it works ?*
* Moves to src/ folder
* Uses sed command to set CELERY_TEST variable to 'True' in settings.py (The
* The consequence of it is that the production DB will be chosen for tests in settings.py) settings.py
* Runs the test(s) you gave with --kepdb and --nomigrations in order to preserve the production DB
---
h3. delete_all_request.sh
* *Goal*
Deletes all the Alerts, Requests, Sequences, Albums and Plan from the current DB (the one chosen in settings.py)
The goal is to easily clean the DB
* *How it works ?*
* Moves to src/ folder
* Checks in settings.py whether MySQL or SQLite is used
* Uses SQL inline command to delete the fields in the current DB
---
h3. kill_celery_workers.sh
* *Goal*
Deletes all the celery workers running (in background, or not)
* *How it works ?*
* Lists all the process running on the computer
* Looks for "celery worker" matching one
* Gets their PIDs
* Send them a kill -9 message
---
h3. start_celery_worker.sh
* *Goal*
Starts the celery workers, giving them a queue and a name
* *How it works ?*
* Moves to src/ folder
* Kills the workers still running
* Starts every worker one by one (in background using '&'), giving them a queue, a name, and purging the associated queue if needed
Explanations about the scripts. They are located in src/scripts/ folder
---
h3. celery_test.sh
* *Goal*
Run tests using the production database in order to see the celery results (celery is always running on production database).
* *Argument(s)
*How it works ?*
* You need to give the app / TestClass / test_name to run it (prevents a fail test launching, polluting the production DB)
* *How it works ?*
* Moves to src/ folder
* Uses sed command to set CELERY_TEST variable to 'True' in settings.py (The
* The consequence of it is that the production DB will be chosen for tests in settings.py) settings.py
* Runs the test(s) you gave with --kepdb and --nomigrations in order to preserve the production DB
---
h3. delete_all_request.sh
* *Goal*
Deletes all the Alerts, Requests, Sequences, Albums and Plan from the current DB (the one chosen in settings.py)
The goal is to easily clean the DB
* *How it works ?*
* Moves to src/ folder
* Checks in settings.py whether MySQL or SQLite is used
* Uses SQL inline command to delete the fields in the current DB
---
h3. kill_celery_workers.sh
* *Goal*
Deletes all the celery workers running (in background, or not)
* *How it works ?*
* Lists all the process running on the computer
* Looks for "celery worker" matching one
* Gets their PIDs
* Send them a kill -9 message
---
h3. start_celery_worker.sh
* *Goal*
Starts the celery workers, giving them a queue and a name
* *How it works ?*
* Moves to src/ folder
* Kills the workers still running
* Starts every worker one by one (in background using '&'), giving them a queue, a name, and purging the associated queue if needed