Some ./run_test.sh flags not working with Django 1.5 (SECRET_KEY)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Dashboard (Horizon) |
Fix Released
|
High
|
Gabriel Hurley |
Bug Description
When using Django 1.5, some of the run_tests.sh commands that rely on manage.py don't work by default anymore, e.g.
$ ./run_tests.sh --compilemessages
Checking environment.
Environment is up to date.
WARNING:root:No local_settings file found.
ImproperlyConfi
$ ./run_tests.sh -m startdash mydash
Checking environment.
Environment is up to date.
WARNING:root:No local_settings file found.
Unknown command: 'startdash'
Type 'manage.py help' for usage.
It's unhappy about the lack of SECRET_KEY in openstack_
We should either make it work out of the box, or update http://
Changed in horizon: | |
importance: | Undecided → High |
milestone: | none → havana-1 |
status: | New → Confirmed |
Changed in horizon: | |
milestone: | havana-1 → havana-2 |
Changed in horizon: | |
assignee: | nobody → Lin Hua Cheng (lin-hua-cheng) |
Changed in horizon: | |
milestone: | havana-2 → havana-3 |
Changed in horizon: | |
assignee: | Lin Hua Cheng (lin-hua-cheng) → nobody |
Changed in horizon: | |
assignee: | nobody → Victoria Martínez de la Cruz (vkmc) |
Changed in horizon: | |
assignee: | Victoria Martínez de la Cruz (vkmc) → nobody |
Changed in horizon: | |
assignee: | nobody → Simon Luo (simon-t) |
Changed in horizon: | |
assignee: | Simon Luo (simon-t) → nobody |
assignee: | nobody → Gabriel Hurley (gabriel-hurley) |
Changed in horizon: | |
status: | Confirmed → In Progress |
Changed in horizon: | |
status: | In Progress → Fix Committed |
Changed in horizon: | |
status: | Fix Committed → Fix Released |
Changed in horizon: | |
milestone: | havana-3 → 2013.2 |
Having in mind that the intention behind SECRET_KEY is that it it should not be present in the settings, but explicitly requires a manual intervention, to automate testing, a different approach is needed. I see two possible solutions for solving this issue so far:
1. A check in run_tests.sh for local_settings.py, and creating temp file with a SECRET_KEY, which should be removed after test are run. But there is always a probability the tests to be interrupted and the temp file to remain in dir, which might be somehow dangerous. Also this requires write permissions for openstack_ dashboard/ local dir, which might not work if someone tries to execute run_tests from a pip-installed version. Is it intended to be run that way?
2. To create a new executable - manage-test.py, which will inject a SECRET_KEY if it is missing, and will be used in run_tests.sh only. This is the case when we really want 'SECRET_KEY' to be only manually added from local_settings.py example file...
IMO the automation of SECRET_KEY generation for tests should not leave any traces anywhere, thus needs to be done dynamically, FOR TESTS ONLY.