Merge ~pappacena/launchpad:enabling-gunicorn-in-tests into launchpad:master

Proposed by Thiago F. Pappacena
Status: Merged
Approved by: Thiago F. Pappacena
Approved revision: d141aa797265b80e83991e369ea68df5e7d401e0
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~pappacena/launchpad:enabling-gunicorn-in-tests
Merge into: launchpad:master
Prerequisite: ~pappacena/launchpad:enabling-gunicorn-in-development
Diff against target: 81 lines (+31/-0)
6 files modified
configs/replicated-development/gunicorn.conf.py (+6/-0)
configs/replicated-development/launchpad-lazr.conf (+4/-0)
configs/test-playground/gunicorn.conf.py (+12/-0)
configs/test-playground/launchpad-lazr.conf (+4/-0)
configs/testrunner-appserver/launchpad-lazr.conf (+3/-0)
configs/testrunner/launchpad-lazr.conf (+2/-0)
Reviewer Review Type Date Requested Status
Colin Watson Approve
Review via email: mp+396770@code.launchpad.net

Commit message

Using gunicorn when running tests

To post a comment you must log in.
d141aa7... by Thiago F. Pappacena

Merge branch 'enabling-gunicorn-in-development' into enabling-gunicorn-in-tests

Revision history for this message
Colin Watson (cjwatson) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/configs/replicated-development/gunicorn.conf.py b/configs/replicated-development/gunicorn.conf.py
2new file mode 100644
3index 0000000..b667109
4--- /dev/null
5+++ b/configs/replicated-development/gunicorn.conf.py
6@@ -0,0 +1,6 @@
7+bind = [":8085", ":8086", ":8087", ":8088", ":8089"]
8+workers = 2
9+threads = 10
10+max_requests = 1000
11+log_level = "DEBUG"
12+reload = True
13diff --git a/configs/replicated-development/launchpad-lazr.conf b/configs/replicated-development/launchpad-lazr.conf
14index 364d5e6..750c283 100644
15--- a/configs/replicated-development/launchpad-lazr.conf
16+++ b/configs/replicated-development/launchpad-lazr.conf
17@@ -8,3 +8,7 @@ extends: ../development/launchpad-lazr.conf
18 [database]
19 rw_main_master: dbname=launchpad_dev_master port=5433
20 rw_main_slave: dbname=launchpad_dev_slave port=5433
21+
22+[launchpad]
23+devmode: true
24+use_gunicorn: true
25diff --git a/configs/test-playground/gunicorn.conf.py b/configs/test-playground/gunicorn.conf.py
26new file mode 100644
27index 0000000..ba22ec1
28--- /dev/null
29+++ b/configs/test-playground/gunicorn.conf.py
30@@ -0,0 +1,12 @@
31+import os
32+config_dir = os.path.dirname(__file__)
33+log_dir = os.path.join(config_dir, '..', '..', 'logs')
34+
35+bind = [":8085", ":8087"]
36+workers = 1
37+threads = 10
38+log_level = "DEBUG"
39+
40+log_file = os.path.join(log_dir, 'gunicorn.log')
41+error_logfile = os.path.join(log_dir, 'gunicorn-error.log')
42+access_logfile = os.path.join(log_dir, 'gunicorn-access.log')
43diff --git a/configs/test-playground/launchpad-lazr.conf b/configs/test-playground/launchpad-lazr.conf
44index 8790cb6..77818e4 100644
45--- a/configs/test-playground/launchpad-lazr.conf
46+++ b/configs/test-playground/launchpad-lazr.conf
47@@ -8,3 +8,7 @@ extends: ../development/launchpad-lazr.conf
48 [database]
49 rw_main_master: dbname=launchpad_ftest_playground
50 rw_main_slave: dbname=launchpad_ftest_playground
51+
52+[launchpad]
53+devmode: true
54+use_gunicorn: true
55diff --git a/configs/testrunner-appserver/launchpad-lazr.conf b/configs/testrunner-appserver/launchpad-lazr.conf
56index 80faefb..3653a4d 100644
57--- a/configs/testrunner-appserver/launchpad-lazr.conf
58+++ b/configs/testrunner-appserver/launchpad-lazr.conf
59@@ -12,6 +12,9 @@ launch: False
60 launch: False
61
62 [launchpad]
63+# Make this work a little more like production.
64+devmode: false
65+use_gunicorn: true
66 openid_provider_root: http://testopenid.test:8085/
67 internal_macaroon_secret_key: internal-dev-macaroon-secret
68
69diff --git a/configs/testrunner/launchpad-lazr.conf b/configs/testrunner/launchpad-lazr.conf
70index e5a0ad8..1e930d6 100644
71--- a/configs/testrunner/launchpad-lazr.conf
72+++ b/configs/testrunner/launchpad-lazr.conf
73@@ -101,6 +101,8 @@ public_https: True
74 max_scaling: 2
75
76 [launchpad]
77+devmode: true
78+use_gunicorn: true
79 basic_auth_password: test
80 max_attachment_size: 1024
81 geoip_database: lib/lp/services/geoip/tests/data/test.mmdb