|
9 | 9 |
|
10 | 10 | from buildbot.plugins import util |
11 | 11 |
|
12 | | -from . import (MAIN_BRANCH_VERSION, MAIN_BRANCH_NAME, |
13 | | - JUNIT_FILENAME) |
| 12 | +from . import JUNIT_FILENAME |
14 | 13 | from .steps import ( |
15 | 14 | Test, |
16 | 15 | Clean, |
@@ -56,6 +55,8 @@ def get_j_opts(worker, default=None): |
56 | 55 | class BaseBuild(factory.BuildFactory): |
57 | 56 | factory_tags = [] |
58 | 57 | test_timeout = TEST_TIMEOUT |
| 58 | + buildersuffix = "" |
| 59 | + tags = () |
59 | 60 |
|
60 | 61 | def __init__(self, source, *, extra_tags=[], **kwargs): |
61 | 62 | super().__init__([source]) |
@@ -97,7 +98,7 @@ def setup(self, branch, worker, test_with_PTY=False, **kwargs): |
97 | 98 |
|
98 | 99 | # In 3.10, test_asyncio wasn't split out, and refleaks tests |
99 | 100 | # need more time. |
100 | | - if branch == "3.10" and has_option("-R", self.testFlags): |
| 101 | + if branch.monolithic_test_asyncio and has_option("-R", self.testFlags): |
101 | 102 | self.test_timeout *= 2 |
102 | 103 |
|
103 | 104 | if self.build_out_of_tree: |
@@ -161,7 +162,7 @@ def setup(self, branch, worker, test_with_PTY=False, **kwargs): |
161 | 162 | env=self.test_environ, |
162 | 163 | **oot_kwargs |
163 | 164 | )) |
164 | | - if branch not in ("3",) and not has_option("-R", self.testFlags): |
| 165 | + if not branch.is_pr and not has_option("-R", self.testFlags): |
165 | 166 | filename = JUNIT_FILENAME |
166 | 167 | if self.build_out_of_tree: |
167 | 168 | filename = os.path.join(out_of_tree_dir, filename) |
@@ -214,11 +215,12 @@ class UnixInstalledBuild(BaseBuild): |
214 | 215 | factory_tags = ["installed"] |
215 | 216 |
|
216 | 217 | def setup(self, branch, worker, test_with_PTY=False, **kwargs): |
217 | | - if branch == MAIN_BRANCH_NAME: |
218 | | - branch = MAIN_BRANCH_VERSION |
219 | | - elif branch == "custom": |
220 | | - branch = "3" |
221 | | - installed_python = f"./target/bin/python{branch}" |
| 218 | + if branch.version_tuple: |
| 219 | + major, minor = branch.version_tuple |
| 220 | + executable_name = f'python{major}.{minor}' |
| 221 | + else: |
| 222 | + executable_name = f'python3' |
| 223 | + installed_python = f"./target/bin/{executable_name}" |
222 | 224 | self.addStep( |
223 | 225 | Configure( |
224 | 226 | command=["./configure", "--prefix", "$(PWD)/target"] |
@@ -633,7 +635,7 @@ def setup(self, branch, worker, **kwargs): |
633 | 635 | command=test_command, |
634 | 636 | timeout=step_timeout(self.test_timeout), |
635 | 637 | )) |
636 | | - if branch not in ("3",) and not has_option("-R", self.testFlags): |
| 638 | + if not branch.is_pr and not has_option("-R", self.testFlags): |
637 | 639 | self.addStep(UploadTestResults(branch)) |
638 | 640 | self.addStep(Clean(command=clean_command)) |
639 | 641 |
|
@@ -856,7 +858,7 @@ def setup(self, branch, worker, test_with_PTY=False, **kwargs): |
856 | 858 | env=self.test_environ, |
857 | 859 | workdir=oot_host_path, |
858 | 860 | )) |
859 | | - if branch not in ("3",) and not has_option("-R", self.testFlags): |
| 861 | + if not branch.is_pr and not has_option("-R", self.testFlags): |
860 | 862 | filename = os.path.join(oot_host_path, JUNIT_FILENAME) |
861 | 863 | self.addStep(UploadTestResults(branch, filename=filename)) |
862 | 864 | self.addStep( |
@@ -990,7 +992,7 @@ def setup(self, branch, worker, test_with_PTY=False, **kwargs): |
990 | 992 | workdir=host_path, |
991 | 993 | ) |
992 | 994 | ) |
993 | | - if branch not in ("3",) and not has_option("-R", self.testFlags): |
| 995 | + if not branch.is_pr and not has_option("-R", self.testFlags): |
994 | 996 | filename = os.path.join(host_path, JUNIT_FILENAME) |
995 | 997 | self.addStep(UploadTestResults(branch, filename=filename)) |
996 | 998 |
|
@@ -1240,7 +1242,7 @@ def setup(self, branch, *args, **kwargs): |
1240 | 1242 | # |
1241 | 1243 | # The symlink approach will fail for Python 3.13 *PR* builds, because |
1242 | 1244 | # there's no way to identify the base branch for a PR. |
1243 | | - if branch == "3.13": |
| 1245 | + if branch.name == "3.13": |
1244 | 1246 | self.py313_setup(branch, *args, **kwargs) |
1245 | 1247 | else: |
1246 | 1248 | self.current_setup(branch, *args, **kwargs) |
|
0 commit comments