Skip to content

Commit

Permalink
Rest API test (initial steps)
Browse files Browse the repository at this point in the history
  • Loading branch information
vg12345 committed May 20, 2024
1 parent 30e8012 commit e9cadbf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/pdr_plugin_ci_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,21 @@ 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
- name: Run full simulation test
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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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())

0 comments on commit e9cadbf

Please sign in to comment.