[PATCH] D68989: [LNT] Python 3 support: don't assume URL params order

Thomas Preud'homme via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 15 07:30:14 PDT 2019


thopre created this revision.
thopre added reviewers: cmatthews, hubert.reinterpretcast, kristof.beyls.
thopre added a parent revision: D68988: [LNT] Python 3 support: adapt regex for div by 0 msg.

Test server/ui/V4Pages.py tests on 2 occasions an address redirection
with parameters in it. However order of those parameters changes between
Python 2 and Python 3. This commit adapts the tests to accept all
possible orders.


https://reviews.llvm.org/D68989

Files:
  tests/server/ui/V4Pages.py


Index: tests/server/ui/V4Pages.py
===================================================================
--- tests/server/ui/V4Pages.py
+++ tests/server/ui/V4Pages.py
@@ -373,7 +373,9 @@
 
     # Get a graph page. This has been changed to redirect.
     check_redirect(client, '/v4/nts/1/graph?test.3=2',
-                   'v4/nts/graph\?plot\.0=1\.3\.2&highlight_run=1$')
+                   'v4/nts/graph\?'
+                   '(plot\.0=1\.3\.2&highlight_run=1'
+                   '|highlight_run=1&plot\.0=1\.3\.2)$')
 
     # Get a run that contains generic producer information
     check_producer_label(client, '/v4/nts/7',
@@ -658,7 +660,9 @@
     # 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',
                                  expected_code=HTTP_REDIRECT)
-    assert graph_to_sample.headers['Location'] == "http://localhost/db_default/v4/nts/graph?foo=bar&plot.0=2.6.0"
+    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")
 
     # 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',


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68989.225033.patch
Type: text/x-patch
Size: 1372 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191015/ae3fa499/attachment.bin>


More information about the llvm-commits mailing list