From 8d74dfa98afc2b02d7db03c84aed3ca46f51b6dd Mon Sep 17 00:00:00 2001 From: spacewander Date: Sun, 22 Sep 2024 21:11:39 +0800 Subject: [PATCH] rename Signed-off-by: spacewander --- .github/workflows/test.yml | 6 +++++- api/Makefile | 8 ++++---- api/pkg/filtermanager/api/api_129.go | 2 +- api/pkg/filtermanager/api/api_129_no_so.go | 2 +- api/pkg/filtermanager/api/api_129_so.go | 2 +- api/pkg/filtermanager/api/api_latest.go | 2 +- api/pkg/filtermanager/api_impl_129.go | 2 +- api/pkg/filtermanager/api_impl_latest.go | 2 +- api/plugins/tests/pkg/envoy/capi_129.go | 2 +- api/plugins/tests/pkg/envoy/capi_latest.go | 2 +- api/tests/integration/libgolang/main.go | 2 +- api/tests/integration/libgolang/main_129.go | 2 +- plugins/Makefile | 8 ++++---- plugins/cmd/libgolang/main.go | 2 +- plugins/cmd/libgolang/main_129.go | 2 +- plugins/tests/integration/libgolang/main.go | 2 +- plugins/tests/integration/libgolang/main_129.go | 2 +- 17 files changed, 27 insertions(+), 23 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ddd87e7fc..8c1c70312 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -36,7 +36,11 @@ jobs: cache-dependency-path: "**/*.sum" - name: Unit test - run: make unit-test + run: | + pushd .. + ./patch/switch-envoy-go-version.sh 1.29 + popd + make unit-test - name: Build run: make build-test-so diff --git a/api/Makefile b/api/Makefile index e5b8a443b..3e7da97ce 100644 --- a/api/Makefile +++ b/api/Makefile @@ -16,7 +16,7 @@ include ../common.mk .PHONY: unit-test unit-test: - go test -tags ${ENVOY_API_VERSION} ${TEST_OPTION} $(shell go list ./... | \ + go test -tags envoy-${ENVOY_API_VERSION} ${TEST_OPTION} $(shell go list ./... | \ grep -v tests/integration) # We can't specify -race to `go build` because it seems that @@ -24,7 +24,7 @@ unit-test: # the race detector will allocate memory out of 48bits address which is not allowed in x64. .PHONY: build-test-so-local build-test-so-local: - CGO_ENABLED=1 go build -tags so,${ENVOY_API_VERSION} \ + CGO_ENABLED=1 go build -tags so,envoy-${ENVOY_API_VERSION} \ -ldflags "-B 0x$(shell head -c20 /dev/urandom|od -An -tx1|tr -d ' \n') " \ --buildmode=c-shared \ -cover -covermode=atomic -coverpkg=${PROJECT_NAME}/... \ @@ -47,10 +47,10 @@ build-test-so: integration-test: test -d /tmp/htnn_coverage && rm -rf /tmp/htnn_coverage || true $(foreach PKG, $(shell go list ./tests/integration/...), \ - go test -tags ${ENVOY_API_VERSION} -v ${PKG} || exit 1; \ + go test -tags envoy-${ENVOY_API_VERSION} -v ${PKG} || exit 1; \ ) # The benchmark running time can be controlled via env var HTNN_DATA_PLANE_BENCHMARK_DURATION .PHONY: benchmark benchmark: - go test -tags benchmark,${ENVOY_API_VERSION} -v ./tests/integration/ -run TestBenchmark + go test -tags benchmark,envoy-${ENVOY_API_VERSION} -v ./tests/integration/ -run TestBenchmark diff --git a/api/pkg/filtermanager/api/api_129.go b/api/pkg/filtermanager/api/api_129.go index ddc9d57ba..b9e7291b5 100644 --- a/api/pkg/filtermanager/api/api_129.go +++ b/api/pkg/filtermanager/api/api_129.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build 1.29 +//go:build envoy-1.29 package api diff --git a/api/pkg/filtermanager/api/api_129_no_so.go b/api/pkg/filtermanager/api/api_129_no_so.go index ce72dfb79..74f743d2d 100644 --- a/api/pkg/filtermanager/api/api_129_no_so.go +++ b/api/pkg/filtermanager/api/api_129_no_so.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build 1.29 && !so +//go:build envoy-1.29 && !so package api diff --git a/api/pkg/filtermanager/api/api_129_so.go b/api/pkg/filtermanager/api/api_129_so.go index 50ccaffc1..cb942ac52 100644 --- a/api/pkg/filtermanager/api/api_129_so.go +++ b/api/pkg/filtermanager/api/api_129_so.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build 1.29 && so +//go:build envoy-1.29 && so package api diff --git a/api/pkg/filtermanager/api/api_latest.go b/api/pkg/filtermanager/api/api_latest.go index 1de2547ec..753647129 100644 --- a/api/pkg/filtermanager/api/api_latest.go +++ b/api/pkg/filtermanager/api/api_latest.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build !1.29 +//go:build !envoy-1.29 package api diff --git a/api/pkg/filtermanager/api_impl_129.go b/api/pkg/filtermanager/api_impl_129.go index bedec0dad..30a00c839 100644 --- a/api/pkg/filtermanager/api_impl_129.go +++ b/api/pkg/filtermanager/api_impl_129.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build 1.29 +//go:build envoy-1.29 package filtermanager diff --git a/api/pkg/filtermanager/api_impl_latest.go b/api/pkg/filtermanager/api_impl_latest.go index e65ad200c..58a317a28 100644 --- a/api/pkg/filtermanager/api_impl_latest.go +++ b/api/pkg/filtermanager/api_impl_latest.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build !1.29 +//go:build !envoy-1.29 package filtermanager diff --git a/api/plugins/tests/pkg/envoy/capi_129.go b/api/plugins/tests/pkg/envoy/capi_129.go index 29bb1337f..7a5448e76 100644 --- a/api/plugins/tests/pkg/envoy/capi_129.go +++ b/api/plugins/tests/pkg/envoy/capi_129.go @@ -12,6 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build 1.29 && !so +//go:build envoy-1.29 && !so package envoy diff --git a/api/plugins/tests/pkg/envoy/capi_latest.go b/api/plugins/tests/pkg/envoy/capi_latest.go index 80c9a466e..f11fcb806 100644 --- a/api/plugins/tests/pkg/envoy/capi_latest.go +++ b/api/plugins/tests/pkg/envoy/capi_latest.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build !1.29 && !so +//go:build !envoy-1.29 && !so package envoy diff --git a/api/tests/integration/libgolang/main.go b/api/tests/integration/libgolang/main.go index 72de43458..8a64ac3a4 100644 --- a/api/tests/integration/libgolang/main.go +++ b/api/tests/integration/libgolang/main.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build so && !1.29 +//go:build so && !envoy-1.29 package main diff --git a/api/tests/integration/libgolang/main_129.go b/api/tests/integration/libgolang/main_129.go index ba8a81246..a0b52ba5d 100644 --- a/api/tests/integration/libgolang/main_129.go +++ b/api/tests/integration/libgolang/main_129.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build so && 1.29 +//go:build so && envoy-1.29 package main diff --git a/plugins/Makefile b/plugins/Makefile index 8adf6c269..c51018e16 100644 --- a/plugins/Makefile +++ b/plugins/Makefile @@ -18,7 +18,7 @@ PROJECT_ROOT := $(PWD)/.. .PHONY: unit-test unit-test: - go test -tags ${ENVOY_API_VERSION} ${TEST_OPTION} $(shell go list ./... | \ + go test -tags envoy-${ENVOY_API_VERSION} ${TEST_OPTION} $(shell go list ./... | \ grep -v tests/integration) # We can't specify -race to `go build` because it seems that @@ -26,7 +26,7 @@ unit-test: # the race detector will allocate memory out of 48bits address which is not allowed in x64. .PHONY: build-test-so-local build-test-so-local: - CGO_ENABLED=1 go build -tags so,${ENVOY_API_VERSION} \ + CGO_ENABLED=1 go build -tags so,envoy-${ENVOY_API_VERSION} \ -ldflags "-B 0x$(shell head -c20 /dev/urandom|od -An -tx1|tr -d ' \n')" \ --buildmode=c-shared \ -cover -covermode=atomic -coverpkg=${PROJECT_NAME}/... \ @@ -55,12 +55,12 @@ stop-service: integration-test: test -d /tmp/htnn_coverage && rm -rf /tmp/htnn_coverage || true $(foreach PKG, $(shell go list ./tests/integration/...), \ - go test -tags ${ENVOY_API_VERSION} -v ${PKG} || exit 1; \ + go test -tags envoy-${ENVOY_API_VERSION} -v ${PKG} || exit 1; \ ) .PHONY: build-so-local build-so-local: - CGO_ENABLED=1 go build -tags so,${ENVOY_API_VERSION} \ + CGO_ENABLED=1 go build -tags so,envoy-${ENVOY_API_VERSION} \ -ldflags "-B 0x$(shell head -c20 /dev/urandom|od -An -tx1|tr -d ' \n')" \ --buildmode=c-shared \ -v -o ${TARGET_SO} \ diff --git a/plugins/cmd/libgolang/main.go b/plugins/cmd/libgolang/main.go index c83a2a2fa..87a72f482 100644 --- a/plugins/cmd/libgolang/main.go +++ b/plugins/cmd/libgolang/main.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build so && !1.29 +//go:build so && !envoy-1.29 package main diff --git a/plugins/cmd/libgolang/main_129.go b/plugins/cmd/libgolang/main_129.go index d59ea502a..62b7c9b9e 100644 --- a/plugins/cmd/libgolang/main_129.go +++ b/plugins/cmd/libgolang/main_129.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build so && 1.29 +//go:build so && envoy-1.29 package main diff --git a/plugins/tests/integration/libgolang/main.go b/plugins/tests/integration/libgolang/main.go index 1af2a1269..2114c44f5 100644 --- a/plugins/tests/integration/libgolang/main.go +++ b/plugins/tests/integration/libgolang/main.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build so && !1.29 +//go:build so && !envoy-1.29 package main diff --git a/plugins/tests/integration/libgolang/main_129.go b/plugins/tests/integration/libgolang/main_129.go index 7579acb1a..59b234e84 100644 --- a/plugins/tests/integration/libgolang/main_129.go +++ b/plugins/tests/integration/libgolang/main_129.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build so && 1.29 +//go:build so && envoy-1.29 package main