Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
Signed-off-by: spacewander <[email protected]>
  • Loading branch information
spacewander committed Sep 22, 2024
1 parent c224cfe commit 24b5751
Show file tree
Hide file tree
Showing 17 changed files with 27 additions and 23 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions api/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ 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
# race detector assumes that the executable is loaded around the 0 address. When loaded by the Envoy,
# 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}/... \
Expand All @@ -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
2 changes: 1 addition & 1 deletion api/pkg/filtermanager/api/api_129.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build 1.29
//go:build envoy1.29

package api

Expand Down
2 changes: 1 addition & 1 deletion api/pkg/filtermanager/api/api_129_no_so.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 envoy1.29 && !so

package api

Expand Down
2 changes: 1 addition & 1 deletion api/pkg/filtermanager/api/api_129_so.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 envoy1.29 && so

package api

Expand Down
2 changes: 1 addition & 1 deletion api/pkg/filtermanager/api/api_latest.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build !1.29
//go:build !envoy1.29

package api

Expand Down
2 changes: 1 addition & 1 deletion api/pkg/filtermanager/api_impl_129.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build 1.29
//go:build envoy1.29

package filtermanager

Expand Down
2 changes: 1 addition & 1 deletion api/pkg/filtermanager/api_impl_latest.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build !1.29
//go:build !envoy1.29

package filtermanager

Expand Down
2 changes: 1 addition & 1 deletion api/plugins/tests/pkg/envoy/capi_129.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 envoy1.29 && !so

package envoy
2 changes: 1 addition & 1 deletion api/plugins/tests/pkg/envoy/capi_latest.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 !envoy1.29 && !so

package envoy

Expand Down
2 changes: 1 addition & 1 deletion api/tests/integration/libgolang/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 && !envoy1.29

package main

Expand Down
2 changes: 1 addition & 1 deletion api/tests/integration/libgolang/main_129.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 && envoy1.29

package main

Expand Down
8 changes: 4 additions & 4 deletions plugins/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ 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
# race detector assumes that the executable is loaded around the 0 address. When loaded by the Envoy,
# 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}/... \
Expand Down Expand Up @@ -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} \
Expand Down
2 changes: 1 addition & 1 deletion plugins/cmd/libgolang/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 && !envoy1.29

package main

Expand Down
2 changes: 1 addition & 1 deletion plugins/cmd/libgolang/main_129.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 && envoy1.29

package main

Expand Down
2 changes: 1 addition & 1 deletion plugins/tests/integration/libgolang/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 && !envoy1.29

package main

Expand Down
2 changes: 1 addition & 1 deletion plugins/tests/integration/libgolang/main_129.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 && envoy1.29

package main

Expand Down

0 comments on commit 24b5751

Please sign in to comment.