Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let armv8 tests run on new ubuntu-24.04-arm Github runners #319

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions builder/core/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,15 @@ class PKG_TOOLS(Enum):
'python': "python3",
},
},
'al2023': {
'os': 'linux',
'pkg_tool': PKG_TOOLS.DNF,
'pkg_update': 'dnf update -y',
'pkg_install': 'dnf install -y',
'variables': {
'python': "python3",
},
},
'manylinux': {
'os': 'linux',
'pkg_tool': PKG_TOOLS.YUM,
Expand Down Expand Up @@ -321,9 +330,6 @@ class PKG_TOOLS(Enum):
'armv7': {
'run_tests': False
},
'armv8': {
'run_tests': False
},
'mips': {
'run_tests': False
},
Expand Down
3 changes: 2 additions & 1 deletion builder/core/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,8 @@ def build_consumers(self, env):
for c in consumers:
build_consumers += _build_project(c, env)
# build consumer tests
build_consumers += to_list(c.test(env))
if c.needs_tests(env):
build_consumers += to_list(c.test(env))
if len(build_consumers) == 0:
return None
return Script(build_consumers, name='build consumers of {}'.format(self.name))
Expand Down
3 changes: 2 additions & 1 deletion builder/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ def post_build(env):
return env.project.post_build(env)

def test(env):
return env.project.test(env)
if env.project.needs_tests(env):
return env.project.test(env)

def install(env):
return env.project.install(env)
Expand Down
7 changes: 5 additions & 2 deletions tests/test_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
'name': 'test-proj',
'search_dirs': [test_data_dir],
'path': here,
'run_tests': True,
}


Expand Down Expand Up @@ -148,7 +149,8 @@ def test_downstream_tests_build_by_default(self):
]

p = Project(**config)
mock_env = mock.Mock(name='MockEnv', config=config)
m_toolchain = mock.Mock(name='mock toolchain', cross_compile=False)
mock_env = mock.Mock(name='MockEnv', config=config, project=p, toolchain=m_toolchain)
mock_env.spec = BuildSpec()
steps = p.build_consumers(mock_env)
self._assert_step_contains_all(steps, ['test lib-1'])
Expand All @@ -163,7 +165,8 @@ def test_downstream_post_build_runs_before_tests(self):
]

p = Project(**config)
mock_env = mock.Mock(name='MockEnv', config=config)
m_toolchain = mock.Mock(name='mock toolchain', cross_compile=False)
mock_env = mock.Mock(name='MockEnv', config=config, project=p, toolchain=m_toolchain)
mock_env.spec = BuildSpec()
steps = p.build_consumers(mock_env)
self._assert_step_contains_all(steps, ['post build lib-1', 'test lib-1'])
Expand Down
Loading