From e5d7b7f8a5ce8a356d0497faba1ae865cccaafd1 Mon Sep 17 00:00:00 2001 From: SouthFox Date: Mon, 26 Feb 2024 21:57:14 +0800 Subject: [PATCH] [fix/ci] use .test.env for ci --- .env.test | 2 ++ .forgejo/workflows/test.yml | 4 ++-- pyproject.toml | 5 +---- pytest.ini | 3 +++ 4 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 .env.test create mode 100644 pytest.ini diff --git a/.env.test b/.env.test new file mode 100644 index 0000000..4c23016 --- /dev/null +++ b/.env.test @@ -0,0 +1,2 @@ +FOXHOLE_CONFIG_FILE = "tests.toml" +FOXHOLE_KEY_PATH = "tests/key.pem" diff --git a/.forgejo/workflows/test.yml b/.forgejo/workflows/test.yml index 2f3f9f2..2f5cd71 100644 --- a/.forgejo/workflows/test.yml +++ b/.forgejo/workflows/test.yml @@ -1,6 +1,6 @@ on: [push] jobs: - build-uberjar: + run-pytest: container: image: nikolaik/python-nodejs:python3.11-nodejs21 steps: @@ -19,7 +19,7 @@ jobs: - name: Run test run: | poetry install --no-root - poetry run pytest -vvv + poetry run pytest --envfile .env.test -vvv - name: Cache poetry project dependencies uses: actions/cache/save@v4 diff --git a/pyproject.toml b/pyproject.toml index 375a59c..3b3e5c3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,10 +5,6 @@ description = "" authors = ["SouthFox "] readme = "README.org" -[tool.pytest_env] -FOXHOLE_CONFIG_FILE = "tests.toml" -FOXHOLE_KEY_PATH = "tests/key.pem" - [tool.poetry.dependencies] python = "^3.11" fastapi = "^0.110.0" @@ -38,6 +34,7 @@ factory-boy = "^3.2.1" black = "^23.7.0" pytest-dotenv = "^0.5.2" + [build-system] requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 0000000..c802d0a --- /dev/null +++ b/pytest.ini @@ -0,0 +1,3 @@ +[pytest] +env_files = + .test.env