Commit 184bdd82 authored by hm-schuhba1's avatar hm-schuhba1

add summary to CI-run. Activate all CI runs

parent c98d2280
Pipeline #76226 canceled with stages
...@@ -46,16 +46,6 @@ unit_tests_with_coverage: ...@@ -46,16 +46,6 @@ unit_tests_with_coverage:
- mvn -Dtest=!TestConvolution,!TestBitonicSort,!TestCLLinkedList,!TestCLOptimalStepsModel test - mvn -Dtest=!TestConvolution,!TestBitonicSort,!TestCLLinkedList,!TestCLOptimalStepsModel test
- python3 Tools/ContinuousIntegration/collect_line_and_branch_coverage.py - python3 Tools/ContinuousIntegration/collect_line_and_branch_coverage.py
# run_scenario_files:
# stage: deploy
# script:
# - Documentation/version-control/git-hook-vadere-software
# - mvn clean
# - mvn -Dmaven.test.skip=true package
# - python3 Tools/ContinuousIntegration/run_vadere_console_with_all_scenario_files.py
#
run_origin_test: run_origin_test:
stage: deploy stage: deploy
...@@ -75,3 +65,12 @@ run_seed_test: ...@@ -75,3 +65,12 @@ run_seed_test:
- mvn -Dmaven.test.skip=true package - mvn -Dmaven.test.skip=true package
- python3 Tools/VadereAnalysisTool/setup.py install --user - python3 Tools/VadereAnalysisTool/setup.py install --user
- python3 Tools/ContinuousIntegration/run_seed_comparison_test.py - python3 Tools/ContinuousIntegration/run_seed_comparison_test.py
run_scenario_files:
stage: deploy
script:
- Documentation/version-control/git-hook-vadere-software
- mvn clean
- mvn -Dmaven.test.skip=true package
- python3 Tools/ContinuousIntegration/run_vadere_console_with_all_scenario_files.py
\ No newline at end of file
import getpass
import os
import re
import subprocess
import shutil
def install_package_if_needed(package_name='VadereAnalysisTool', search_path='Tools/VadereAnalysisTool'):
try:
make_package_cwd = os.path.abspath(search_path)
if os.path.exists(os.path.join(search_path, "dist")):
shutil.rmtree(os.path.join(search_path, "dist"))
print("Build package {}...".format(package_name))
p_make_package = subprocess.run(
args=["python3", "setup.py", "bdist_wheel"],
cwd= make_package_cwd,
timeout=10,
check=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
if p_make_package.stdout:
print("StdOut: {}".format(p_make_package.stdout.decode('utf8')))
if p_make_package.stderr:
print("StdErr: {}".format(p_make_package.stderr.decode('utf8')))
print("ReturnCode: {}".format(p_make_package.returncode))
if p_make_package.returncode == 0:
stdout = p_make_package.stdout.decode('utf8')
dist_dir = os.path.join(search_path, "dist")
wheel_files = [f for f in os.listdir(dist_dir) if f.endswith(".whl")]
if len(wheel_files) > 0:
dist_path = os.path.join(search_path, "dist", wheel_files[0])
user = getpass.getuser()
print("\nInstall package {} locally for user {} ...".format(dist_path, user))
p_install_package = subprocess.run(
args=["python3", "-m", "pip", "install", "--user", dist_path],
timeout=10,
check=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
if p_install_package.stdout:
print("StdOut: {}".format(p_install_package.stdout.decode('utf8')))
if p_install_package.stderr:
print("StdErr: {}".format(p_install_package.stderr.decode('utf8')))
print("ReturnCode: {}".format(p_install_package.returncode))
else:
exit(1)
else:
exit(1)
except subprocess.TimeoutExpired as exception:
print("Timeout installing {} from path {}".format(package_name, search_path))
except subprocess.CalledProcessError as exception:
print("Error installing {} from path {}\n err:{}".format(package_name,
search_path,
exception.stderr))
if __name__ == '__main__':
install_package_if_needed()
...@@ -90,14 +90,19 @@ if __name__ == '__main__': ...@@ -90,14 +90,19 @@ if __name__ == '__main__':
output_pairs = get_output_pairs() output_pairs = get_output_pairs()
print("comparing {} output pairs".format(len(output_pairs))) print("comparing {} output pairs".format(len(output_pairs)))
results = [pair.get_origin_deviation_result() for pair in output_pairs] # results = [pair.get_origin_deviation_result() for pair in output_pairs]
return_val = 0 return_val = 0
space_offset = '' space_offset = ''
all_results_count = len(output_pairs)
err_results_count = 0
warn_results_count = 0
ok_results_coutn = 0
for pair in output_pairs: for pair in output_pairs:
result = pair.get_origin_deviation_result() result = pair.get_origin_deviation_result()
print("*** compare trajectories for {} ... ".format(result['output_name']), end='') print("*** compare trajectories for {} ... ".format(result['output_name']), end='')
if result['err_count'] > 0: if result['err_count'] > 0:
err_results_count += 1
print("ERROR") print("ERROR")
return_val = 1 return_val = 1
print(" Error: Found {} pedestrians with maximal diff bigger than {}.".format(result['err_count'], print(" Error: Found {} pedestrians with maximal diff bigger than {}.".format(result['err_count'],
...@@ -111,6 +116,7 @@ if __name__ == '__main__': ...@@ -111,6 +116,7 @@ if __name__ == '__main__':
if result['warn_count'] > 0: if result['warn_count'] > 0:
if result['err_count'] == 0: if result['err_count'] == 0:
warn_results_count += 1
print("WARN") print("WARN")
print(" Warning: Found {} pedestrians with maximal diff between {} and {}.".format(result['warn_count'], print(" Warning: Found {} pedestrians with maximal diff between {} and {}.".format(result['warn_count'],
pair.max_diff_ok, pair.max_diff_ok,
...@@ -123,6 +129,7 @@ if __name__ == '__main__': ...@@ -123,6 +129,7 @@ if __name__ == '__main__':
print(" [{}, {}, {}]".format(row['pedestrianId'], row['timeStep'], row['diff'])) print(" [{}, {}, {}]".format(row['pedestrianId'], row['timeStep'], row['diff']))
if result['err_count'] == 0 and result['warn_count'] == 0: if result['err_count'] == 0 and result['warn_count'] == 0:
ok_results_coutn += 1
print("OK") print("OK")
if result['err_count'] > 0 or result['warn_count'] > 0: if result['err_count'] > 0 or result['warn_count'] > 0:
...@@ -139,5 +146,12 @@ if __name__ == '__main__': ...@@ -139,5 +146,12 @@ if __name__ == '__main__':
)) ))
pair.get_figure([p.get_origin_deviation_result() for p in output_pairs]).show() print("###########")
print("# Summary #")
print("###########")
print("")
print("Total scenario runs: {}".format(all_results_count))
print("Passed: {}".format(ok_results_coutn))
print("Warning: {}".format(warn_results_count))
print("Failed: {}".format(err_results_count))
exit(return_val) exit(return_val)
...@@ -25,8 +25,6 @@ def run_scenario_files_with_vadere_console(project, number_of_runs=3, vadere_con ...@@ -25,8 +25,6 @@ def run_scenario_files_with_vadere_console(project, number_of_runs=3, vadere_con
# Measure wall time and not CPU time simply because it is the simplest method. # Measure wall time and not CPU time simply because it is the simplest method.
wall_time_start = time.time() wall_time_start = time.time()
# Use timout feature, check return value and capture stdout/stderr to a PIPE (use # Use timout feature, check return value and capture stdout/stderr to a PIPE (use
# completed_process.stdout to get it). # completed_process.stdout to get it).
# print("subprocess call: {}".format(' '.join( # print("subprocess call: {}".format(' '.join(
...@@ -78,3 +76,12 @@ if __name__ == '__main__': ...@@ -78,3 +76,12 @@ if __name__ == '__main__':
if seed_ok: if seed_ok:
for res in seed_ok: for res in seed_ok:
print("Scenario {} with scenario-hash {} - OK".format(res['scenario_name'], res['scenario_hash'])) print("Scenario {} with scenario-hash {} - OK".format(res['scenario_name'], res['scenario_hash']))
print("###########")
print("# Summary #")
print("###########")
print("")
print("Total scenario runs: {}".format(len(seed_results)))
print("Passed: {}".format(len(seed_ok)))
print("Failed: {}".format(len(seed_err)))
\ No newline at end of file
...@@ -5,7 +5,7 @@ with open("README.md", "r") as fh: ...@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
setuptools.setup( setuptools.setup(
name="VadereAnalysisTool", name="VadereAnalysisTool",
version="0.0.9", version="0.1.0",
author="Stefan Schuhbäck", author="Stefan Schuhbäck",
author_email="stefan.schuhbaeck@hm.edu", author_email="stefan.schuhbaeck@hm.edu",
description="Import VadereProject to ease analysis", description="Import VadereProject to ease analysis",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment