Skip to content

Commit a70d12b

Browse files
committed
fixup! Edit Pipeline Trigger
1 parent dafdca6 commit a70d12b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

.pipelines/templates/run-unit-tests.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ stages:
116116
report_dir = os.environ['REPORT_DIR']
117117
report_dir = os.path.realpath(report_dir)
118118
119+
log_file = os.path.join(report_dir, 'test.stdout.log')
120+
119121
coverage_file = os.environ['COVERAGE_OUT']
120122
coverage_out = os.path.join(report_dir, coverage_file)
121123
@@ -137,12 +139,12 @@ stages:
137139
138140
# Function to run the test and capture output
139141
def run_test():
140-
cmd_gotest = "go test -timeout 30m -covermode atomic -coverprofile={coverage_out} ./npm/... ./cni/... ./platform/..."
141-
cmd_junitreport = f'{junit_report_bin} -set-exit-code -in {report_dir}/test.log -out {junit_xml} -iocopy'
142+
cmd_gotest = f"go test -timeout 30m -covermode atomic -coverprofile={coverage_out} ./npm/... ./cni/... ./platform/..."
143+
cmd_junitreport = f'{junit_report_bin} -set-exit-code -in {log_file} -out {junit_xml} -iocopy'
142144
cmd_gocover = f'go tool cover -func={coverage_out}'
143145
144146
print(cmd_gotest)
145-
gotest_process = subprocess.run(cmd_gotest, shell=True, stdout=open(f'{report_dir}/test.log', 'w'), text=True, cwd=cwd)
147+
gotest_process = subprocess.run(cmd_gotest, shell=True, stdout=open(log_file, 'w'), text=True, cwd=cwd)
146148
147149
print(cmd_junitreport)
148150
junit_process = subprocess.run(cmd_junitreport, shell=True, stdout=sys.stdout, stderr=sys.stderr, text=True, cwd=cwd)

0 commit comments

Comments
 (0)