fix(reinstall): use OSTemplate.vmid (not template_vmid) and convert memory bytes->MB

- AttributeError: OSTemplate has no 'template_vmid' field; the actual column is 'vmid'.
- Use OSTemplate.get_vmid_for_node() to support cross-node replicated templates,
  falling back to source_node/vmid otherwise.
- VMInstance.memory is stored in bytes, but Proxmox config expects MB.
This commit is contained in:
markmorado
2026-04-29 23:48:48 +02:00
parent 5169bf80a3
commit 89d70654fc
45 changed files with 2946 additions and 741 deletions

57
.github/workflows/backend-tests.yml vendored Normal file
View File

@@ -0,0 +1,57 @@
name: Backend Tests
on:
push:
branches: [main]
paths:
- "backend/**"
- ".github/workflows/backend-tests.yml"
pull_request:
branches: [main]
paths:
- "backend/**"
- ".github/workflows/backend-tests.yml"
jobs:
pytest:
name: pytest (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.12"]
defaults:
run:
working-directory: backend
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: backend/requirements-dev.txt
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Run pytest with coverage
run: |
python -m pytest \
--cov=app \
--cov-report=term-missing \
--cov-report=xml \
-p no:warnings
- name: Upload coverage artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: backend-coverage-${{ matrix.python-version }}
path: backend/coverage.xml
if-no-files-found: ignore