add pytest-order
This commit is contained in:
parent
33ababbaed
commit
4d2cd34b94
|
@ -52,6 +52,14 @@ jobs:
|
||||||
workflow_name: "tests.yml"
|
workflow_name: "tests.yml"
|
||||||
matrix_exclude: ""
|
matrix_exclude: ""
|
||||||
|
|
||||||
|
- name: "pytest-order"
|
||||||
|
repo: "pytest-dev/pytest-order"
|
||||||
|
docker_profile: "nodb"
|
||||||
|
jobs: "test"
|
||||||
|
workflow_name: "pythontests.yml"
|
||||||
|
matrix_exclude: |
|
||||||
|
3.6
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
|
|
|
@ -30,5 +30,21 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"python_version": "python"
|
"python_version": "python"
|
||||||
|
},
|
||||||
|
"pytest-order": {
|
||||||
|
"matrix": [
|
||||||
|
"matrix",
|
||||||
|
"python-version"
|
||||||
|
],
|
||||||
|
"tox_cmd_build": {
|
||||||
|
"base": "",
|
||||||
|
"prefix": "",
|
||||||
|
"sub":
|
||||||
|
{
|
||||||
|
"pattern": "(\\d|py\\d)\\.*(\\d+)",
|
||||||
|
"replace": "py\\1\\2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"python_version": "python-version"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -162,26 +162,43 @@ class DownstreamRunner:
|
||||||
parsed_matrix = yaml_tree
|
parsed_matrix = yaml_tree
|
||||||
for key in self.matrix_schema["matrix"]:
|
for key in self.matrix_schema["matrix"]:
|
||||||
parsed_matrix = parsed_matrix[key]
|
parsed_matrix = parsed_matrix[key]
|
||||||
#logger.debug("%s", parsed_matrix)
|
|
||||||
|
logger.debug("parsed_matrix: %s", parsed_matrix)
|
||||||
if parsed_matrix != yaml_tree:
|
if parsed_matrix != yaml_tree:
|
||||||
tox_base = self.matrix_schema["tox_cmd_build"]["base"]
|
tox_base = self.matrix_schema["tox_cmd_build"]["base"]
|
||||||
tox_prefix = self.matrix_schema["tox_cmd_build"]["prefix"]
|
tox_prefix = self.matrix_schema["tox_cmd_build"]["prefix"]
|
||||||
skip_matrices = []
|
skip_matrices = []
|
||||||
for item in parsed_matrix:
|
if isinstance(parsed_matrix, dict):
|
||||||
if (not item[tox_base].startswith(tox_prefix) or
|
for item in parsed_matrix:
|
||||||
item[tox_base] in self.matrix_exclude
|
if (not item[tox_base].startswith(tox_prefix) or
|
||||||
):
|
item[tox_base] in self.matrix_exclude
|
||||||
skip_matrices.append(item)
|
):
|
||||||
continue
|
skip_matrices.append(item)
|
||||||
item["tox_cmd"] = re.sub(
|
continue
|
||||||
self.matrix_schema["tox_cmd_build"]["sub"]["pattern"],
|
|
||||||
self.matrix_schema["tox_cmd_build"]["sub"]["replace"],
|
item["tox_cmd"] = re.sub(
|
||||||
item[tox_base]
|
self.matrix_schema["tox_cmd_build"]["sub"]["pattern"],
|
||||||
)
|
self.matrix_schema["tox_cmd_build"]["sub"]["replace"],
|
||||||
#logger.debug("re.sub: %s", item[tox_base])
|
item[tox_base]
|
||||||
for matrice in skip_matrices:
|
)
|
||||||
parsed_matrix.remove(matrice)
|
#logger.debug("re.sub: %s", item[tox_base])
|
||||||
|
|
||||||
|
for matrice in skip_matrices:
|
||||||
|
parsed_matrix.remove(matrice)
|
||||||
|
|
||||||
|
elif isinstance(parsed_matrix, list):
|
||||||
|
new_parsed_matrix = []
|
||||||
|
for item in parsed_matrix:
|
||||||
|
if str(item) in self.matrix_exclude:
|
||||||
|
continue
|
||||||
|
tox_cmd = re.sub(
|
||||||
|
self.matrix_schema["tox_cmd_build"]["sub"]["pattern"],
|
||||||
|
self.matrix_schema["tox_cmd_build"]["sub"]["replace"],
|
||||||
|
str(item)
|
||||||
|
)
|
||||||
|
new_parsed_matrix.append({"name": tox_cmd, "tox_cmd": tox_cmd})
|
||||||
|
parsed_matrix = new_parsed_matrix
|
||||||
|
|
||||||
return parsed_matrix
|
return parsed_matrix
|
||||||
|
|
||||||
if self._matrix is None:
|
if self._matrix is None:
|
||||||
|
|
Loading…
Reference in New Issue