Setup env vars for tests
This commit is contained in:
parent
5f46b29886
commit
3339259346
5 changed files with 36 additions and 6 deletions
13
.env.test
Normal file
13
.env.test
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
RUNBOAT_SUPPORTED_REPOS=["OCA/mis-builder", "shopinvader/odoo-shopinvader", "OCA/server-env"]
|
||||
RUNBOAT_API_ADMIN_USER="admin"
|
||||
RUNBOAT_API_ADMIN_PASSWD="admin"
|
||||
RUNBOAT_BUILD_NAMESPACE=runboat-builds
|
||||
RUNBOAT_BUILD_PGHOST=postgres14.runboat-builds-db
|
||||
RUNBOAT_BUILD_PGPORT=5432
|
||||
RUNBOAT_BUILD_PGUSER=runboat-build
|
||||
RUNBOAT_BUILD_PGPASSWORD=...
|
||||
RUNBOAT_BUILD_ADMIN_PASSWD=...
|
||||
RUNBOAT_BUILD_DOMAIN=runboat.odoo-community.org
|
||||
RUNBOAT_BUILD_ENV={}
|
||||
RUNBOAT_GITHUB_TOKEN=
|
||||
RUNBOAT_LOG_CONFIG=log-config.yaml
|
||||
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
|
|
@ -22,8 +22,8 @@ jobs:
|
|||
- name: Install project
|
||||
run: |
|
||||
pip install -U "pip>=21.3.1"
|
||||
pip install -e .[test] -c requirements.txt
|
||||
pip install -e .[test] -c requirements.txt -c requirements-test.txt
|
||||
- name: Run tests
|
||||
run: |
|
||||
pytest -v --cov --cov-report=xml
|
||||
pytest -v --cov --cov-report=xml ./tests
|
||||
- uses: codecov/codecov-action@v1
|
||||
|
|
|
|||
|
|
@ -68,8 +68,10 @@ in a different cluster.
|
|||
|
||||
- setup environment variables (start from `.env.sample`)
|
||||
- create a virtualenv, make sure to have pip>=21.3.1 and `pip install -c
|
||||
requirements.txt -e .`
|
||||
requirements.txt -e .[test]`
|
||||
- run with `uvicorn runboat.app:app --log-config=log-config.yaml`
|
||||
- run tests with `pytest` (environment variables used in tests are declared in
|
||||
`.env.test`)
|
||||
|
||||
## Running in production
|
||||
|
||||
|
|
|
|||
|
|
@ -24,9 +24,7 @@ dynamic = ["version", "description"]
|
|||
test = [
|
||||
"pytest",
|
||||
"pytest-cov",
|
||||
]
|
||||
mypy = [
|
||||
"mypy",
|
||||
"pytest-dotenv",
|
||||
]
|
||||
|
||||
[project.urls]
|
||||
|
|
@ -35,4 +33,7 @@ Home = "https://github.com/sbidoul/runboat"
|
|||
[tool.isort]
|
||||
profile = 'black'
|
||||
|
||||
[tool.pytest.ini_options]
|
||||
env_files = [".env.test"]
|
||||
|
||||
# flake8 config is in .flake8
|
||||
|
|
|
|||
14
requirements-test.txt
Normal file
14
requirements-test.txt
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
# frozen requirements generated by pip-deepfreeze
|
||||
attrs==21.2.0
|
||||
coverage==6.1.1
|
||||
iniconfig==1.1.1
|
||||
packaging==21.2
|
||||
pluggy==1.0.0
|
||||
py==1.11.0
|
||||
pyparsing==2.4.7
|
||||
pytest==6.2.5
|
||||
pytest-cov==3.0.0
|
||||
pytest-dotenv==0.5.2
|
||||
python-dotenv==0.19.1
|
||||
toml==0.10.2
|
||||
tomli==1.2.2
|
||||
Loading…
Reference in a new issue