Skip to content

Commit

Permalink
Update tox.ini and README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
efiacor committed Feb 24, 2025
1 parent 1c94a95 commit fc2e10d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 21 deletions.
37 changes: 19 additions & 18 deletions operators/o2ims-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This operator implements O-RAN O2 IMS for K8s based cloud management.

### Development Requirements:

- Python3.11
- >= Python3.11
- requirements.txt installed in development environment

### Nephio Management Cluster Requirements:
Expand Down Expand Up @@ -73,13 +73,14 @@ nohup kubectl proxy --port 8080 &>/dev/null &
Build a Docker image:

```bash
docker build -t o2ims-operator:latest -f Dockerfile .
cd operators/o2ims-operator/
make docker-build
```

Push this image in your cluster, here we are using a `kind` cluster so we will push using the below command:

```bash
kind load docker-image o2ims-operator:latest -n o2ims-mgmt
kind load docker-image nephio/o2ims-operator:latest -n o2ims-mgmt
```

`NOTE`: `o2ims-mgmt` is the name of the kind cluster. It is good to mention cluster name if you have multiple clusters.
Expand Down Expand Up @@ -176,34 +177,34 @@ status:
Unit tests are contained in the `tests` directory, and are intended to test pieces of the O2IMS Operator in the `controllers` directory. Currently unit tests are not comprehensive, but provide expected coverage of core utility components.

Prior to running the tests, install the requirements:
Prior to running the tests, install tox in your environment:
```bash
pip3 install -r ./tests/unit_test_requirements.txt
pip install tox
```

To run all tests in `test_utils.py` with abridged output:
To run all tests in `test_utils.py` targeting a specific python version:
```bash
pytest ./tests/test_utils.py
tox -e py312
```

Output:
```bash
==================================================================== test session starts ====================================================================
platform linux -- Python 3.13.0, pytest-8.3.4, pluggy-1.5.0
rootdir: /home/dkosteck/Documents/nephio/operators/o2ims-operator
collected 61 items
py312: commands[0]> pytest --maxfail=1 --disable-warnings -q -v
=========================================================================================== test session starts ===========================================================================================
platform linux -- Python 3.12.3, pytest-8.3.4, pluggy-1.5.0
cachedir: .tox/py312/.pytest_cache
rootdir: /home/fiachra/git/nordix_github/nephio/operators/o2ims-operator
plugins: cov-6.0.0
collected 39 items
tests/test_utils.py ............................................................. [100%]
tests/test_utils.py ....................................... [100%]
==================================================================== 61 passed in 0.14s =====================================================================
=========================================================================================== 39 passed in 0.12s ============================================================================================
py312: OK (0.27=setup[0.02]+cmd[0.25] seconds)
congratulations :) (0.30 seconds)
```

To run with verbose output (showing individual test results):
```bash
pytest -v ./tests/test_utils.py
```

## Known issues

### Porch Endpoints and Stuck Deployments
Expand Down
6 changes: 3 additions & 3 deletions operators/o2ims-operator/tox.ini
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[tox]
envlist = py311, lint
envlist = py311, py312, lint

[testenv:py311]
[testenv:py311,py312]
deps =
-r requirements.txt
-r tests/unit_test_requirements.txt
pytest-cov
commands =
pytest --maxfail=1 --disable-warnings -q
pytest --maxfail=1 --disable-warnings -q -v

# Lint environment for running code style checks
[testenv:lint]
Expand Down

0 comments on commit fc2e10d

Please sign in to comment.