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

Add tests for pod startup times with multiple resources #1886

Merged
merged 27 commits into from
Sep 2, 2021
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
cc8215c
Add tests for pod startup times with multiple res
vepatel Aug 20, 2021
9a35a1a
Merge branch 'master' into tests/multiple-resources
vepatel Aug 20, 2021
30f780c
Merge master into tests/multiple-resources
nginx-bot Aug 21, 2021
d3094f3
Merge master into tests/multiple-resources
nginx-bot Aug 21, 2021
f6cf6d9
Merge master into tests/multiple-resources
nginx-bot Aug 21, 2021
235e9cf
Merge master into tests/multiple-resources
nginx-bot Aug 21, 2021
8ac90ac
Merge master into tests/multiple-resources
nginx-bot Aug 21, 2021
580393a
Merge master into tests/multiple-resources
nginx-bot Aug 23, 2021
5a63df2
Merge master into tests/multiple-resources
nginx-bot Aug 23, 2021
8c0ca62
Merge master into tests/multiple-resources
nginx-bot Aug 24, 2021
0e7b221
Merge master into tests/multiple-resources
nginx-bot Aug 24, 2021
aa4623f
Merge master into tests/multiple-resources
nginx-bot Aug 25, 2021
4181d6d
Merge master into tests/multiple-resources
nginx-bot Aug 25, 2021
1e0bbba
Merge master into tests/multiple-resources
nginx-bot Aug 26, 2021
d659f04
Merge master into tests/multiple-resources
nginx-bot Aug 26, 2021
ca8f675
Merge master into tests/multiple-resources
nginx-bot Aug 26, 2021
e5b00c5
Merge master into tests/multiple-resources
nginx-bot Aug 27, 2021
84f9f25
Merge master into tests/multiple-resources
nginx-bot Aug 27, 2021
4400960
Merge master into tests/multiple-resources
nginx-bot Aug 30, 2021
5aa78ff
Merge master into tests/multiple-resources
nginx-bot Aug 31, 2021
e70fbfc
Merge master into tests/multiple-resources
nginx-bot Aug 31, 2021
0d81754
Merge master into tests/multiple-resources
nginx-bot Aug 31, 2021
be8322d
Merge master into tests/multiple-resources
nginx-bot Aug 31, 2021
cc319bb
Merge master into tests/multiple-resources
nginx-bot Sep 1, 2021
33a1b46
Address PR comments
vepatel Sep 1, 2021
15acde8
move waiting logic out of common lib
vepatel Sep 1, 2021
641eabb
Merge master into tests/multiple-resources
nginx-bot Sep 1, 2021
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
19 changes: 19 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
DEFAULT_SERVICE,
DEFAULT_DEPLOYMENT_TYPE,
NUM_REPLICAS,
BATCH_START,
BATCH_RESOURCES,
)
from suite.resources_utils import get_first_pod_name

Expand Down Expand Up @@ -80,6 +82,18 @@ def pytest_addoption(parser) -> None:
default="no",
help="Show IC logs in stdout on test failure",
)
parser.addoption(
"--batch-start",
action="store",
default=BATCH_START,
help="Run tests for pods restarts with multiple resources deployed (Ingress/VS): True/False",
)
parser.addoption(
"--batch-resources",
action="store",
default=BATCH_RESOURCES,
help="Number of VS/Ingress resources to deploy",
)


# import fixtures into pytest global namespace
Expand Down Expand Up @@ -110,6 +124,11 @@ def pytest_collection_modifyitems(config, items) -> None:
for item in items:
if "appprotect" in item.keywords:
item.add_marker(appprotect)
if str(config.getoption("--batch-start")) != "True":
batch_start = pytest.mark.skip(reason="Skipping pod restart test with multiple resources")
for item in items:
if "batch_start" in item.keywords:
item.add_marker(batch_start)


@pytest.hookimpl(tryfirst=True, hookwrapper=True)
Expand Down
1 change: 1 addition & 0 deletions tests/data/ap-waf/policies/waf-dataguard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ kind: Policy
metadata:
name: waf-policy
spec:
ingressClassName: nginx
waf:
enable: true
apPolicy: "default/dataguard-alarm"
Expand Down
2 changes: 1 addition & 1 deletion tests/data/appprotect/appprotect-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ kind: Ingress
metadata:
name: appprotect-ingress
annotations:
kubernetes.io/ingress.class: "nginx"
appprotect.f5.com/app-protect-policy: "test-namespace/example-policy"
appprotect.f5.com/app-protect-enable: "True"
appprotect.f5.com/app-protect-security-log-enable: "True"
appprotect.f5.com/app-protect-security-log: "test-namespace/logconf"
appprotect.f5.com/app-protect-security-log-destination: "syslog:server=<IP>:<PORT>"
spec:
ingressClassName: nginx
tls:
- hosts:
- appprotect.example.com
Expand Down
2 changes: 1 addition & 1 deletion tests/data/smoke/standard/smoke-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: "nginx"
name: smoke-ingress
spec:
ingressClassName: nginx
tls:
- hosts:
- smoke.example.com
Expand Down
3 changes: 3 additions & 0 deletions tests/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
ALLOWED_SERVICE_TYPES = ["nodeport", "loadbalancer"]
DEFAULT_DEPLOYMENT_TYPE = "deployment"
ALLOWED_DEPLOYMENT_TYPES = ["deployment", "daemon-set"]
BATCH_START = "False"
vepatel marked this conversation as resolved.
Show resolved Hide resolved
# Number of Ingress/VS resources to deploy based on BATCH_START value, ref. line #264 in rresource_utils.py
BATCH_RESOURCES = 1
# Time in seconds to ensure reconfiguration changes in cluster
RECONFIGURATION_DELAY = 3
NGINX_API_VERSION = 4
Loading