Skip to content

Commit

Permalink
Fix unit/integration install
Browse files Browse the repository at this point in the history
  • Loading branch information
carlcsaposs-canonical committed Apr 14, 2023
1 parent d0c936e commit 7f1b22d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
12 changes: 9 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,18 @@ this operator.
the `main` branch. This also avoids merge commits and creates a linear Git commit history.

## Developing
Install `tox` and `poetry`
```shell
python3 -m pip install --user pipx
python3 -m pipx ensurepath
pipx install tox
pipx install poetry
```

You can create an environment for development with `tox`:
You can create an environment for development:

```shell
tox devenv -e integration
source venv/bin/activate
poetry install
```

### Testing
Expand Down
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,16 @@ jsonschema = "^4.17.3"
boto3 = "^1.26.113"
cosl = "^0.0.5"

[tool.poetry.group.format]
optional = true

[tool.poetry.group.format.dependencies]
black = "^23.3.0"
isort = "^5.12.0"

[tool.poetry.group.lint]
optional = true

[tool.poetry.group.lint.dependencies]
black = "^23.3.0"
isort = "^5.12.0"
Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ commands =
[testenv:unit]
description = Run unit tests
commands_pre =
poetry install --only unit
poetry install --only main,unit
commands =
poetry run coverage run --source={[vars]src_path},{[vars]lib_path} \
-m pytest -v --tb native -s {posargs} {[vars]tests_path}/unit
Expand All @@ -71,6 +71,6 @@ pass_env =
GCP_ACCESS_KEY
GCP_SECRET_KEY
commands_pre =
poetry install --only lint
poetry install --only main,integration
commands =
poetry run pytest -v --tb native --log-cli-level=INFO -s --ignore={[vars]tests_path}/unit/ {posargs}

0 comments on commit 7f1b22d

Please sign in to comment.