From cd98b296fd214501d6668feeccb4064cc98fccc8 Mon Sep 17 00:00:00 2001 From: Vitaly Gavensky Date: Mon, 20 May 2024 17:57:21 +0300 Subject: [PATCH] Rest API test (initial steps) --- .github/workflows/pdr_plugin_ci_workflow.yml | 18 +++++++----------- .../tests/exclude_list_rest_api_tests.py | 2 ++ 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/.github/workflows/pdr_plugin_ci_workflow.yml b/.github/workflows/pdr_plugin_ci_workflow.yml index 0dec67de0..5dd8208e3 100644 --- a/.github/workflows/pdr_plugin_ci_workflow.yml +++ b/.github/workflows/pdr_plugin_ci_workflow.yml @@ -10,7 +10,6 @@ jobs: env: PYTHONPATH: '.:plugins/pdr_deterministic_plugin/ufm_sim_web_service' - PLUGINPATH: 'plugins/pdr_deterministic_plugin' steps: - name: Checkout code @@ -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 diff --git a/plugins/pdr_deterministic_plugin/tests/exclude_list_rest_api_tests.py b/plugins/pdr_deterministic_plugin/tests/exclude_list_rest_api_tests.py index 16997d542..2d74bb8f7 100644 --- a/plugins/pdr_deterministic_plugin/tests/exclude_list_rest_api_tests.py +++ b/plugins/pdr_deterministic_plugin/tests/exclude_list_rest_api_tests.py @@ -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()