Skip to content
Snippets Groups Projects
Commit 1e7737a8282a authored by Boris Feld's avatar Boris Feld
Browse files

Escape test name for BISECT ACTION

shlex.split was swallowing single quote in full test name which made asv find
to not recognize the test name

We need also to escape `(` and `)`, because asv find expect a Regex
parent d5c7e4a692d7
No related branches found
No related tags found
No related merge requests found
......@@ -13,7 +13,7 @@
can edit this file, please use an editor that detects when the tasks file
changed since you start editing it (at least nano does it).
"""
import re
import os
import argparse
import sys
......@@ -57,7 +57,15 @@
# XXX find a way to report an error without removing a task
def bisect(task):
splitted = shlex.split(task)
# We need to parse the task arguments not in POSIX mode because POSIX mode
# swallow single quote inside values
splitted = shlex.split(task, posix=False)
# Assume the test name is the last argument. We need to escape it as it's
# expected to be a regex but the full test name contains non-alphanumeric
# characters (at least `(` and `)`)
splitted[-1] = splitted[-1].replace('(', '\(').replace(')', '\)')
args = [BISECT_SCRIPT] + splitted
try:
......
......@@ -104,6 +104,6 @@
> EOF
$ python $TESTDIR/../scheduler.py TASKS
Bisecting test script tip..tip~2 basic_commands.TimeTestSuite.time_manifest_all(mercurial-2018-08-01)
Bisecting test script tip..tip~2 basic_commands.TimeTestSuite.time_manifest_all\('mercurial-2018-08-01'\)
================================================================================
Got task 'BISECT' "tip..tip~2 basic_commands.TimeTestSuite.time_manifest_all('mercurial-2018-08-01')"
......@@ -108,6 +108,6 @@
================================================================================
Got task 'BISECT' "tip..tip~2 basic_commands.TimeTestSuite.time_manifest_all('mercurial-2018-08-01')"
Bisecting ['*/scripts/scheduler-test-bisect-script-success', 'tip..tip~2', 'basic_commands.TimeTestSuite.time_manifest_all(mercurial-2018-08-01)'] (glob)
Bisecting ['*/scripts/scheduler-test-bisect-script-success', 'tip..tip~2', "basic_commands.TimeTestSuite.time_manifest_all\\\('mercurial-2018-08-01'\\\)"] (glob)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment