« Previous - Version 3/10 (diff) - Next » - Current version
Paul Carensac, 05/13/2016 04:01 pm


Scripts

Explanations about the scripts. They are located in src/scripts/ folder


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)
    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 consequence is that the production DB will be chosen for tests in settings.py)
    • Runs the test(s) you gave with --kepdb and --nomigrations in order to preserve the production DB

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

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

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