Index: tests/server/ui/Inputs/V4Pages_extra_records.sql =================================================================== --- tests/server/ui/Inputs/V4Pages_extra_records.sql +++ tests/server/ui/Inputs/V4Pages_extra_records.sql @@ -35,6 +35,7 @@ -- check that a regression on consecutive runs more than 1 day apart can be detected: INSERT INTO "NT_Test" VALUES(4,'test1'); -- ID 4 INSERT INTO "NT_Test" VALUES(5,'test2'); -- ID 5 +INSERT INTO "NT_Test" VALUES(6,'test3'); -- ID 6 INSERT INTO "NT_Order" ("NextOrder", "PreviousOrder", "llvm_project_revision") VALUES(NULL,NULL,'152292'); -- ID 5 INSERT INTO "NT_Run" ("MachineID", "OrderID", "ImportedFrom", "StartTime", @@ -50,6 +51,10 @@ "execution_status", "compile_time", "execution_time", "score", "mem_bytes") VALUES(5,5,0,1,0.001,1.0,NULL,NULL); -- ID 6: failing result +INSERT INTO "NT_Sample" ("RunID", "TestID", "compile_status", + "execution_status", "compile_time", "execution_time", + "score", "mem_bytes") + VALUES(5,6,0,0,0.001,1.0,NULL,NULL); -- ID 7: passing result INSERT INTO "NT_Order" ("NextOrder", "PreviousOrder", "llvm_project_revision") VALUES(5,NULL,'152293'); -- ID 6 UPDATE "NT_Order" SET "PreviousOrder" = 6 WHERE "ID" = 5; @@ -60,14 +65,18 @@ INSERT INTO "NT_Sample" ("RunID", "TestID", "compile_status", "execution_status", "compile_time", "execution_time", "score", "mem_bytes") - VALUES(6,4,0,0,0.001,10.0,NULL,NULL); -- ID 7: passing result 10x slower + VALUES(6,4,0,0,0.001,10.0,NULL,NULL); -- ID 8: passing result 10x slower +INSERT INTO "NT_Sample" ("RunID", "TestID", "compile_status", + "execution_status", "compile_time", "execution_time", + "score", "mem_bytes") + VALUES(5,5,0,0,0.001,1.0,NULL,NULL); -- ID 9: passing result INSERT INTO "NT_Sample" ("RunID", "TestID", "compile_status", "execution_status", "compile_time", "execution_time", "score", "mem_bytes") - VALUES(5,5,0,0,0.001,1.0,NULL,NULL); -- ID 8: passing result + VALUES(6,6,0,0,0.001,1.0,NULL,NULL); -- ID 10: passing result, same run time -- check that a failing test result does not show up in the sparkline -INSERT INTO "NT_Test" VALUES(6,'test6'); -- ID 6 +INSERT INTO "NT_Test" VALUES(7,'test6'); -- ID 7 INSERT INTO "NT_Order" ("NextOrder", "PreviousOrder", "llvm_project_revision") VALUES(NULL,NULL,'152294'); -- ID 6 INSERT INTO "NT_Order" ("NextOrder", "PreviousOrder", "llvm_project_revision") @@ -92,66 +101,66 @@ INSERT INTO "NT_Sample" ("RunID", "TestID", "compile_status", "execution_status", "compile_time", "execution_time", "score", "mem_bytes") - VALUES(7,6,0,0,0.001,1.0,NULL,NULL); -- ID 9: passing result + VALUES(7,7,0,0,0.001,1.0,NULL,NULL); -- ID 11: passing result INSERT INTO "NT_Sample" ("RunID", "TestID", "compile_status", "execution_status", "compile_time", "execution_time", "score", "mem_bytes") - VALUES(8,6,0,1,0.001,1.0,NULL,NULL); -- ID 10: failing result + VALUES(8,7,0,1,0.001,1.0,NULL,NULL); -- ID 12: failing result INSERT INTO "NT_Sample" ("RunID", "TestID", "compile_status", "execution_status", "compile_time", "execution_time", "score", "mem_bytes") - VALUES(9,6,0,0,0.001,1.2,NULL,NULL); -- ID 11: passing result; 20% bigger, + VALUES(9,7,0,0,0.001,1.2,NULL,NULL); -- ID 13: passing result; 20% bigger, -- so shown in daily report page. -- check background colors being produced correctly, corresponding to recorded -- hashes of the binary. -INSERT INTO "NT_Test" VALUES(7,'test_hash1'); -- ID 7 +INSERT INTO "NT_Test" VALUES(8,'test_hash1'); -- ID 8 INSERT INTO "NT_Sample" ("RunID", "TestID", "compile_status", "execution_status", "compile_time", "execution_time", "score", "mem_bytes", "hash_status", "hash") - VALUES(7,7,0,0,0.001,1.0,NULL,NULL,0,'hash1'); -- ID 11: hash1 + VALUES(7,8,0,0,0.001,1.0,NULL,NULL,0,'hash1'); -- ID 14: hash1 INSERT INTO "NT_Sample" ("RunID", "TestID", "compile_status", "execution_status", "compile_time", "execution_time", "score", "mem_bytes", "hash_status", "hash") - VALUES(8,7,0,0,0.001,1.0,NULL,NULL,NULL,NULL); -- ID 12: no hash + VALUES(8,8,0,0,0.001,1.0,NULL,NULL,NULL,NULL); -- ID 15: no hash INSERT INTO "NT_Sample" ("RunID", "TestID", "compile_status", "execution_status", "compile_time", "execution_time", "score", "mem_bytes", "hash_status", "hash") - VALUES(9,7,0,0,0.001,1.2,NULL,NULL,0,'hash2'); -- ID 13: hash2; 20% bigger, + VALUES(9,8,0,0,0.001,1.2,NULL,NULL,0,'hash2'); -- ID 16: hash2; 20% bigger, -- so shown in daily report page. -INSERT INTO "NT_Test" VALUES(8,'test_hash2'); -- ID 8 +INSERT INTO "NT_Test" VALUES(9,'test_hash2'); -- ID 9 INSERT INTO "NT_Sample" ("RunID", "TestID", "compile_status", "execution_status", "compile_time", "execution_time", "score", "mem_bytes", "hash_status", "hash") - VALUES(7,8,0,0,0.001,1.0,NULL,NULL,0,'hash1'); -- ID 14: hash1 + VALUES(7,9,0,0,0.001,1.0,NULL,NULL,0,'hash1'); -- ID 17: hash1 INSERT INTO "NT_Sample" ("RunID", "TestID", "compile_status", "execution_status", "compile_time", "execution_time", "score", "mem_bytes", "hash_status", "hash") - VALUES(8,8,0,0,0.001,1.0,NULL,NULL,0,'hash2'); -- ID 15: hash2 + VALUES(8,9,0,0,0.001,1.0,NULL,NULL,0,'hash2'); -- ID 18: hash2 INSERT INTO "NT_Sample" ("RunID", "TestID", "compile_status", "execution_status", "compile_time", "execution_time", "score", "mem_bytes", "hash_status", "hash") - VALUES(9,8,0,0,0.001,1.2,NULL,NULL,0,'hash1'); -- ID 16: hash1; 20% bigger, + VALUES(9,9,0,0,0.001,1.2,NULL,NULL,0,'hash1'); -- ID 19: hash1; 20% bigger, -- so shown in daily report page. -INSERT INTO "NT_Test" VALUES(9,'test_mhash_on_run'); -- ID 9 +INSERT INTO "NT_Test" VALUES(10,'test_mhash_on_run'); -- ID 10 INSERT INTO "NT_Sample" ("RunID", "TestID", "compile_status", "execution_status", "compile_time", "execution_time", "score", "mem_bytes", "hash_status", "hash") - VALUES(7,9,0,0,0.001,1.0,NULL,NULL,0,'hash1'); -- ID 15: hash1 + VALUES(7,10,0,0,0.001,1.0,NULL,NULL,0,'hash1'); -- ID 20: hash1 INSERT INTO "NT_Sample" ("RunID", "TestID", "compile_status", "execution_status", "compile_time", "execution_time", "score", "mem_bytes", "hash_status", "hash") - VALUES(7,9,0,0,0.001,1.0,NULL,NULL,0,'hash2'); -- ID 16: hash2, same day + VALUES(7,10,0,0,0.001,1.0,NULL,NULL,0,'hash2'); -- ID 21: hash2, same day INSERT INTO "NT_Sample" ("RunID", "TestID", "compile_status", "execution_status", "compile_time", "execution_time", "score", "mem_bytes", "hash_status", "hash") - VALUES(8,9,0,0,0.001,1.0,NULL,NULL,1,NULL); -- ID 17: no hash the next day + VALUES(8,10,0,0,0.001,1.0,NULL,NULL,1,NULL); -- ID 22: no hash the next day INSERT INTO "NT_Sample" ("RunID", "TestID", "compile_status", "execution_status", "compile_time", "execution_time", "score", "mem_bytes", "hash_status", "hash") - VALUES(9,9,0,0,0.001,1.2,NULL,NULL,0,'hash3'); -- ID 18: hash3; 20% bigger, + VALUES(9,10,0,0,0.001,1.2,NULL,NULL,0,'hash3'); -- ID 23: hash3; 20% bigger, -- so shown in daily report page. Index: tests/server/ui/V4Pages.py =================================================================== --- tests/server/ui/V4Pages.py +++ tests/server/ui/V4Pages.py @@ -457,15 +457,18 @@ ["", "machine2", "1.000", "-", "900.00%", ""], ["test2", ""], ["", "machine2", "FAIL", "-", "PASS", ""]]) + # No test3 entry since results are stable. check_table_links(result_table_20120504, [[], ["/db_default/v4/nts/graph?plot.0=2.4.2&highlight_run=6"], [], ["/db_default/v4/nts/graph?plot.0=2.5.2&highlight_run=6"]]) + # No entry corresponding to test3 since results are + # stable. check_body_nr_tests_table( client, '/v4/nts/daily_report/2012/5/04', - [['machine2', '2', '0', '1']]) + [['machine2', '3', '0', '2']]) # Check that a failing result does not show up in the spark line # as a dot with value 0. @@ -482,13 +485,13 @@ ["", "machine2", "1.000", '-', '20.00%', ""], ]) check_table_links(result_table_20120513, [[], - ['/db_default/v4/nts/graph?plot.0=2.6.2&highlight_run=9'], - [], ['/db_default/v4/nts/graph?plot.0=2.7.2&highlight_run=9'], [], ['/db_default/v4/nts/graph?plot.0=2.8.2&highlight_run=9'], [], - ['/db_default/v4/nts/graph?plot.0=2.9.2&highlight_run=9']]) + ['/db_default/v4/nts/graph?plot.0=2.9.2&highlight_run=9'], + [], + ['/db_default/v4/nts/graph?plot.0=2.10.2&highlight_run=9']]) sparkline_test6_xml = \ get_sparkline(result_table_20120513, "test6", "machine2") @@ -617,19 +620,19 @@ # Profile Viewer Ajax functions # Check profiles page is responsive with expected IDs - check_code(client, 'v4/nts/profile/10/10') + check_code(client, 'v4/nts/profile/11/10') # Check ajax call - functions = check_json(client, 'v4/nts/profile/ajax/getFunctions?runid=10&testid=10') + functions = check_json(client, 'v4/nts/profile/ajax/getFunctions?runid=10&testid=11') number_of_functions = len(functions) first_function_name = functions[0][0] assert 1 == number_of_functions assert "fn1" == first_function_name - top_level_counters = check_json(client, 'v4/nts/profile/ajax/getTopLevelCounters?runids=10&testid=10') + top_level_counters = check_json(client, 'v4/nts/profile/ajax/getTopLevelCounters?runids=10&testid=11') assert "cycles" in top_level_counters assert "branch-misses" in top_level_counters - code_for_fn = check_json(client, 'v4/nts/profile/ajax/getCodeForFunction?runid=10&testid=10&f=fn1') + code_for_fn = check_json(client, 'v4/nts/profile/ajax/getCodeForFunction?runid=10&testid=11&f=fn1') lines_in_function = len(code_for_fn) assert 2 == lines_in_function @@ -658,16 +661,16 @@ assert resp.get_data(as_text=True) == "pong" # Check we can convert a sample into a graph page. - graph_to_sample = check_code(client, '/db_default/v4/nts/graph_for_sample/10/compile_time?foo=bar', + graph_to_sample = check_code(client, '/db_default/v4/nts/graph_for_sample/12/compile_time?foo=bar', expected_code=HTTP_REDIRECT) assert graph_to_sample.headers['Location'] in ( - "http://localhost/db_default/v4/nts/graph?foo=bar&plot.0=2.6.0", - "http://localhost/db_default/v4/nts/graph?plot.0=2.6.0&foo=bar") + "http://localhost/db_default/v4/nts/graph?foo=bar&plot.0=2.7.0", + "http://localhost/db_default/v4/nts/graph?plot.0=2.7.0&foo=bar") # Check that is we ask for a sample or invalid field, we explode with 400s. check_code(client, '/db_default/v4/nts/graph_for_sample/10000/compile_time?foo=bar', expected_code=HTTP_NOT_FOUND) - check_code(client, '/db_default/v4/nts/graph_for_sample/10/not_a_metric?foo=bar', + check_code(client, '/db_default/v4/nts/graph_for_sample/12/not_a_metric?foo=bar', expected_code=HTTP_BAD_REQUEST) # check get_geomean_comparison_result with empty unchanged_tests Index: tests/server/ui/test_api.py =================================================================== --- tests/server/ui/test_api.py +++ tests/server/ui/test_api.py @@ -265,7 +265,7 @@ tests = j['tests'] # check number of tests - self.assertEqual(9, len(tests)) + self.assertEqual(10, len(tests)) # check first test t0 = tests[0] Index: tests/server/ui/test_matrix_page.py =================================================================== --- tests/server/ui/test_matrix_page.py +++ tests/server/ui/test_matrix_page.py @@ -61,7 +61,7 @@ """Does the page load with the data as expected. """ client = self.client - reply = check_html(client, '/v4/nts/matrix?plot.0=2.6.2') + reply = check_html(client, '/v4/nts/matrix?plot.0=2.7.2') # Set a baseline and run again. form_data = dict(name="foo_baseline", description="foo_description", @@ -71,14 +71,14 @@ check_code(client, '/v4/nts/set_baseline/1', expected_code=HTTP_REDIRECT) - reply = check_html(client, '/v4/nts/matrix?plot.0=2.6.2') + reply = check_html(client, '/v4/nts/matrix?plot.0=2.7.2') # Make sure the data is in the page. data = reply.get_data(as_text=True) self.assertIn("test6", data) self.assertIn("1.0000", data) self.assertIn("1.2000", data) - reply = check_html(client, '/v4/nts/matrix?plot.0=2.6.2&limit=1') + reply = check_html(client, '/v4/nts/matrix?plot.0=2.7.2&limit=1') if __name__ == '__main__':