Skip to content

Commit 8dbf239

Browse files
committed
Update the CI test to same the changes to file and wait
1 parent 71f4e0a commit 8dbf239

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

ci_test.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,14 @@
1717
import sys
1818
import os
1919

20-
def run_command(cmd):
20+
def run_command(cmd, log_file=None):
2121
print("Running: {}".format(cmd))
22-
p = subprocess.Popen(cmd, shell=True)
22+
if log_file:
23+
file = open(log_file, "w")
24+
p = subprocess.Popen(cmd, shell=True, stdout=file, stderr=file)
25+
else:
26+
p = subprocess.Popen(cmd, shell=True)
27+
2328
(output, err) = p.communicate()
2429
return p.wait()
2530

@@ -53,8 +58,8 @@ def main():
5358
print("Testing {}".format(dockerfile))
5459
log_file = dockerfile.replace(docker_dir,"").replace("/", "_")
5560
log_file = "{}.log".format(log_file)
56-
cmd = "docker build --no-cache=true {} &> {}".format(dockerfile, log_file)
57-
status = run_command(cmd)
61+
cmd = "docker build --no-cache=true {}".format(dockerfile)
62+
status = run_command(cmd, log_file)
5863
results[dockerfile] = status
5964
if status != 0:
6065
suite_status = False

0 commit comments

Comments
 (0)