diff --git a/.github/workflows/ufm_log_analyzer_ci_workflow.yml b/.github/workflows/ufm_log_analyzer_ci_workflow.yml index 8a73689b..a2964038 100644 --- a/.github/workflows/ufm_log_analyzer_ci_workflow.yml +++ b/.github/workflows/ufm_log_analyzer_ci_workflow.yml @@ -53,3 +53,26 @@ jobs: pip install ruff==0.7.3 ruff format --diff --check src/loganalyze + + pytest: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: 3.9 + + - name: Run Pytest + run: | + SCRIPT_DIR="plugins/ufm_log_analyzer_plugin" + # Set PYTHONPATH to include src directory and two levels up for utils + PYTHONPATH="$(realpath $SCRIPT_DIR/src):$(realpath $SCRIPT_DIR/../../)" + export PYTHONPATH + + cd $SCRIPT_DIR + + pytest --maxfail=1 --disable-warnings -q # Runs pytest with limited output \ No newline at end of file diff --git a/plugins/ufm_log_analyzer_plugin/unit_tests/test_log_analyzer.py b/plugins/ufm_log_analyzer_plugin/unit_tests/test_log_analyzer.py new file mode 100644 index 00000000..fd3fd1bb --- /dev/null +++ b/plugins/ufm_log_analyzer_plugin/unit_tests/test_log_analyzer.py @@ -0,0 +1,5 @@ +def test_succeed(): + assert 2 + 2 == 4 # This will pass + +def test_fail(): + assert 2 + 2 == 5 # This will fail