diff --git a/.github/workflows/pdr_plugin_ci_workflow.yml b/.github/workflows/pdr_plugin_ci_workflow.yml index b8eecd4e9..ac290e2f3 100644 --- a/.github/workflows/pdr_plugin_ci_workflow.yml +++ b/.github/workflows/pdr_plugin_ci_workflow.yml @@ -30,14 +30,14 @@ jobs: run: pylint --rcfile=plugins/pdr_deterministic_plugin/.pylintrc plugins/pdr_deterministic_plugin - name: Run exclusion list class test - run: pytest -s plugins/pdr_deterministic_plugin/tests/exclude_list_class_tests.py --cov=exclude_list.py + run: pytest -s plugins/pdr_deterministic_plugin/tests/exclude_list_class_tests.py --cov=py - name: Test exclusion list REST API run: | sudo bash plugins/pdr_deterministic_plugin/.pytest/run_pdr_standalone_pytest.sh echo "Test exclusion list REST API methods" sleep 10 - pytest -s plugins/pdr_deterministic_plugin/tests/exclude_list_rest_api_tests.py --cov=pdr_plugin_api.py + pytest -s plugins/pdr_deterministic_plugin/tests/exclude_list_rest_api_tests.py --cov=py echo "Terminating standalone PDR process" pkill -9 -f isolation_algo.py 2>/dev/null || true @@ -45,6 +45,6 @@ jobs: run: | sudo bash plugins/pdr_deterministic_plugin/.pytest/run_pdr_standalone_pytest.sh echo "Starting simulated test" - python plugins/pdr_deterministic_plugin/tests/simulation_telemetry.py + pytest -s plugins/pdr_deterministic_plugin/tests/simulation_telemetry.py --cov=py echo "Terminating standalone PDR process" pkill -9 -f isolation_algo.py 2>/dev/null || true diff --git a/plugins/pdr_deterministic_plugin/tests/simulation_telemetry.py b/plugins/pdr_deterministic_plugin/tests/simulation_telemetry.py index 64b6d9c69..9c43aa289 100755 --- a/plugins/pdr_deterministic_plugin/tests/simulation_telemetry.py +++ b/plugins/pdr_deterministic_plugin/tests/simulation_telemetry.py @@ -17,6 +17,7 @@ import copy import argparse import random +from os import _exit from os.path import exists from collections import OrderedDict import requests @@ -425,5 +426,11 @@ def main(): if not args.run_forever: return check_logs(config) -if __name__ == '__main__': +def test_main(): + """ + To be called by pytest + """ assert main() == 0 + +if __name__ == '__main__': + _exit(main())