Skip to content

Rest API test (initial steps) #108

Rest API test (initial steps)

Rest API test (initial steps) #108

name: PDR Plugin CI Workflow
on:
push:
paths:
- 'plugins/pdr_deterministic_plugin/**'
jobs:
build:
runs-on: ubuntu-latest
env:
PYTHONPATH: '.:plugins/pdr_deterministic_plugin/ufm_sim_web_service'
PLUGIN_RELATIVE_PATH : plugins/pdr_deterministic_plugin
steps:
- name: Checkout code
uses: actions/checkout@main
- name: Set up Python
uses: actions/setup-python@main
with:
python-version: 3.9
- name: Install dependencies
run: |
pip install -r $PLUGIN_RELATIVE_PATH/requirements.txt
pip install pylint
pip install pytest pytest-cov
- name: Run PyLint
run: pylint --rcfile=$PLUGIN_RELATIVE_PATH/.pylintrc $PLUGIN_RELATIVE_PATH
- name: Run exclusion list class test
timeout-minutes: 5
run: pytest -s $PLUGIN_RELATIVE_PATH/tests/exclude_list_class_tests.py --cov=$PLUGIN_RELATIVE_PATH
- name: Test exclusion list REST API
timeout-minutes: 5
run: |
sudo bash $PLUGIN_RELATIVE_PATH/.pytest/run_pdr_standalone_pytest.sh
echo "Test exclusion list REST API methods"
sleep 10
pytest -s $PLUGIN_RELATIVE_PATH/tests/exclude_list_rest_api_tests.py --cov=$PLUGIN_RELATIVE_PATH
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 $PLUGIN_RELATIVE_PATH/.pytest/run_pdr_standalone_pytest.sh
echo "Starting simulated test"
python $PLUGIN_RELATIVE_PATH/tests/simulation_telemetry.py
echo "Terminating standalone PDR process"
pkill -9 -f isolation_algo.py 2>/dev/null || true