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

split appProtect tests to speed up pipeline #4784

Merged
merged 8 commits into from
Dec 12, 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
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,11 @@ jobs:
{\"image\": \"alpine-plus\", \"marker\":\"ingresses\"}, \
{\"image\": \"alpine-plus\", \"marker\": \"vsr\"}, \
{\"image\": \"ubi-plus\", \"marker\": \"policies\"}, \
{\"image\": \"debian-plus-nap\", \"marker\": \"appprotect\"}, \
{\"image\": \"debian-plus-nap\", \"marker\": \"appprotect_integration\"}, \
{\"image\": \"debian-plus-nap\", \"marker\": \"appprotect_waf_policies_allow\"}, \
{\"image\": \"debian-plus-nap\", \"marker\": \"'appprotect_waf_policies and not appprotect_waf_policies_allow'\"}, \
{\"image\": \"debian-plus-nap\", \"marker\": \"appprotect_waf_policies_grpc\"}, \
{\"image\": \"debian-plus-nap\", \"marker\": \"'appprotect_watch or appprotect_batch'\"}, \
{\"image\": \"debian-plus-nap\", \"marker\": \"dos\"}], \
\"k8s\": [\"${{ needs.checks.outputs.k8s_latest }}\"]}" >> $GITHUB_OUTPUT
else
Expand Down
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ addopts = "--tb=native -ra --disable-warnings -x -l --profile -v"
log_cli = true
markers =[
"appprotect",
"appprotect_integration",
"appprotect_waf_policies",
"appprotect_waf_policies_allow",
"appprotect_waf_policies_block",
"appprotect_waf_policies_grpc",
"appprotect_watch",
"appprotect_batch",
"dos",
"ingresses",
"policies",
Expand Down
1 change: 1 addition & 0 deletions tests/suite/test_app_protect_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ def assert_valid_responses(response) -> None:

@pytest.mark.skip_for_nginx_oss
@pytest.mark.appprotect
@pytest.mark.appprotect_integration
@pytest.mark.parametrize(
"crd_ingress_controller_with_ap",
[
Expand Down
4 changes: 4 additions & 0 deletions tests/suite/test_app_protect_waf_policies.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ def assert_valid_responses(response) -> None:

@pytest.mark.skip_for_nginx_oss
@pytest.mark.appprotect
@pytest.mark.appprotect_waf_policies
@pytest.mark.parametrize(
"crd_ingress_controller_with_ap, virtual_server_setup",
[
Expand Down Expand Up @@ -218,6 +219,7 @@ def test_ap_waf_policy_block(
else:
pytest.fail(f"Invalid arguments")

@pytest.mark.appprotect_waf_policies_allow
@pytest.mark.parametrize(
"vs_src, waf",
[
Expand Down Expand Up @@ -366,6 +368,7 @@ def test_ap_waf_policy_multi_logs(

@pytest.mark.skip_for_nginx_oss
@pytest.mark.appprotect
@pytest.mark.appprotect_waf_policies
@pytest.mark.parametrize(
"crd_ingress_controller_with_ap, v_s_route_setup",
[
Expand Down Expand Up @@ -397,6 +400,7 @@ def restore_default_vsr(self, kube_apis, v_s_route_setup) -> None:
)
wait_before_test()

@pytest.mark.appprotect_waf_policies_block
@pytest.mark.parametrize(
"ap_enable",
[
Expand Down
2 changes: 2 additions & 0 deletions tests/suite/test_app_protect_waf_policies_grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ def grpc_waf_allow(kube_apis, test_namespace, public_ip, vs_host, port_ssl):

@pytest.mark.skip_for_nginx_oss
@pytest.mark.appprotect
@pytest.mark.appprotect_waf_policies_grpc
@pytest.mark.parametrize(
"crd_ingress_controller_with_ap",
[
Expand Down Expand Up @@ -302,6 +303,7 @@ def test_responses_grpc_allow(

@pytest.mark.skip_for_nginx_oss
@pytest.mark.appprotect
@pytest.mark.appprotect_waf_policies_grpc
@pytest.mark.parametrize(
"crd_ingress_controller_with_ap",
[
Expand Down
2 changes: 2 additions & 0 deletions tests/suite/test_app_protect_watch_namespace.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ def fin():

@pytest.mark.skip_for_nginx_oss
@pytest.mark.appprotect
@pytest.mark.appprotect_watch
@pytest.mark.parametrize(
"crd_ingress_controller_with_ap",
[{"extra_args": [f"-enable-custom-resources", f"-enable-app-protect", f"-enable-prometheus-metrics"]}],
Expand Down Expand Up @@ -157,6 +158,7 @@ def test_responses(self, request, kube_apis, crd_ingress_controller_with_ap, bac

@pytest.mark.skip_for_nginx_oss
@pytest.mark.appprotect
@pytest.mark.appprotect_watch
@pytest.mark.parametrize(
"crd_ingress_controller_with_ap",
[
Expand Down
1 change: 1 addition & 0 deletions tests/suite/test_app_protect_watch_namespace_label.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ def fin():

@pytest.mark.skip_for_nginx_oss
@pytest.mark.appprotect
@pytest.mark.appprotect_watch
@pytest.mark.parametrize(
"crd_ingress_controller_with_ap",
[
Expand Down
2 changes: 2 additions & 0 deletions tests/suite/test_batch_reloads.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ def fin():
@pytest.mark.skip_for_nginx_oss
@pytest.mark.batch_start
@pytest.mark.appprotect
@pytest.mark.appprotect_batch
@pytest.mark.parametrize(
"crd_ingress_controller_with_ap",
[
Expand Down Expand Up @@ -373,6 +374,7 @@ def fin():
@pytest.mark.skip_for_nginx_oss
@pytest.mark.batch_start
@pytest.mark.appprotect
@pytest.mark.appprotect_batch
@pytest.mark.parametrize(
"crd_ingress_controller_with_ap, virtual_server_setup",
[
Expand Down
2 changes: 2 additions & 0 deletions tests/suite/test_batch_startup_times.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ def fin():
@pytest.mark.skip_for_nginx_oss
@pytest.mark.batch_start
@pytest.mark.appprotect
@pytest.mark.appprotect_batch
@pytest.mark.parametrize(
"crd_ingress_controller_with_ap",
[
Expand Down Expand Up @@ -379,6 +380,7 @@ def fin():
@pytest.mark.skip_for_nginx_oss
@pytest.mark.batch_start
@pytest.mark.appprotect
@pytest.mark.appprotect_batch
@pytest.mark.parametrize(
"crd_ingress_controller_with_ap, virtual_server_setup",
[
Expand Down
Loading