Skip to content

Commit ba1148f

Browse files
authored
fix the rsync of files to libraries.openmodelica.org (#76)
* do not print debug output, it fills the Jenkins logs with 'try clean' * more care is needed with result_location!
1 parent 6ec233f commit ba1148f

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

test.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,14 @@
4646
args = parser.parse_args()
4747
configs = args.configs
4848
branch = args.branch
49-
result_location = os.path.abspath(args.output) if args.output else ''
49+
noSync = args.noSync
50+
isWin = os.name == 'nt'
51+
# result location can be on a remote server, do NOT use os.path.abspath on it if the system is not Windows or if --noSync=True
52+
result_location = ''
53+
if not isWin and not noSync:
54+
result_location = args.output if args.output else ''
55+
else:
56+
result_location = os.path.abspath(args.output) if args.output else ''
5057
n_jobs = int(args.jobs)
5158
clean = not args.noclean
5259
verbose = args.verbose
@@ -57,7 +64,7 @@
5764
allTestsFmi = args.fmi
5865
ulimitMemory = args.ulimitvmem
5966
docker = args.docker
60-
isWin = os.name == 'nt'
67+
6168
if args.libraries:
6269
librariespath = os.path.abspath(os.path.normpath(args.libraries))
6370
else:
@@ -67,7 +74,6 @@
6774
librariespath = os.path.normpath(os.path.join(os.environ.get('HOME'), '.openmodelica', 'libraries'))
6875
overrideDefaults = [arg.split("=", 1) for arg in args.default]
6976
execAllTests = args.execAllTests
70-
noSync = args.noSync
7177
msysEnvironment = args.msysEnvironment
7278

7379
exeExt = ".exe" if isWin else ""
@@ -125,7 +131,7 @@ def target():
125131
thread.join()
126132

127133
if clean:
128-
print("---> try clean")
134+
# print("---> try clean")
129135
try:
130136
lines = open("%s.tmpfiles" % prefix).readlines()
131137
except:
@@ -863,8 +869,8 @@ def cpu_name():
863869
sysInfo = "%s, %d GB RAM, %s%s" % (cpu_name(), int(math.ceil(psutil.virtual_memory().total / (1024.0**3))), ("Docker " + docker + " ") if docker else "", lsb_release)
864870

865871
# create target dir to move results without sync operations (win or when --noSync is used)
866-
resRootPath = os.path.join(result_location, branch)
867872
if result_location != "" and (isWin or noSync):
873+
resRootPath = os.path.join(result_location, branch)
868874
if os.path.exists(resRootPath):
869875
rmtree(resRootPath)
870876
os.mkdir(resRootPath)
@@ -987,6 +993,8 @@ def cpu_name():
987993
subprocess.check_output(["rsync", "-aR", "--delete-excluded", "--include-from=%s.files" % libname, "--exclude=*", "./", result_location_libname])
988994
if (conf.get("referenceFiles") or "") != "":
989995
subprocess.check_output(["rsync", "-a", dygraphs, result_location_libname+"/files"])
996+
else:
997+
print("No Sync: result_location [%s] != "" and not isWin [%s] and not noSync [%s] : library: %s" % (result_location, isWin, noSync, libname))
990998

991999
# move results without sync operations (win or when --noSync is used)
9921000
if result_location != "" and (isWin or noSync):

0 commit comments

Comments
 (0)