Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added format for tox #563

Merged
merged 1 commit into from
Mar 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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