|
16 | 16 | import argparse |
17 | 17 | import copy |
18 | 18 | import os |
19 | | -import random |
20 | 19 | from dataclasses import dataclass |
21 | | -from typing import Any, Dict, List, Optional |
22 | | -import glob |
| 20 | +from typing import Any, Optional |
| 21 | + |
23 | 22 | import yaml |
24 | 23 |
|
25 | 24 |
|
@@ -82,15 +81,15 @@ def to_dict(self): |
82 | 81 | @dataclass |
83 | 82 | class CircleCIJob: |
84 | 83 | name: str |
85 | | - additional_env: Dict[str, Any] = None |
86 | | - docker_image: List[Dict[str, str]] = None |
87 | | - install_steps: List[str] = None |
| 84 | + additional_env: dict[str, Any] = None |
| 85 | + docker_image: list[dict[str, str]] = None |
| 86 | + install_steps: list[str] = None |
88 | 87 | marker: Optional[str] = None |
89 | 88 | parallelism: Optional[int] = 0 |
90 | 89 | pytest_num_workers: int = 8 |
91 | | - pytest_options: Dict[str, Any] = None |
| 90 | + pytest_options: dict[str, Any] = None |
92 | 91 | resource_class: Optional[str] = "xlarge" |
93 | | - tests_to_run: Optional[List[str]] = None |
| 92 | + tests_to_run: Optional[list[str]] = None |
94 | 93 | num_test_files_per_worker: Optional[int] = 10 |
95 | 94 | # This should be only used for doctest job! |
96 | 95 | command_timeout: Optional[int] = None |
@@ -149,7 +148,7 @@ def to_dict(self): |
149 | 148 | # Examples special case: we need to download NLTK files in advance to avoid cuncurrency issues |
150 | 149 | timeout_cmd = f"timeout {self.command_timeout} " if self.command_timeout else "" |
151 | 150 | marker_cmd = f"-m '{self.marker}'" if self.marker is not None else "" |
152 | | - junit_flags = f" -p no:warning -o junit_family=xunit1 --junitxml=test-results/junit.xml" |
| 151 | + junit_flags = " -p no:warning -o junit_family=xunit1 --junitxml=test-results/junit.xml" |
153 | 152 | joined_flaky_patterns = "|".join(FLAKY_TEST_FAILURE_PATTERNS) |
154 | 153 | repeat_on_failure_flags = f"--reruns 5 --reruns-delay 2 --only-rerun '({joined_flaky_patterns})'" |
155 | 154 | parallel = f' << pipeline.parameters.{self.job_name}_parallelism >> ' |
@@ -200,9 +199,9 @@ def to_dict(self): |
200 | 199 | fi""" |
201 | 200 | }, |
202 | 201 | }, |
203 | | - {"run": {"name": "Expand to show skipped tests", "when": "always", "command": f"python3 .circleci/parse_test_outputs.py --file tests_output.txt --skip"}}, |
204 | | - {"run": {"name": "Failed tests: show reasons", "when": "always", "command": f"python3 .circleci/parse_test_outputs.py --file tests_output.txt --fail"}}, |
205 | | - {"run": {"name": "Errors", "when": "always", "command": f"python3 .circleci/parse_test_outputs.py --file tests_output.txt --errors"}}, |
| 202 | + {"run": {"name": "Expand to show skipped tests", "when": "always", "command": "python3 .circleci/parse_test_outputs.py --file tests_output.txt --skip"}}, |
| 203 | + {"run": {"name": "Failed tests: show reasons", "when": "always", "command": "python3 .circleci/parse_test_outputs.py --file tests_output.txt --fail"}}, |
| 204 | + {"run": {"name": "Errors", "when": "always", "command": "python3 .circleci/parse_test_outputs.py --file tests_output.txt --errors"}}, |
206 | 205 | {"store_test_results": {"path": "test-results"}}, |
207 | 206 | {"store_artifacts": {"path": "test-results/junit.xml"}}, |
208 | 207 | {"store_artifacts": {"path": "reports"}}, |
|
0 commit comments