Skip to content

Commit b238d6b

Browse files
committed
fix workflows
1 parent 62704d2 commit b238d6b

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

tests/benchmarks/scripts/measure_heap.py

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,8 @@ def cleanup_simulator():
166166
time.sleep(1)
167167

168168
print(' - clean state')
169-
os.system('rm -rf ' + os.path.join('MicroOcppSimulator', 'mo_store', '*'))
169+
os.system('rm -rf ' + os.path.join('mo_store'))
170+
os.system('mkdir ' + os.path.join('mo_store'))
170171

171172
print(' - done')
172173

@@ -179,13 +180,13 @@ def setup_simulator():
179180

180181
print(' - set credentials')
181182

182-
with open(os.path.join('MicroOcppSimulator', 'mo_store', 'simulator.jsn'), 'w') as f:
183+
with open(os.path.join('mo_store', 'simulator.jsn'), 'w') as f:
183184
f.write(os.environ['MO_SIM_CONFIG'])
184-
with open(os.path.join('MicroOcppSimulator', 'mo_store', 'ws-conn-v201.jsn'), 'w') as f:
185+
with open(os.path.join('mo_store', 'ws-conn-v201.jsn'), 'w') as f:
185186
f.write(os.environ['MO_SIM_OCPP_SERVER'])
186-
with open(os.path.join('MicroOcppSimulator', 'mo_store', 'rmt_ctrl.jsn'), 'w') as f:
187+
with open(os.path.join('mo_store', 'rmt_ctrl.jsn'), 'w') as f:
187188
f.write(os.environ['MO_SIM_RMT_CTRL_CONFIG'])
188-
with open(os.path.join('MicroOcppSimulator', 'mo_store', 'rmt_ctrl.pem'), 'w') as f:
189+
with open(os.path.join('mo_store', 'rmt_ctrl.pem'), 'w') as f:
189190
f.write(os.environ['MO_SIM_RMT_CTRL_CERT'])
190191

191192
print(' - start Simulator')
@@ -370,10 +371,13 @@ def run_measurements():
370371

371372
print('Stored test results to CSV')
372373

374+
run_measurements_success = False
375+
373376
def run_measurements_and_retry():
374377

375378
global exit_run_simulator_process
376379
global exit_watchdog
380+
global run_measurements_success
377381

378382
if ( 'TEST_DRIVER_URL' not in os.environ or
379383
'TEST_DRIVER_CONFIG' not in os.environ or
@@ -402,6 +406,7 @@ def run_measurements_and_retry():
402406

403407
run_measurements()
404408
print('\n **Test cases executed successfully**')
409+
run_measurements_success = True
405410
break
406411
except:
407412
print(f'Error detected ({i+1})')
@@ -418,8 +423,14 @@ def run_measurements_and_retry():
418423
print('Retry test cases')
419424
else:
420425
print('\n **Test case execution aborted**')
426+
run_measurements_success = False
421427

422428
exit_watchdog = True # terminate watchdog thread
423429
m_watchdog_thread.join()
424430

425431
run_measurements_and_retry()
432+
433+
if run_measurements_success:
434+
sys.exit(0)
435+
else:
436+
sys.exit(1)

0 commit comments

Comments
 (0)