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

DAOS-16629 build: Allow separate test builds #15188

Merged
merged 1 commit into from
Sep 26, 2024
Merged
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
10 changes: 8 additions & 2 deletions site_scons/prereq_tools/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,19 +504,25 @@ def __init__(self, env, opts):
self._build_targets = []

build_dir = self.__env['BUILD_DIR']
targets = ['test', 'server', 'client']
main_targets = ['client', 'server']
targets = ['test'] + main_targets
self.__env.Alias('client', build_dir)
self.__env.Alias('server', build_dir)
self.__env.Alias('test', build_dir)
self._build_targets = []
check = any(item in BUILD_TARGETS for item in targets)
if not check or 'test' in BUILD_TARGETS:
if not check:
self._build_targets.extend(['client', 'server', 'test'])
else:
if 'client' in BUILD_TARGETS:
self._build_targets.append('client')
if 'server' in BUILD_TARGETS:
self._build_targets.append('server')
if 'test' in BUILD_TARGETS:
if not any(item in BUILD_TARGETS for item in main_targets):
print("test target requires client or server")
sys.exit(1)
self._build_targets.append('test')
BUILD_TARGETS.append(build_dir)

env.AddMethod(self.require, 'require')
Expand Down
7 changes: 4 additions & 3 deletions src/tests/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def build_dts_library(env, dc_credit):
denv.d_static_library('dts', [dc_credit, 'dts.c'])


def build_tests(env):
def build_tests(env, prereqs):
"""build the tests"""
Import('libdaos_tgts', 'cmd_parser')
Comment on lines +14 to 16
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor but you could just Import prereqs here.

Suggested change
def build_tests(env, prereqs):
"""build the tests"""
Import('libdaos_tgts', 'cmd_parser')
def build_tests(env):
"""build the tests"""
Import('libdaos_tgts', 'cmd_parser', 'prereqs`)

denv = env.Clone()
Expand Down Expand Up @@ -65,7 +65,8 @@ def build_tests(env):
SConscript('drpc/SConscript')

# Build security_test
SConscript('security/SConscript')
if prereqs.server_requested():
SConscript('security/SConscript')

# ftest
SConscript('ftest/SConscript')
Expand Down Expand Up @@ -100,7 +101,7 @@ def scons():
# Add runtime paths for daos libraries
denv.AppendUnique(RPATH_FULL=['$PREFIX/lib64/daos_srv'])
denv.AppendUnique(CPPPATH=[Dir('../mgmt').srcnode()])
build_tests(denv)
build_tests(denv, prereqs)

if not base_env_mpi:
return
Expand Down
Loading