f6198f226a
* Serialization-rebased with main branch * Removing client_id from queue completion callbacks * removing debugging code * source formatting (clang-format v11) (#449) Co-authored-by: SrirakshaNag <SrirakshaNag@users.noreply.github.com> * moving ready signal handler to anonymous namespace * source formatting (clang-format v11) (#450) Co-authored-by: SrirakshaNag <SrirakshaNag@users.noreply.github.com> * Handling deque search better in queue destructor * source formatting (clang-format v11) (#451) Co-authored-by: SrirakshaNag <SrirakshaNag@users.noreply.github.com> * disabling test_total_runtime test in code coverage --------- Co-authored-by: Benjamin Welton <bewelton@amd.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: SrirakshaNag <SrirakshaNag@users.noreply.github.com>
35 lines
931 B
Python
35 lines
931 B
Python
#!/usr/bin/env python3
|
|
|
|
import sys
|
|
import pytest
|
|
|
|
|
|
# helper function
|
|
def node_exists(name, data, min_len=1):
|
|
assert name in data
|
|
assert data[name] is not None
|
|
assert len(data[name]) >= min_len
|
|
|
|
|
|
def test_data_structure(input_data):
|
|
"""verify minimum amount of expected data is present"""
|
|
node_exists("rocprofiler-sdk-json-tool", input_data)
|
|
rocp_data = input_data
|
|
node_exists("names", rocp_data["rocprofiler-sdk-json-tool"]["buffer_records"])
|
|
node_exists(
|
|
"counter_collection", rocp_data["rocprofiler-sdk-json-tool"]["buffer_records"]
|
|
)
|
|
|
|
|
|
def test_counter_values(input_data):
|
|
data = input_data
|
|
counter_info = {}
|
|
for itr in data["rocprofiler-sdk-json-tool"]["buffer_records"]["counter_collection"]:
|
|
value = itr["counter_value"]
|
|
assert value == 1
|
|
|
|
|
|
if __name__ == "__main__":
|
|
exit_code = pytest.main(["-x", __file__] + sys.argv[1:])
|
|
sys.exit(exit_code)
|