diff options
author | Vratko Polak <vrpolak@cisco.com> | 2023-07-17 12:47:30 +0200 |
---|---|---|
committer | Vratko Polak <vrpolak@cisco.com> | 2023-07-18 07:55:06 +0000 |
commit | 2ea58f64e04e6010dd4cdf3452a6a2901d371c7d (patch) | |
tree | 3e6d267c8b542f20079d22e5d3f9b873b204234f /resources | |
parent | c461e9407dc7d10a27780e0140088ae0b1adf6e8 (diff) |
feat(crc): print warnings in crc checker scriptoper-230717
Robot already prints warnings when running tests,
but not many people are looking at robot console output.
This makes the warnings visible also in VPP API CRC job console log.
Change-Id: I9044a2970f46e132ec80ae0faa2e0adacc889447
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
(cherry picked from commit c1ddda9b19f448c6c38ad3705f50b6fffe9cb80e)
Diffstat (limited to 'resources')
-rw-r--r-- | resources/libraries/python/VppApiCrc.py | 17 | ||||
-rw-r--r-- | resources/tools/integrated/check_crc.py | 3 |
2 files changed, 18 insertions, 2 deletions
diff --git a/resources/libraries/python/VppApiCrc.py b/resources/libraries/python/VppApiCrc.py index 0cb8c2b7e7..761059f43e 100644 --- a/resources/libraries/python/VppApiCrc.py +++ b/resources/libraries/python/VppApiCrc.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: @@ -380,3 +380,18 @@ class VppApiCrcChecker: if options: self._reported[api_name] = crc logger.console(f"{api_name} used but has options {options}") + + def print_warnings(self): + """Call check_api_name for every API name in surviving collections. + + Useful for VPP CRC checking job. + + Even though there usually is only one surviving collection, + the implementation has to be prepared for multiple collections, + and it should de-duplicate api names. + """ + api_name_to_crc_maps = self._expected.values() + api_name_sets = [set(n2c.keys()) for n2c in api_name_to_crc_maps] + api_names = set().union(*api_name_sets) + for api_name in sorted(api_names): + self.check_api_name(api_name) diff --git a/resources/tools/integrated/check_crc.py b/resources/tools/integrated/check_crc.py index 6baa7a190d..01a557c30c 100644 --- a/resources/tools/integrated/check_crc.py +++ b/resources/tools/integrated/check_crc.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: @@ -47,6 +47,7 @@ def main(): checker = VppApiCrcChecker(api_dir) try: checker.report_initial_conflicts(report_missing=True) + checker.print_warnings() except RuntimeError as err: stderr_lines = [ f"{err!r}", |