diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 87619ea..df15543 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -78,5 +78,5 @@ jobs: run: | source .venv/bin/activate pip install . - osivalidator --data data/20240221T141700Z_sv_300_2112_10_one_moving_object.osi -r rules - osivalidator --data data/20240221T141700Z_sv_300_2112_10_one_moving_object.osi -r rules --parallel + osivalidator --data data/20240604T065310Z_sv_370_244_20_generic_valid_sensor_view.osi -r rules + osivalidator --data data/20240604T065310Z_sv_370_244_20_generic_valid_sensor_view.osi -r rules --parallel diff --git a/data/20240604T065310Z_sv_370_244_20_generic_valid_sensor_view.osi b/data/20240604T065310Z_sv_370_244_20_generic_valid_sensor_view.osi new file mode 100644 index 0000000..0b0b8eb Binary files /dev/null and b/data/20240604T065310Z_sv_370_244_20_generic_valid_sensor_view.osi differ diff --git a/doc/usage.adoc b/doc/usage.adoc index 24f8e0c..1c8240e 100644 --- a/doc/usage.adoc +++ b/doc/usage.adoc @@ -118,6 +118,9 @@ Ranges of timestamps Message [START_TIMESTAMP, END_TIMESTAMP] PATH_TO_RULE(VALUE) does not comply in PATH_TO_OSI_FIELD ---- +The osivalidator will end the execution with the exit code 1, if warnings or errors are generated. +If the trace file is valid and no warning or errors occurred, the execution is ended with exit code 0. + == Understanding Validation Output To better understand the validation output let us use the example diff --git a/osivalidator/osi_general_validator.py b/osivalidator/osi_general_validator.py index e6a9f25..3238a1f 100755 --- a/osivalidator/osi_general_validator.py +++ b/osivalidator/osi_general_validator.py @@ -199,6 +199,8 @@ def main(): trace.close() display_results() + if get_num_logs() > 0: + exit(1) def process_message(message, timestep, data_type): @@ -224,5 +226,9 @@ def display_results(): return LOGGER.synthetize_results(LOGS) +def get_num_logs(): + return len(LOGS) + + if __name__ == "__main__": main()