Skip to content

Commit

Permalink
Remove wasm binary file (envoyproxy#2726)
Browse files Browse the repository at this point in the history
* remove wasm file

* identation

* update target name to check_wasm

* add .wasm to git ignore
  • Loading branch information
bianpengyuan authored Feb 27, 2020
1 parent e586f25 commit b6b1a8b
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 16 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ user.bazelrc
compile_commands.json
test/envoye2e/tcp_metadata_exchange/testoutput
test/envoye2e/http_metadata_exchange/testoutput
*.wasm
6 changes: 4 additions & 2 deletions Makefile.core.mk
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,10 @@ build_envoy_asan:
build_wasm:
$(foreach file, $(shell find extensions -name build_wasm.sh), cd $(TOP)/$(shell dirname $(file)) && bash ./build_wasm.sh &&) true

generate_wasm:
./scripts/generate-wasm.sh -b -c
check_wasm:
export PATH=$(PATH) CC=$(CC) CXX=$(CXX) && bazel $(BAZEL_STARTUP_ARGS) build $(BAZEL_BUILD_ARGS) $(BAZEL_CONFIG_DEV) //src/envoy:envoy
./scripts/generate-wasm.sh -b
env ENVOY_PATH=$(BAZEL_ENVOY_PATH) GO111MODULE=on WASM=true go test ./test/envoye2e/stats/...

clean:
@bazel clean
Expand Down
Binary file removed extensions/metadata_exchange/plugin.wasm
Binary file not shown.
Binary file removed extensions/stats/plugin.wasm
Binary file not shown.
4 changes: 2 additions & 2 deletions prow/proxy-presubmit-wasm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ ROOT=$(dirname $WD)

source "${WD}/proxy-common.inc"

echo 'Generate and check Wasm plugin files'
make generate_wasm
echo 'Generate Wasm module files and run Wasm related test'
make check_wasm
12 changes: 0 additions & 12 deletions scripts/generate-wasm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,18 @@ function usage() {
If the image already exist in the HUB, this will be noop.
The container will be used to compile wasm files.
-p push the wasm sdk container built from the envoy SHA. Must use with `-b`
-c controls whether to check diff of generated wasm files.
-d The bucket name to store the generated wasm files."
exit 1
}

BUILD_CONTAINER=0
PUSH_CONTAINER=0
CHECK_DIFF=0
DST_BUCKET=""

while getopts bpcd: arg ; do
case "${arg}" in
b) BUILD_CONTAINER=1;;
p) PUSH_DOCKER_IMAGE=1;;
c) CHECK_DIFF=1;;
d) DST_BUCKET="${OPTARG}";;
*) usage;;
esac
Expand Down Expand Up @@ -85,15 +82,6 @@ cd ${ROOT}
find . -name "*.wasm" -type f -delete
make build_wasm

if [[ ${CHECK_DIFF} == 1 ]]; then
if [[ -n "$(git status --porcelain 2>/dev/null)" ]]; then
echo "wasm files are out of dated and need to be regenerated, run './scripts/generate-wasm.sh -b' to regenerate them"
exit 1
else
echo "wasm files are up to dated"
fi
fi

echo "Destination bucket: ${DST_BUCKET}"
if [ -n "${DST_BUCKET}" ]; then
cd ${ROOT}
Expand Down
7 changes: 7 additions & 0 deletions test/envoye2e/stats/stats_xds_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@ func skipTSanASan(t *testing.T) {
}
}

func skipWasm(t *testing.T, runtime string) {
if os.Getenv("WASM") == "" || runtime != "envoy.wasm.runtime.v8" {
t.Skip("Skip test since either WASM module is not generated or runtime is not v8")
}
}

type capture struct{}

func (capture) Run(p *driver.Params) error {
Expand Down Expand Up @@ -198,6 +204,7 @@ func TestStatsPayload(t *testing.T) {
skipTSanASan(t)
for _, config := range ClientConfigs {
for _, testCase := range TestCases {
skipWasm(t, testCase.WasmRuntime)
t.Run(config.Name+"/"+testCase.WasmRuntime, func(t *testing.T) {
ports := env.NewPorts(testCase.Ports)
params := &driver.Params{
Expand Down

0 comments on commit b6b1a8b

Please sign in to comment.