Use archiveArtifact() for cls_native.Build()
This commit is contained in:
@@ -28,27 +28,24 @@ import cls_cmd
|
||||
import cls_oai_html
|
||||
import cls_analysis
|
||||
import constants as CONST
|
||||
from cls_ci_helper import archiveArtifact
|
||||
|
||||
LOG_PATH_PHYSIM = 'phy_sim_logs'
|
||||
DPDK_PATH = '/opt/dpdk-t2-22.11.0'
|
||||
|
||||
class Native():
|
||||
|
||||
def Build(test_case, HTML, host, directory, options):
|
||||
def Build(ctx, test_case, HTML, host, directory, options):
|
||||
logging.debug(f'Building on server: {host}')
|
||||
HTML.testCase_id = test_case
|
||||
|
||||
with cls_cmd.getConnection(host) as ssh:
|
||||
base = f"{directory}/cmake_targets"
|
||||
ret = ssh.run(f"C_INCLUDE_PATH={DPDK_PATH}/include/ PKG_CONFIG_PATH={DPDK_PATH}/lib64/pkgconfig/ {base}/build_oai {options} > {base}/log/build_oai.log", timeout=900)
|
||||
ret = ssh.run(f"C_INCLUDE_PATH={DPDK_PATH}/include/ PKG_CONFIG_PATH={DPDK_PATH}/lib64/pkgconfig/ {base}/build_oai {options} > {base}/build_oai.log", timeout=900)
|
||||
success = ret.returncode == 0
|
||||
logs = ssh.run(f"cat {base}/log/build_oai.log", silent=True)
|
||||
logs = ssh.run(f"cat {base}/build_oai.log", silent=True)
|
||||
logging.debug(f"build finished with code {ret.returncode}, output:\n{logs.stdout}")
|
||||
|
||||
# create log directory, and copy build logs
|
||||
target = f"{base}/build_log_{test_case}/"
|
||||
ssh.run(f"mkdir -p {target}")
|
||||
ssh.run(f"mv {base}/log/* {target}")
|
||||
archiveArtifact(ssh, ctx, f'{base}/build_oai.log')
|
||||
|
||||
# check if build artifacts are there
|
||||
# NOTE: build_oai should fail with exit code if it could not build, but it does not
|
||||
|
||||
+1
-1
@@ -136,7 +136,7 @@ def ExecuteActionWithParam(action, ctx):
|
||||
if proxy_commit is not None:
|
||||
CONTAINERS.proxyCommit = proxy_commit
|
||||
if action == 'Build_eNB':
|
||||
success = cls_native.Native.Build(HTML.testCase_id, HTML, RAN.eNBIPAddress, RAN.eNBSourceCodePath, RAN.Build_eNB_args)
|
||||
success = cls_native.Native.Build(ctx, HTML.testCase_id, HTML, RAN.eNBIPAddress, RAN.eNBSourceCodePath, RAN.Build_eNB_args)
|
||||
elif action == 'Build_Image':
|
||||
success = CONTAINERS.BuildImage(HTML)
|
||||
elif action == 'Build_Proxy':
|
||||
|
||||
Reference in New Issue
Block a user