Skip to content

Commit

Permalink
added format for tox (#563)
Browse files Browse the repository at this point in the history
  • Loading branch information
beliaev-maksim authored and Ivan Chvets committed Apr 21, 2023
1 parent db6baaa commit 525c475
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 13 deletions.
25 changes: 13 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ Visit [charmed-kubeflow.io][charmedkf] for more information.

## Install


For any Kubernetes, follow the [installation instructions][install].

## Testing
Expand All @@ -26,9 +25,10 @@ To deploy this bundle and run tests locally, do the following:
1. Set up Kubernetes, Juju, and deploy the bundle you're interested in (`kubeflow` or
`kubeflow-lite`) using the [installation guide](https://charmed-kubeflow.io/docs/install/). This
must include populating the `.kube/config` file with your Kubernetes cluster as the active
context. Do not create a namespace with the same name as the username, this will cause
pipelines tests to fail. Beware of using `admin` as the dex-auth static-username as the tests
attempt to create a profile and `admin` conflicts with an existing default profile.
context. Do not create a namespace with the same name as the username, this will cause pipelines
tests to fail. Beware of using `admin` as the dex-auth static-username as the tests attempt to
create a profile and `admin` conflicts with an existing default profile.

1. Install test prerequisites:

```bash
Expand All @@ -43,16 +43,17 @@ To deploy this bundle and run tests locally, do the following:

1. Run tests on your bundle with tox. As many tests need authentication, make sure you pass the
username and password you set in step (1) through environment variable or argument, for example:

- full bundle (using command line arguments):
```
tox -e tests -- -m full --username user123@email.com --password user123
```
```
tox -e tests -- -m full --username user123@email.com --password user123
```
- lite bundle (using environment variables):
```
export KUBEFLOW_AUTH_USERNAME=user1234@email.com
export KUBEFLOW_AUTH_PASSWORD=user1234
tox -e tests -- -m lite
```
```
export KUBEFLOW_AUTH_USERNAME=user1234@email.com
export KUBEFLOW_AUTH_PASSWORD=user1234
tox -e tests -- -m lite
```

Subsets of the tests are also available using pytest's substring expression selector (e.g.:
`tox -e tests -- -m full --username user123@email.com --password user123 -k 'selenium'` to run just
Expand Down
1 change: 0 additions & 1 deletion tests/test_kubectl.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ def get_statuses():
@pytest.mark.full
@pytest.mark.lite
async def test_all_charms_running(ops_test: OpsTest):

await ops_test.model.wait_for_idle(
status="active",
raise_on_blocked=True,
Expand Down
8 changes: 8 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ commands =
black --check {toxinidir}/scripts/ {toxinidir}/tests/
mdformat --check --wrap=100 {toxinidir}/README.md

[testenv:fmt]
deps =
black
mdformat-gfm
commands =
black {toxinidir}/scripts/ {toxinidir}/tests/
mdformat --wrap=100 {toxinidir}/README.md

[testenv:tests]
setenv =
# Needed for juju cli to work correctly
Expand Down

0 comments on commit 525c475

Please sign in to comment.