Skip to content

Fix handling of '.' as tree_path in get_tree function #153

Fix handling of '.' as tree_path in get_tree function

Fix handling of '.' as tree_path in get_tree function #153

Workflow file for this run

name: Run tests
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12"] # Can be extended with future Python versions
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Podman and Buildah
run: |
sudo apt-get update
sudo apt-get install -y podman buildah
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: '${{ matrix.python-version }}'
cache: 'pip'
- name: Install pytest
run: |
python -m pip install .
python -m pip install pytest pytest-cov pytest-mock
- name: Build the web image
run: |
buildah bud -t tmt-web:latest --build-arg PYTHON_VERSION=${{ matrix.python-version }} .
- name: Create Podman pod
run: |
podman pod create --name tmt-web-pod --infra-image=registry.k8s.io/pause:3.9 -p 8000:8000 -p 6379:6379
# Exposing valkey port as well for background task tests
- name: Start valkey container
run: |
podman run -d --pod tmt-web-pod --name valkey valkey/valkey:alpine
- name: Start Web container
run: |
podman run -d --pod tmt-web-pod --name web \
-e VALKEY_URL=valkey://localhost:6379 \
-e API_HOSTNAME=http://localhost:8000 \
tmt-web:latest uvicorn tmt_web.api:app --reload --host 0.0.0.0 --port 8000
- name: Wait for services to be ready
run: |
for i in {1..30}; do
if curl -s http://localhost:8000/health | grep -q '"status":"ok"'; then
break
fi
sleep 4
done
- name: Run tests
run: |
pytest -v --cov=tmt_web --cov-report=term-missing
- name: Cleanup
if: always()
run: |
podman pod stop tmt-web-pod
podman pod rm tmt-web-pod