Compare commits

...

2 commits

Author SHA1 Message Date
a5b275fa12
ci: python pipeline 2026-07-12 22:47:44 +02:00
56aec8982c
test: path fixes 2026-07-12 22:33:29 +02:00
6 changed files with 24 additions and 6 deletions

View file

@ -13,3 +13,5 @@ steps:
- event: pull_request
evaluate: 'CI_COMMIT_PULL_REQUEST_LABELS contains "ci-ready"'
- event: manual
depends_on:
- name: python

View file

@ -12,3 +12,5 @@ steps:
when:
- event: [ tag, push, manual ]
branch: master
depends_on:
- name: python

16
.woodpecker/python.yaml Normal file
View file

@ -0,0 +1,16 @@
steps:
- name: test
image: ghcr.io/astral-sh/uv:0.9-python3.12-alpine
commands:
- uv sync
- pytest
- |
python src/karl/__init__.py 2>&1 | while IFS= read -r line; do
echo "$line"
if echo "$line" | grep -q "Uvicorn running on"; then
pkill -f "uvicorn"
break
fi
done
when:
- event: push

View file

@ -2,7 +2,7 @@ from git import Repo, Remote
from injectable import injectable
from karl.config import GitConfig, get_settings
from model.vcs import Head
from karl.model.vcs import Head
@injectable(singleton=True)

View file

@ -8,8 +8,7 @@ from karl.services.mo import Mo
@pytest.fixture(scope='class')
def target_path():
# p = Path('tests/files/test1/test.env')
p = Path('files/test1/test.env')
p = Path('tests/files/test1/test.env')
# posprzątaj przed testem, gdyby plik istniał z poprzednich uruchomień
if p.exists():
p.unlink()
@ -22,8 +21,7 @@ def target_path():
@pytest.fixture(scope='class')
def test1_content(target_path: Path):
mo = Mo(Passwords())
mo.process(Path('files/test1/test.mo.env').absolute())
# mo.process(Path('tests/files/test1/test.mo.env').absolute())
mo.process(Path('tests/files/test1/test.mo.env').absolute())
assert target_path.absolute().exists()

View file

@ -1,4 +1,4 @@
from core import woodpecker
from karl.core import woodpecker
files = [".gitignore", "compose/nginx/docker-compose.yaml", "config/heimdall.kdbx", "files/nginx/cert/fullchain.mo.pem",
"files/nginx/cert/key.mo.pem", "files/nginx/conf.d/default.conf", "files/nginx/conf.d/forge.conf",