Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ bind(
# 2. Update .bazelversion, envoy.bazelrc and .bazelrc if needed.
#
# Commit date: 2020-09-08 - Branch: release-1.7
ENVOY_SHA = "376cc83bc44d9b90355f9a736797b27100e85177"
ENVOY_SHA = "13c0682af1efb956ac64661960f53f6d45108d76"

ENVOY_SHA256 = "b7824f5b31e23252025ced988cf184bf59479ada4438db3817ff24c18ec0f849"
ENVOY_SHA256 = "c6d66bdf0a5b8bccf76e42a0e66c1ce61e629ca77cbfa3590524d7f5d777501f"

ENVOY_ORG = "istio"

Expand Down
2 changes: 1 addition & 1 deletion test/envoye2e/driver/envoy.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func (e *Envoy) Run(p *Params) error {
"--disable-hot-restart",
"--drain-time-s", "4", // this affects how long draining listenrs are kept alive
}
envoyPath := filepath.Join(env.GetDefaultEnvoyBin(), "envoy")
envoyPath := filepath.Join(env.GetDefaultEnvoyBinOrDie(), "envoy")
if path, exists := os.LookupEnv("ENVOY_PATH"); exists {
envoyPath = path
}
Expand Down
48 changes: 42 additions & 6 deletions test/envoye2e/env/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,53 @@ import (
"testing"
)

func GetDefaultEnvoyBin() string {
func GetDefaultEnvoyBin() (string, error) {
// Get bazel args if any
buildArgs := os.Getenv("BAZEL_BUILD_ARGS")

// Note: `bazel info bazel-bin` returns incorrect path to a binary (always fastbuild, not opt or dbg)
// Instead we rely on symbolic link src/envoy/envoy in the workspace
workspace, _ := exec.Command("bazel", "info", "workspace").Output()
return filepath.Join(strings.TrimSuffix(string(workspace), "\n"), "bazel-bin/src/envoy/")
args := []string{"info", "workspace"}
if buildArgs != "" {
args = append(args, strings.Split(buildArgs, " ")...)
}
workspace, err := exec.Command("bazel", args...).Output()
if err != nil {
return "", err
}
return filepath.Join(strings.TrimSuffix(string(workspace), "\n"), "bazel-bin/src/envoy/"), nil
}

func GetDefaultEnvoyBinOrDie() string {
p, err := GetDefaultEnvoyBin()
if err != nil {
panic(err)
}
return p
}

func GetBazelOptOut() string {
func GetBazelOptOut() (string, error) {
// Get bazel args if any
buildArgs := os.Getenv("BAZEL_BUILD_ARGS")

// `make build_wasm` puts generated wasm modules into k8-opt.
bazelOutput, _ := exec.Command("bazel", "info", "output_path").Output()
return filepath.Join(strings.TrimSuffix(string(bazelOutput), "\n"), "k8-opt/bin/")
args := []string{"info", "output_path"}
if buildArgs != "" {
args = append(args, strings.Split(buildArgs, " ")...)
}
bazelOutput, err := exec.Command("bazel", args...).Output()
if err != nil {
return "", err
}
return filepath.Join(strings.TrimSuffix(string(bazelOutput), "\n"), "k8-opt/bin/"), nil
}

func GetBazelOptOutOrDie() string {
p, err := GetBazelOptOut()
if err != nil {
panic(err)
}
return p
}

func SkipTSanASan(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion test/envoye2e/stats_plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ var AttributeGenRuntimes = []struct {
WasmRuntime: "envoy.wasm.runtime.null",
},
{
AttributeGenFilterCode: "filename: " + filepath.Join(env.GetBazelOptOut(), "extensions/attributegen.wasm"),
AttributeGenFilterCode: "filename: " + filepath.Join(env.GetBazelOptOutOrDie(), "extensions/attributegen.wasm"),
WasmRuntime: "envoy.wasm.runtime.v8",
},
}
Expand Down
10 changes: 5 additions & 5 deletions test/envoye2e/stats_plugin/stats_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ var Runtimes = []struct {
WasmRuntime: "envoy.wasm.runtime.null",
},
{
MetadataExchangeFilterCode: "filename: " + filepath.Join(env.GetBazelOptOut(), "extensions/metadata_exchange.wasm"),
StatsFilterCode: "filename: " + filepath.Join(env.GetBazelOptOut(), "extensions/stats.wasm"),
MetadataExchangeFilterCode: "filename: " + filepath.Join(env.GetBazelOptOutOrDie(), "extensions/metadata_exchange.wasm"),
StatsFilterCode: "filename: " + filepath.Join(env.GetBazelOptOutOrDie(), "extensions/stats.wasm"),
WasmRuntime: "envoy.wasm.runtime.v8",
},
{
MetadataExchangeFilterCode: "filename: " + filepath.Join(env.GetBazelOptOut(), "extensions/metadata_exchange.compiled.wasm"),
StatsFilterCode: "filename: " + filepath.Join(env.GetBazelOptOut(), "extensions/stats.compiled.wasm"),
MetadataExchangeFilterCode: "filename: " + filepath.Join(env.GetBazelOptOutOrDie(), "extensions/metadata_exchange.compiled.wasm"),
StatsFilterCode: "filename: " + filepath.Join(env.GetBazelOptOutOrDie(), "extensions/stats.compiled.wasm"),
WasmRuntime: "envoy.wasm.runtime.v8",
},
}
Expand Down Expand Up @@ -137,7 +137,7 @@ var AttributeGenRuntimes = []struct {
WasmRuntime: "envoy.wasm.runtime.null",
},
{
AttributeGenFilterCode: "filename: " + filepath.Join(env.GetBazelOptOut(), "extensions/attributegen.wasm"),
AttributeGenFilterCode: "filename: " + filepath.Join(env.GetBazelOptOutOrDie(), "extensions/attributegen.wasm"),
WasmRuntime: "envoy.wasm.runtime.v8",
},
}
Expand Down