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

[v2.4] Add more tests for TCPMappings #4493

Merged
merged 13 commits into from
Sep 16, 2022
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
2 changes: 2 additions & 0 deletions build-aux/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@

# builder.mk
/pytest-kat.txt
/pytest-kat-envoy2.txt
/pytest-kat-envoy3.txt

# --- Files ignored by older versions ---
# Remove the tail of this list when the commit making the change gets
Expand Down
30 changes: 19 additions & 11 deletions builder/builder.mk
Original file line number Diff line number Diff line change
Expand Up @@ -318,21 +318,29 @@ pytest-integration: push-pytest-images

pytest-kat-local: push-pytest-images
$(MAKE) pytest PYTEST_ARGS="$$PYTEST_ARGS python/tests/kat"

pytest-kat-envoy2: push-pytest-images # doing this all at once is too much for CI...
$(MAKE) pytest KAT_RUN_MODE=envoy AMBASSADOR_ENVOY_API_VERSION=V2 PYTEST_ARGS="$$PYTEST_ARGS python/tests/kat"
# ... so we have a separate rule to run things split up
build-aux/.pytest-kat-envoy2.txt.stamp: $(OSS_HOME)/venv push-pytest-images FORCE
. venv/bin/activate && set -o pipefail && AMBASSADOR_ENVOY_API_VERSION=V2 pytest --collect-only python/tests/kat 2>&1 | sed -En 's/.*<Function (.*)>/\1/p' | cut -d. -f1 | sort -u > $@
build-aux/pytest-kat-envoy2.txt: build-aux/%: build-aux/.%.stamp $(tools/copy-ifchanged)
$(tools/copy-ifchanged) $< $@
clean: build-aux/.pytest-kat-envoy2.txt.stamp.rm build-aux/pytest-kat-envoy2.txt.rm
pytest-kat-envoy2-%: build-aux/pytest-kat-envoy2.txt $(tools/py-split-tests)
$(MAKE) pytest KAT_RUN_MODE=envoy AMBASSADOR_ENVOY_API_VERSION=V2 PYTEST_ARGS="$$PYTEST_ARGS -k '$$($(tools/py-split-tests) $(subst -of-, ,$*) <build-aux/pytest-kat-envoy2.txt)' python/tests/kat"

pytest-kat-envoy3: push-pytest-images # doing this all at once is too much for CI...
$(MAKE) pytest KAT_RUN_MODE=envoy PYTEST_ARGS="$$PYTEST_ARGS python/tests/kat"
# ... so we have a separate rule to run things split up
build-aux/.pytest-kat.txt.stamp: $(OSS_HOME)/venv push-pytest-images FORCE
. venv/bin/activate && set -o pipefail && pytest --collect-only python/tests/kat 2>&1 | sed -En 's/.*<Function (.*)>/\1/p' | sed 's/[].].*//' | sort -u > $@
build-aux/pytest-kat.txt: build-aux/%: build-aux/.%.stamp $(tools/copy-ifchanged)
build-aux/.pytest-kat-envoy3.txt.stamp: $(OSS_HOME)/venv push-pytest-images FORCE
. venv/bin/activate && set -o pipefail && pytest --collect-only python/tests/kat 2>&1 | sed -En 's/.*<Function (.*)>/\1/p' | cut -d. -f1 | sort -u > $@
build-aux/pytest-kat-envoy3.txt: build-aux/%: build-aux/.%.stamp $(tools/copy-ifchanged)
$(tools/copy-ifchanged) $< $@
clean: build-aux/.pytest-kat.txt.stamp.rm build-aux/pytest-kat.txt.rm
pytest-kat-envoy3-%: build-aux/pytest-kat.txt $(tools/py-split-tests)
$(MAKE) pytest KAT_RUN_MODE=envoy PYTEST_ARGS="$$PYTEST_ARGS -k '$$($(tools/py-split-tests) $(subst -of-, ,$*) <build-aux/pytest-kat.txt)' python/tests/kat"
pytest-kat-envoy2: push-pytest-images # doing this all at once is too much for CI...
$(MAKE) pytest KAT_RUN_MODE=envoy AMBASSADOR_ENVOY_API_VERSION=V2 PYTEST_ARGS="$$PYTEST_ARGS python/tests/kat"
# ... so we have a separate rule to run things split up
pytest-kat-envoy2-%: build-aux/pytest-kat.txt $(tools/py-split-tests)
$(MAKE) pytest KAT_RUN_MODE=envoy AMBASSADOR_ENVOY_API_VERSION=V2 PYTEST_ARGS="$$PYTEST_ARGS -k '$$($(tools/py-split-tests) $(subst -of-, ,$*) <build-aux/pytest-kat.txt)' python/tests/kat"
clean: build-aux/.pytest-kat-envoy3.txt.stamp.rm build-aux/pytest-kat-envoy3.txt.rm
pytest-kat-envoy3-%: build-aux/pytest-kat-envoy3.txt $(tools/py-split-tests)
$(MAKE) pytest KAT_RUN_MODE=envoy PYTEST_ARGS="$$PYTEST_ARGS -k '$$($(tools/py-split-tests) $(subst -of-, ,$*) <build-aux/pytest-kat-envoy3.txt)' python/tests/kat"

.PHONY: pytest-kat-%

build-output/bin/envoy: docker/base-envoy.docker.tag.local
Expand Down
14 changes: 14 additions & 0 deletions builder/copy-gold.sh
Original file line number Diff line number Diff line change
Expand Up @@ -116,5 +116,19 @@ copy_gold xfpredirect
copy_gold empty empty-namespace
copy_gold plain plain-namespace
copy_gold tcpmappingtest tcp-namespace
copy_gold tcpmappingbasictest
copy_gold tcpmappingcrossnamespacetest
copy_gold tcpmappingtlsoriginationbooltest
copy_gold tcpmappingtlsoriginationv2schemetest
copy_gold tcpmappingtlsoriginationcontexttest
copy_gold tcpmappingtlsoriginationcontextwithdottest
copy_gold tcpmappingtlsoriginationcontextcrossnamespacetest
copy_gold tcpmappingtlsterminationbasictest
copy_gold tcpmappingtlsterminationcrossnamespacetest
copy_gold tcpmappingsnisharedcontexttest
copy_gold tcpmappingsniseparatecontextstest
copy_gold tcpmappingsniwithhttptest
copy_gold tcpmappingaddresstest
copy_gold tcpmappingweighttest

printf "\n"
1 change: 1 addition & 0 deletions python/kat/harness.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ class Node(ABC):
namespace: str = None # type: ignore
is_ambassador = False
local_result: Optional[Dict[str, str]] = None
xfail: Optional[str]

def __init__(self, *args, **kwargs) -> None:
# If self.skip is set to true, this node is skipped
Expand Down
Loading