From e0045f25fb55dc638e33e7b51cbf8c3fbc9aa7f7 Mon Sep 17 00:00:00 2001 From: ClemensLinnhoff Date: Mon, 3 Jun 2024 15:18:16 +0200 Subject: [PATCH 1/3] Return exit code 1 if warnings are given Signed-off-by: ClemensLinnhoff --- osivalidator/osi_general_validator.py | 6 ++++++ 1 file changed, 6 insertions(+) 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() From 2527af2bcba3e98959eeada55f06641d051b77d3 Mon Sep 17 00:00:00 2001 From: ClemensLinnhoff Date: Tue, 4 Jun 2024 08:58:56 +0200 Subject: [PATCH 2/3] Use a valid SensorView trace file in the ci Signed-off-by: ClemensLinnhoff --- .github/workflows/ci.yml | 4 ++-- ...Z_sv_370_244_20_generic_valid_sensor_view.osi | Bin 0 -> 6956 bytes 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 data/20240604T065310Z_sv_370_244_20_generic_valid_sensor_view.osi 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 0000000000000000000000000000000000000000..0b0b8ebb2f274a274dc36917ce609bd06c89a9d4 GIT binary patch literal 6956 zcmciFy-Px26bA73UL|i%CJmYhAx$np)Y6cbs3C$#`Y;K~zN03gHF$%FhN8eJsOTSv zrk043hK8Vq2->2dxuGe7pjWzArC!2w;<-&iJaW#DXpeV2R-x<1)T$u(eM#L?S0A|qR-WQI2oX3KbBjSo-z+yyPIR==a zgqyB@74ut0NYnzmS9uL{GelH53RsAUYL5eED53tS4hFB4m19I&kp-+pq!kl@8T7QA zR;FlKtxO^=hDe*sfoOje2W7-+WtANDZV@*_#4S#FhRbSY3YXW)Y{bj?$M%WxU5#DaCxmv&I1-B;)*4}44PJEGFsVphWI!rB7TZQ)Z8)%^$TYj B?;!vH literal 0 HcmV?d00001 From dda7b6fd5d8f90f5a79138ee48465bbcb2221691 Mon Sep 17 00:00:00 2001 From: ClemensLinnhoff Date: Tue, 4 Jun 2024 09:03:21 +0200 Subject: [PATCH 3/3] Add documentation Signed-off-by: ClemensLinnhoff --- doc/usage.adoc | 3 +++ 1 file changed, 3 insertions(+) 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