Scripts
Version 4 (Paul Carensac, 08/08/2016 05:18 pm)
1 | 1 | Paul Carensac | h1. Scripts |
---|---|---|---|
2 | 1 | Paul Carensac | |
3 | 1 | Paul Carensac | Explanations about the scripts. They are located in src/scripts/ folder |
4 | 1 | Paul Carensac | |
5 | 3 | Paul Carensac | {{>toc}} |
6 | 3 | Paul Carensac | |
7 | 1 | Paul Carensac | --- |
8 | 1 | Paul Carensac | |
9 | 1 | Paul Carensac | h3. celery_test.sh |
10 | 1 | Paul Carensac | |
11 | 1 | Paul Carensac | * *Goal* |
12 | 1 | Paul Carensac | Run tests using the production database in order to see the celery results (celery is always running on production database). |
13 | 1 | Paul Carensac | |
14 | 4 | Paul Carensac | * *Argument(s)* |
15 | 2 | Paul Carensac | You need to give the app / TestClass / test_name to run it (prevents a fail test launching, polluting the production DB) |
16 | 2 | Paul Carensac | |
17 | 1 | Paul Carensac | * *How it works ?* |
18 | 1 | Paul Carensac | |
19 | 1 | Paul Carensac | * Moves to src/ folder |
20 | 2 | Paul Carensac | * 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) |
21 | 1 | Paul Carensac | * Runs the test(s) you gave with --kepdb and --nomigrations in order to preserve the production DB |
22 | 2 | Paul Carensac | |
23 | 2 | Paul Carensac | --- |
24 | 2 | Paul Carensac | |
25 | 2 | Paul Carensac | h3. delete_all_request.sh |
26 | 2 | Paul Carensac | |
27 | 2 | Paul Carensac | * *Goal* |
28 | 2 | Paul Carensac | Deletes all the Alerts, Requests, Sequences, Albums and Plan from the current DB (the one chosen in settings.py) |
29 | 2 | Paul Carensac | The goal is to easily clean the DB |
30 | 2 | Paul Carensac | |
31 | 2 | Paul Carensac | * *How it works ?* |
32 | 2 | Paul Carensac | |
33 | 2 | Paul Carensac | * Moves to src/ folder |
34 | 2 | Paul Carensac | * Checks in settings.py whether MySQL or SQLite is used |
35 | 2 | Paul Carensac | * Uses SQL inline command to delete the fields in the current DB |
36 | 2 | Paul Carensac | |
37 | 2 | Paul Carensac | --- |
38 | 2 | Paul Carensac | |
39 | 2 | Paul Carensac | h3. kill_celery_workers.sh |
40 | 2 | Paul Carensac | |
41 | 2 | Paul Carensac | * *Goal* |
42 | 2 | Paul Carensac | Deletes all the celery workers running (in background, or not) |
43 | 2 | Paul Carensac | |
44 | 2 | Paul Carensac | * *How it works ?* |
45 | 2 | Paul Carensac | |
46 | 2 | Paul Carensac | * Lists all the process running on the computer |
47 | 2 | Paul Carensac | * Looks for "celery worker" matching one |
48 | 2 | Paul Carensac | * Gets their PIDs |
49 | 2 | Paul Carensac | * Send them a kill -9 message |
50 | 2 | Paul Carensac | |
51 | 2 | Paul Carensac | --- |
52 | 2 | Paul Carensac | |
53 | 2 | Paul Carensac | h3. start_celery_worker.sh |
54 | 2 | Paul Carensac | |
55 | 2 | Paul Carensac | * *Goal* |
56 | 2 | Paul Carensac | Starts the celery workers, giving them a queue and a name |
57 | 2 | Paul Carensac | |
58 | 2 | Paul Carensac | * *How it works ?* |
59 | 2 | Paul Carensac | |
60 | 2 | Paul Carensac | * Moves to src/ folder |
61 | 2 | Paul Carensac | * Kills the workers still running |
62 | 2 | Paul Carensac | * Starts every worker one by one (in background using '&'), giving them a queue, a name, and purging the associated queue if needed |