Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/dynamic-readme.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
push:
paths:
- 'app/version'
branches-ignore:
- main

permissions:
contents: write
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/run_tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Run Tests
on:
pull_request:
branches:
- main # Run on PRs targeting main

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: '3.13'

- name: Run tests
id: run_tests
run: |
set -e # Exit immediately if a command exits with a non-zero status
./ace --test
continue-on-error: false

- name: Upload test results
if: always() # Run even if tests fail
uses: actions/upload-artifact@v4
with:
name: pytest-results
path: |
.pytest_cache/
tests/**/test-*.xml
tests/**/test-*.html

# Force the workflow to fail if tests failed
- name: Fail workflow if tests failed
if: failure()
run: |
echo "Tests failed - failing workflow"
exit 1
7 changes: 4 additions & 3 deletions ace
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ run_tests() {
pip install --upgrade -r tests/requirements

python -m pytest tests/unit/ -v
deactivate
exit 0
exit $?
}

run_ace() {
Expand All @@ -22,7 +21,7 @@ run_ace() {

ACE_LOGGER_FILE_NAME="startup" ACE_LOGGER_VERBOSE="$ACE_LOGGER_VERBOSE_ENV" ./startup.py "${@}"
deactivate
exit 0
exit $?
}

# MAIN
Expand Down Expand Up @@ -60,4 +59,6 @@ main() {
run_ace "${original_args[@]}"
}

trap 'exit $?' ERR

main "$@"
5 changes: 5 additions & 0 deletions tests/unit/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,8 @@ def pytest_sessionfinish(session, exitstatus):
print(f"Warning: Could not remove {folder_path} - Permission denied")
except Exception as e:
print(f"Warning: Could not remove {folder_path} - {str(e)}")
if session.testsfailed > 0:
print("Tests failed!")
# Force exit status to 1 if any tests failed
session.exitstatus = 1
return session.exitstatus
1 change: 0 additions & 1 deletion tests/unit/logger/test_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import json
import logging
import os
import shutil
import signal
import sys
from unittest import mock
Expand Down
Loading