Merge "Stop gzipping zuul status json in zuul"

This commit is contained in:
Jenkins 2014-06-04 02:22:01 +00:00 committed by Gerrit Code Review
commit 593a07e507
2 changed files with 1 additions and 14 deletions

View File

@ -14,8 +14,6 @@
# License for the specific language governing permissions and limitations
# under the License.
from cStringIO import StringIO
import gzip
import json
import logging
import os
@ -1927,7 +1925,7 @@ class TestScheduler(ZuulTestCase):
self.assertEqual(self.history[4].pipeline, 'check')
self.assertEqual(self.history[5].pipeline, 'check')
def test_json_status(self, compressed=False):
def test_json_status(self):
"Test that we can retrieve JSON status info"
self.worker.hold_jobs_in_build = True
A = self.fake_gerrit.addFakeChange('org/project', 'master', 'A')
@ -1938,13 +1936,8 @@ class TestScheduler(ZuulTestCase):
port = self.webapp.server.socket.getsockname()[1]
req = urllib2.Request("http://localhost:%s/status.json" % port)
if compressed:
req.add_header("accept-encoding", "gzip")
f = urllib2.urlopen(req)
data = f.read()
if compressed:
gz = gzip.GzipFile(fileobj=StringIO(data))
data = gz.read()
self.worker.hold_jobs_in_build = False
self.worker.release()
@ -1968,9 +1961,6 @@ class TestScheduler(ZuulTestCase):
self.assertIn('project-test1', status_jobs)
self.assertIn('project-test2', status_jobs)
def test_json_status_gzip(self):
self.test_json_status(True)
def test_merging_queues(self):
"Test that transitively-connected change queues are merged"
self.config.set('zuul', 'layout_config',

View File

@ -47,7 +47,4 @@ class WebApp(threading.Thread):
raise
response = webob.Response(body=ret, content_type='application/json')
response.headers['Access-Control-Allow-Origin'] = '*'
response.headers['Vary'] = 'Accept-Encoding'
if 'gzip' in request.headers.get('accept-encoding', ()):
response.encode_content('gzip')
return response