Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
vg12345 committed May 21, 2024
1 parent 6df8a32 commit 21efccd
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/pdr_plugin_ci_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
pip install -r $PDRPATH/requirements.txt
pip install pylint
pip install pytest-cov
- name: Run PyLint
run: pylint --rcfile=$PDRPATH/.pylintrc $PDRPATH

Expand All @@ -41,14 +41,12 @@ jobs:
echo "Test exclusion list REST API methods"
sleep 10
pytest -s $PDRPATH/tests/exclude_list_rest_api_tests.py --cov=$PDRPATH
echo "Terminating standalone PDR process"
pkill -9 -f isolation_algo.py 2>/dev/null || true
sudo bash $PDRPATH/.pytest/terminate_pdr_standalone_pytest.sh
- name: Run full simulation test
timeout-minutes: 10
run: |
sudo bash $PDRPATH/.pytest/run_pdr_standalone_pytest.sh
echo "Starting simulated test"
python $PDRPATH/tests/simulation_telemetry.py
echo "Terminating standalone PDR process"
pkill -9 -f isolation_algo.py 2>/dev/null || true
sudo bash $PDRPATH/.pytest/terminate_pdr_standalone_pytest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ else
echo -e '\n[Common]\nTEST_MODE=True\n' >> "$CONFIG_FILE"
fi

"Terminating standalone PDR process"
pkill -9 -f isolation_algo.py 2>/dev/null || true
sleep 10

bash $PLUGIN_DIR/.pytest/terminate_pdr_standalone_pytest.sh
echo "Starting standalone PDR process"
python $PLUGIN_DIR/ufm_sim_web_service/isolation_algo.py >/dev/null 2>&1 &
sleep 10
if ! pgrep -x isolation_algo.py> /dev/null; then
echo "Failed to start standalone PDR process"
exit 1
fi
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash -x

echo "Terminating standalone PDR process"
ps -ef | grep isolation_algo.py | grep -v grep | awk '{print $2}' | xargs kill -9 $1 >/dev/null 2>/dev/null
sleep 10
if pgrep -x isolation_algo.py> /dev/null; then
echo "Failed to terminate standalone PDR process"
exit 1
fi

0 comments on commit 21efccd

Please sign in to comment.