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

Update library paths and requirements file #4085

Merged
merged 4 commits into from
Jul 11, 2023
Merged
Show file tree
Hide file tree
Changes from 3 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
6 changes: 2 additions & 4 deletions perf-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ Run the tests:
* Use local Python3 installation (advised to use pyenv/virtualenv):
```bash
$ cd perf_tests
$ pip3 install -r requirements.txt
$ pytest -v -s -m ap_perf --count=<INT> --node-ip=$(minikube ip) --users=<INT> --hatch-rate=<INT> --time=<INT>
$ pip install -r requirements.txt --no-deps
$ pytest -v -s -m ap_perf --count=<INT> --users=<INT> --hatch-rate=<INT> --time=<INT>
```

The tests will use the Ingress Controller for NGINX with the image built from `debian-image-nap-plus`. See the section below to learn how to configure the tests including the image and the type of NGINX -- NGINX or NGINX Plus.
Expand All @@ -47,9 +47,7 @@ The table below shows various configuration options for the performance tests. U
| `--service` | The type of the Ingress Controller service: nodeport or loadbalancer. | `nodeport` |
| `--node-ip` | The public IP of a cluster node. Not required if you use the loadbalancer service (see --service argument). | `""` |
| `--kubeconfig` | An absolute path to a kubeconfig file. | `~/.kube/config` or the value of the `KUBECONFIG` env variable |
| `N/A` | A path to a folder with a kubeconfig file. | `~/.kube/` |
| `--show-ic-logs` | A flag to control accumulating IC logs in stdout. | `no` |
| `N/A` | Any additional pytest command-line arguments (i.e `-m "smoke"`) | `""` |
| `--count` | Number of times to repeat tests | `1` |
| `--users` | Total no. of users/locusts for response perf tests. | `10` |
| `--hatch-rate` | No. of users hatched per second. | `5` |
Expand Down
29 changes: 24 additions & 5 deletions perf-tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,19 @@
import os
import sys

sys.path.insert(0, "../tests")

import pytest
from kubernetes.config.kube_config import KUBE_CONFIG_DEFAULT_LOCATION
from settings import DEFAULT_DEPLOYMENT_TYPE, DEFAULT_IC_TYPE, DEFAULT_IMAGE, DEFAULT_PULL_POLICY, DEFAULT_SERVICE
from suite.resources_utils import get_first_pod_name

sys.path.insert(0, "../tests")
from settings import (
DEFAULT_DEPLOYMENT_TYPE,
DEFAULT_IC_TYPE,
DEFAULT_IMAGE,
DEFAULT_PULL_POLICY,
DEFAULT_SERVICE,
NUM_REPLICAS,
)
from suite.utils.resources_utils import get_first_pod_name


def pytest_addoption(parser) -> None:
Expand Down Expand Up @@ -53,6 +60,12 @@ def pytest_addoption(parser) -> None:
default=DEFAULT_SERVICE,
help="The type of the Ingress Controller service: nodeport or loadbalancer.",
)
parser.addoption(
"--replicas",
action="store",
default=NUM_REPLICAS,
help="Number of replica pods for type deployment",
)
parser.addoption(
"--node-ip",
action="store",
Expand All @@ -70,6 +83,12 @@ def pytest_addoption(parser) -> None:
default="no",
help="Show IC logs in stdout on test failure",
)
parser.addoption(
"--skip-fixture-teardown",
action="store",
default="no",
help="Skips teardown of test fixtures for debugging purposes",
)
parser.addoption(
"--users",
action="store",
Expand All @@ -91,7 +110,7 @@ def pytest_addoption(parser) -> None:


# import fixtures into pytest global namespace
pytest_plugins = ["suite.fixtures"]
pytest_plugins = ["suite.fixtures.fixtures", "suite.fixtures.ic_fixtures", "suite.fixtures.custom_resource_fixtures"]


def pytest_collection_modifyitems(config, items) -> None:
Expand Down
Loading