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 6ce7331 commit cd98b29
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
18 changes: 7 additions & 11 deletions .github/workflows/pdr_plugin_ci_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ jobs:

env:
PYTHONPATH: '.:plugins/pdr_deterministic_plugin/ufm_sim_web_service'
PLUGINPATH: 'plugins/pdr_deterministic_plugin'

steps:
- name: Checkout code
Expand All @@ -23,32 +22,29 @@ jobs:

- name: Install dependencies
run: |
pip install -r $PLUGINPATH/requirements.txt
pip install -r plugins/pdr_deterministic_plugin/requirements.txt
pip install pylint
pip install pytest pytest-cov
- name: Run PyLint
run: pylint --rcfile=$PLUGINPATH/.pylintrc $PLUGINPATH
run: pylint --rcfile=plugins/pdr_deterministic_plugin/.pylintrc plugins/pdr_deterministic_plugin

- name: Run exclusion list class test
timeout-minutes: 5
run: pytest -s $PLUGINPATH/tests/exclude_list_class_tests.py --cov=$PLUGINPATH
run: pytest -s plugins/pdr_deterministic_plugin/tests/exclude_list_class_tests.py

- name: Test exclusion list REST API
timeout-minutes: 5
run: |
sudo bash $PLUGINPATH/.pytest/run_pdr_standalone_pytest.sh
sudo bash plugins/pdr_deterministic_plugin/.pytest/run_pdr_standalone_pytest.sh
echo "Test exclusion list REST API methods"
sleep 10
pytest -s $PLUGINPATH/tests/exclude_list_rest_api_tests.py --cov=$PLUGINPATH
pytest -s plugins/pdr_deterministic_plugin/tests/exclude_list_rest_api_tests.py
echo "Terminating standalone PDR process"
pkill -9 -f isolation_algo.py 2>/dev/null || true
- name: Run full simulation test
timeout-minutes: 10
run: |
sudo bash $PLUGINPATH/.pytest/run_pdr_standalone_pytest.sh
sudo bash plugins/pdr_deterministic_plugin/.pytest/run_pdr_standalone_pytest.sh
echo "Starting simulated test"
python -s $PLUGINPATH/tests/simulation_telemetry.py
python plugins/pdr_deterministic_plugin/tests/simulation_telemetry.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 @@ -43,6 +43,8 @@ def test_exclude_list_rest_api():
assert port_name in response.text
print(" - test: add ports to exclusion list -- PASS")

#


if __name__ == '__main__':
test_exclude_list_rest_api()

0 comments on commit cd98b29

Please sign in to comment.