Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1981)

Unified Diff: Tools/TestResultServer/handlers/testfilehandler_test.py

Issue 462883002: Fix uploading with non deprecated master names. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Tools/TestResultServer/handlers/testfilehandler.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Tools/TestResultServer/handlers/testfilehandler_test.py
diff --git a/Tools/TestResultServer/handlers/testfilehandler_test.py b/Tools/TestResultServer/handlers/testfilehandler_test.py
index 2cc2b591e59e9685ba616cb08b9590011a906c6c..15fb6e7c113fe5330441d68ce1eef54d3b31e68d 100755
--- a/Tools/TestResultServer/handlers/testfilehandler_test.py
+++ b/Tools/TestResultServer/handlers/testfilehandler_test.py
@@ -62,6 +62,52 @@ class TestFileHandlerTest(unittest.TestCase):
def tearDown(self):
self.tb.deactivate()
+ def test_basic_upload(self):
+ master = master_config.getMaster('chromium.chromiumos')
+ builder = 'test-builder'
+ test_type = 'test-type'
+ test_data = {
+ 'tests': {
+ 'Test1.testproc1': {
+ 'expected': 'PASS',
+ 'actual': 'PASS',
+ 'time': 1,
+ }
+ },
+ 'build_number': '123',
+ 'version': JSON_RESULTS_HIERARCHICAL_VERSION,
+ 'builder_name': builder,
+ 'blink_revision': '12345',
+ 'seconds_since_epoch': 1406123456,
+ 'num_failures_by_type': {
+ 'FAIL': 0,
+ 'SKIP': 0,
+ 'PASS': 1
+ },
+ 'chromium_revision': '67890',
+ }
+
+ params = collections.OrderedDict([
+ (testfilehandler.PARAM_BUILDER, builder),
+ (testfilehandler.PARAM_MASTER, master['url_name']),
+ (testfilehandler.PARAM_TEST_TYPE, test_type),
+ ])
+ upload_files = [('file', 'full_results.json', json.JSONEncoder().encode(test_data))]
+ response = self.testapp.post('/testfile/upload', params=params, upload_files=upload_files)
+ self.assertEqual(response.status_int, 200)
+
+ params = collections.OrderedDict([
+ (testfilehandler.PARAM_BUILDER, builder),
+ (testfilehandler.PARAM_MASTER, master['url_name']),
+ (testfilehandler.PARAM_TEST_TYPE, test_type),
+ (testfilehandler.PARAM_BUILD_NUMBER, '123'),
+ (testfilehandler.PARAM_NAME, 'full_results.json')
+ ])
+ response = self.testapp.get('/testfile', params=params)
+ self.assertEqual(response.status_int, 200)
+ response_json = json.loads(response.normal_body)
+ self.assertEqual(response_json['chromium_revision'], '67890')
+
def test_deprecated_master_name(self):
"""Verify that a file uploaded with a deprecated master name
can be downloaded by the corresponding new-style master name.
« no previous file with comments | « Tools/TestResultServer/handlers/testfilehandler.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698