aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* Allow use of Docker for developmentDaniel Axtens2016-08-20
| | | | | | | | | | | | | | | | | | | | | | | | | | This makes it possible to use Docker and docker-compose for development as an alternative to Vagrant. I quite liked vagrant a couple of years ago, but currently: * Trying to install VirtualBox on Ubuntu wants me to disable Secure Boot, and I don't want to do that. * Trying to use the libvirt plugin for vagrant requires I pick from a very small set of possible images, and requires that I install the upstream vagrant rather than the vagrant shipped with Ubuntu 16.04 * I find docker containers faster to work with and more transparent. So I've done the work to make docker work for Patchwork development. This doesn't break or in any way interfere with using Vagrant, it just provides an alternative. It includes support for headless selenium tests using Chromium. Signed-off-by: Daniel Axtens <dja@axtens.net> Reviewed-by: Stephen Finucane <stephenfinucane@hotmail.com>
* Put test db host and port into env variablesDaniel Axtens2016-08-20
| | | | | | | | This is preparation for a Docker-based dev environment. Signed-off-by: Daniel Axtens <dja@axtens.net> Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Reviewed-by: Stephen Finucane <stephenfinucane@hotmail.com>
* Ignore *~ and #*# files.Daniel Axtens2016-08-20
| | | | | | Signed-off-by: Daniel Axtens <dja@axtens.net> Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Reviewed-by: Stephen Finucane <stephenfinucane@hotmail.com>
* Fix test_login in test_user_browser.pyDaniel Axtens2016-08-20
| | | | | | | | | | | | It tried to use the pbkdf2 hash as the password. Use the username instead, as that is what create_user sets. Then it compared the test user username to testuser, rather than the username, which is dynamically generated. Compare to the generated username. Signed-off-by: Daniel Axtens <dja@axtens.net> Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Reviewed-by: Stephen Finucane <stephenfinucane@hotmail.com>
* Fix failure to start with uninitalised databaseDaniel Axtens2016-08-20
| | | | | | | | | | | An OptionalModelChoiceField will attempt to query the database to get choices in its __init__ method. This fails if the database hasn't been initialised yet. So, put that in a try/catch block. This lets things work through the migration and loading of data from fixtures. Signed-off-by: Daniel Axtens <dja@axtens.net> Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Reviewed-by: Stephen Finucane <stephenfinucane@hotmail.com>
* settings: Add PASSWORD_HASHERStephen Finucane2016-08-13
| | | | | | | This improves run time by a few seconds, and is worth having. Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Tested-by: Andy Doan <andy.doan@linaro.org>
* settings: Regroup sections per upstream docsStephen Finucane2016-08-13
| | | | Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
* docs: Alter heading of development install guideStephen Finucane2016-08-13
| | | | | | | | Divide the document into a Vagrant-based install section, and a manual install section (+ footnotes). Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Reviewed-by: Andy Doan <andy.doan@linaro.org>
* xmlrpc: Don't load all Patches into memoryStephen Finucane2016-08-13
| | | | | | | | | | | | | | | The way that reverse indexing of patches was implemented is broken. At present, it will retrieve all patches in memory and return the length from that data, then the slicing operation will then happen without querying the DB and slice the results cached from the len() evaluation. This is memory intensive, particularly for larger instances. Take advantage of Django's lazy loading to avoid this. Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Suggested-by: Damien Lespiau <damien.lespiau@intel.com> Reviewed-by: Andy Doan <andy.doan@linaro.org>
* tests: Address nits in 'utils'Stephen Finucane2016-07-15
| | | | | | | | Simplify object creation through creation of the 'objects.create' shortcut. In addition, remove an unncessary 'save' call. Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Reviewed-by: Andy Doan <andy.doan@linaro.org>
* parsemail: Ignore multiple cover lettersRussell Currey2016-07-15
| | | | | | | | | If multiple cover letters are found, parsemail dies with a MultipleObjectsReturned exception. This is particularly problematic in the middle of a parsearchive run, so just ignore multiple cover letters. Signed-off-by: Russell Currey <ruscur@russell.cc> Reviewed-by: Stephen Finucane <stephen.finucane@intel.com>
* uwsgi: Add python pluginRussell Currey2016-07-15
| | | | | | | | | Given the documentation suggests using Ubuntu, and any Debian derivative requires manually specifying plugins in uwsgi, add the python27 plugin to the example uwsgi settings file. Signed-off-by: Russell Currey <ruscur@russell.cc> Reviewed-by: Stephen Finucane <stephen.finucane@intel.com>
* docs/deployment: Fix systemctl commandsRussell Currey2016-07-15
| | | | | | | | | systemctl takes the name of the operation before the name of the service so that you can do multiple things at once, i.e. "systemctl status nginx postgresql". Fix the ordering of the arguments. Signed-off-by: Russell Currey <ruscur@russell.cc> Reviewed-by: Stephen Finucane <stephen.finucane@intel.com>
* tests: Don't create model objects unless necessaryStephen Finucane2016-07-12
| | | | | | | | | Creating model objects when not required introduces unnecessary overhead and delays the tests. Avoid this by only creating new objects when one isn't provided for us already. Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Reviewed-by: Andy Doan <andy.doan@linaro.org>
* tests: Remove 'default_states' fixture requirementStephen Finucane2016-07-12
| | | | | | | | | | | | | The 'default_states' fixture is used in many tests. However, the 'default_states' are merely suggestions for various States, and the names themselves have no meaning from a patchwork perspective. In addition, these fixtures significantly increase run time of the tests. Resolve this by creating new State objects on demand, rather than using versions provided by the fixture. Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Reviewed-by: Andy Doan <andy.doan@linaro.org>
* tests: Remove 'defaults' classStephen Finucane2016-07-12
| | | | | | | This is no longer needed and can be removed. Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Reviewed-by: Andy Doan <andy.doan@linaro.org>
* tests: Clean up 'test_rest_api'Stephen Finucane2016-07-12
| | | | | Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Reviewed-by: Andy Doan <andy.doan@linaro.org>
* tests: Move 'create_check' to utilsStephen Finucane2016-07-12
| | | | | | | This is also useful for the REST API tests. Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Reviewed-by: Andy Doan <andy.doan@linaro.org>
* tests: Rework and rename 'test_patchparser'Stephen Finucane2016-07-12
| | | | | | | | | | * Move some functions and variables from 'tests.utils', where they are only used in this file * Rename and regroup some tests to make more sense * Rename to 'test_parser', as this parses more than patches now Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Reviewed-by: Andy Doan <andy.doan@linaro.org>
* tests: Clean up 'test_patchparser'Stephen Finucane2016-06-30
| | | | | | | | | | * Make use of 'create_' helper functions * Include every import on its own line * Use underscore_case, rather than camelCase * Rename some functions to make more sense Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Reviewed-by: Andy Doan <andy.doan@linaro.org>
* tests: Clean up 'test_xmlrpc'Stephen Finucane2016-06-30
| | | | | | | * Use underscore_case, rather than camelCase Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Reviewed-by: Andy Doan <andy.doan@linaro.org>
* tests: Clean up 'test_user_browser'Stephen Finucane2016-06-30
| | | | | | | * Don't use hardcode routes: use the reverse function instead Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Reviewed-by: Andy Doan <andy.doan@linaro.org>
* tests: Clean up 'test_user'Stephen Finucane2016-06-30
| | | | | | | | | | | | | | | | * Don't use hardcode routes: use the reverse function instead * Make use of 'create_' helper functions * Minimize duplication of code * Remove unneeded 'XXX.objects.delete()' calls (all objects are deleted on teardown of each test) * Include every import on its own line * Use underscore_case, rather than camelCase This includes one trivial, albeit necessary, removal of an import from 'test_user_browser'. Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Reviewed-by: Andy Doan <andy.doan@linaro.org>
* tests: Clean up 'test_updates'Stephen Finucane2016-06-30
| | | | | | | | | | * Make use of 'create_' helper functions * Include every import on its own line * Use underscore_case, rather than camelCase * Be consistent in how 'Patch.objects.get()' is called Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Reviewed-by: Andy Doan <andy.doan@linaro.org>
* tests: Clean up 'test_tags'Stephen Finucane2016-06-30
| | | | | | | | | | * Make use of 'create_' helper functions * Remove unneeded 'XXX.objects.delete()' calls (all objects are deleted on teardown of each test) * Use underscore_case, rather than camelCase Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Reviewed-by: Andy Doan <andy.doan@linaro.org>
* tests: Rename 'test_person'Stephen Finucane2016-06-30
| | | | | | | | Reflect the purpose of these tests - validation of the autocomplete feature - in the filename. Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Reviewed-by: Andy Doan <andy.doan@linaro.org>
* tests: Clean up 'test_person'Stephen Finucane2016-06-30
| | | | | | | | | | * Don't use hardcode routes: use the reverse function instead * Make use of 'create_' helper functions * Include every import on its own line * Use underscore_case, rather than camelCase Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Reviewed-by: Andy Doan <andy.doan@linaro.org>
* tests: Clean up 'test_notifications'Stephen Finucane2016-06-30
| | | | | | | | | | | * Make use of 'create_' helper functions * Remove unneeded 'XXX.objects.delete()' calls (all objects are deleted on teardown of each test) * Include every import on its own line * Use underscore_case, rather than camelCase Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Reviewed-by: Andy Doan <andy.doan@linaro.org>
* tests: Clean up 'test_mboxviews'Stephen Finucane2016-06-30
| | | | | | | | | | | * Don't use hardcode routes: use the reverse function instead * Make use of 'create_' helper functions * Include every import on its own line * Use underscore_case, rather than camelCase * Rename and regroup some tests to make more sense Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Reviewed-by: Andy Doan <andy.doan@linaro.org>
* tests: Clean up 'test_mail_settings'Stephen Finucane2016-06-30
| | | | | | | | | | * Make use of 'create_' helper functions * Include every import on its own line * Use underscore_case, rather than camelCase * Don't use class level variables when not required Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Reviewed-by: Andy Doan <andy.doan@linaro.org>
* tests: Clean up 'test_list'Stephen Finucane2016-06-30
| | | | | | | | | | | * Make use of 'create_' helper functions * Include every import on its own line * Use underscore_case, rather than camelCase * Don't use list comprehension without generating a list: use a for loop instead Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Reviewed-by: Andy Doan <andy.doan@linaro.org>
* tests: Clean up 'test_filters'Stephen Finucane2016-06-30
| | | | | | | | | * Don't use hardcode routes: use the reverse function instead * Make use of 'create_' helper functions * Use underscore_case, rather than camelCase Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Reviewed-by: Andy Doan <andy.doan@linaro.org>
* tests: Clean up 'test_expiry'Stephen Finucane2016-06-30
| | | | | | | | | * Make use of 'create_' helper functions * Include every import on its own line * Use underscore_case, rather than camelCase Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Reviewed-by: Andy Doan <andy.doan@linaro.org>
* tests: Clean up 'test_encodings'Stephen Finucane2016-06-30
| | | | | | | | | | | | * Don't use hardcode routes: use the reverse function instead * Make use of 'create_' helper functions * Remove unneeded 'XXX.objects.delete()' calls (all objects are deleted on teardown of each test) * Include every import on its own line * Use underscore_case, rather than camelCase Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Reviewed-by: Andy Doan <andy.doan@linaro.org>
* tests: Clean up 'test_detail'Stephen Finucane2016-06-30
| | | | | | | * Use underscore_case, rather than camelCase Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Reviewed-by: Andy Doan <andy.doan@linaro.org>
* tests: Clean up 'test_confirm'Stephen Finucane2016-06-30
| | | | | | | | | | | * Make use of 'create_' helper functions * Remove unneeded 'XXX.objects.delete()' calls (all objects are deleted on teardown of each test) * Include every import on its own line * Use underscore_case, rather than camelCase Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Reviewed-by: Andy Doan <andy.doan@linaro.org>
* tests: Clean up 'test_checks'Stephen Finucane2016-06-30
| | | | | | | | | | * Make use of 'create_' helper * Remove unneeded 'XXX.objects.delete()' calls (all objects are deleted on teardown of each test) * Include every import on its own line Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Reviewed-by: Andy Doan <andy.doan@linaro.org>
* tests: Clean up 'test_bundles'Stephen Finucane2016-06-30
| | | | | | | | | | * Don't use hardcode routes: use the reverse function instead * Make use of 'create_' helper functions * Minimize duplication of code * Use underscore_case, rather than camelCase Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Reviewed-by: Andy Doan <andy.doan@linaro.org>
* tests: Add additional 'create_' helpersStephen Finucane2016-06-30
| | | | | | | | Add some additional object creation helpers, as a way to help eventually remove the 'default' class. Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Reviewed-by: Andy Doan <andy.doan@linaro.org>
* tests: Remove use of global valueStephen Finucane2016-06-30
| | | | | | | This isn't needed, so remove it. Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Reviewed-by: Andy Doan <andy.doan@linaro.org>
* tests: Remove 'find_in_context'Stephen Finucane2016-06-30
| | | | | | | | | The aformentioned function handled both dicts and lists in a request's context field. Seeing as only dicts are ever returned, this is not necessary. Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Reviewed-by: Andy Doan <andy.doan@linaro.org>
* templates: Display '[owner]/[context]' for checksStephen Finucane2016-06-28
| | | | | | | This is useful for highlighting ownership of a check. Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Reviewed-by: Andy Doan <andy.doan@linaro.org>
* models: Don't group checks with different ownersStephen Finucane2016-06-28
| | | | | | | | This prevents CIs from overriding the results of another CI by using the same context. Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Reviewed-by: Andy Doan <andy.doan@linaro.org>
* models: Return QuerySet from 'Patch.checks'Stephen Finucane2016-06-28
| | | | | | | | | Previously this returned a list. However, a QuerySet is more flexible and is required to provide a generic check endpoint at some point in the future. Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Reviewed-by: Andy Doan <andy.doan@linaro.org>
* models: Return string from 'combined_check_status'Stephen Finucane2016-06-28
| | | | | | | | | | | Previously the 'combined_check_status' function returned the checks enum integer for the status field. However, the string representation is more meaningful and is the only representation seen by users at moment. Change this function so it returns, for example, 'success' instead of '1'. Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Reviewed-by: Andy Doan <andy.doan@linaro.org>
* models: Use non-null slugs for 'Check.name'Stephen Finucane2016-06-28
| | | | | | | | | | The schema for 'Check' defines 'Check.name' as a 'CharField'. This is less than ideal as names with spaces and special characters can't be represented cleanly in URLs etc. We should use 'SlugField' instead. Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Reviewed-by: Andy Doan <andy.doan@linaro.org> Closes: #33
* tests: Don't save multiple projectsStephen Finucane2016-06-28
| | | | | | | | There were issues introduced in the rebase of 'ee15585' that resulted in two projects being saved with the same ID for one test, leading to a test failure. Resolve this. Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
* REST: Allow projects to be retrieved by linknameAndy Doan2016-06-27
| | | | | | | | | Building a user-friendly CLI becomes difficult when project-ids are required. It also makes it almost impossible to work with the current format of the .pwclientrc file. Signed-off-by: Andy Doan <andy.doan@linaro.org> Reviewed-by: Stephen Finucane <stephen.finucane@intel.com>
* REST API: expose patch.checksAndy Doan2016-06-27
| | | | | Signed-off-by: Andy Doan <andy.doan@linaro.org> Reviewed-by: Stephen Finucane <stephen.finucane@intel.com>
* REST: Add Patch.mbox_urlAndy Doan2016-06-27
| | | | | | | Provide a URL to the raw patch. Signed-off-by: Andy Doan <andy.doan@linaro.org> Reviewed-by: Stephen Finucane <stephen.finucane@intel.com>