Repository: tetratelabs/getenvoy
Pull request #188 (2021-04-21 01:31:57)

Templatizes current version of envoy
This allows us to cache the download of envoy when it doesn't change.


codefromthecrypt: cache works

![Screen Shot 2021-04-21 at 1 11 18 PM](https://user-images.githubusercontent.com/64215/115500007-13c55300-
a2a3-11eb-89bb-35183f687e07.png)

codefromthecrypt: looks like total 500MB cached now (dependencies and envoy binary)
mathetake: so how much this makes tests faster..?
codefromthecrypt: 8s down to 2s, though there's probably some increase in time unpacking the cache.

Faster isn't the only thing here, it is also more reliable and less clutter log output. Ex no 503 on bintray unless the version changes as the cache is local. Even bigger than that is less copy/paste as that did drift in the past

Before:
```
Wed, 21 Apr 2021 22:53:36 GMT
Run go run cmd/getenvoy/main.go fetch standard:1.17.1 

—snip—

Wed, 21 Apr 2021 22:53:44 GMT go test ./pkg/...
```

After:
```
Wed, 21 Apr 2021 14:02:28 GMT
Run go run cmd/getenvoy/main.go fetch $(cat pkg/reference.txt) 

Wed, 21 Apr 2021 14:02:30 GMT standard:1.17.1/linux-glibc is already downloaded 

Wed, 21 Apr 2021 14:02:30 GMT go test ./pkg/...
```
codefromthecrypt: IOTW, test execution wouldn't be faster unless we had a drift bug somewhere because we pre-seeded the cache before and after.

Patch:
diff --git a/.editorconfig b/.editorconfig
index a1c1024..efe9c9c 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -11,3 +11,7 @@ keep_padding       = true  # like -kp
 [godownloader.sh]
 # auto-generated file
 ignore = true
+
+[reference.txt]
+insert_final_newline     = false
+trim_trailing_whitespace = true
diff --git a/.github/workflows/commit.yaml b/.github/workflows/commit.yaml
index 3225fa1..99783c4 100644
--- a/.github/workflows/commit.yaml
+++ b/.github/workflows/commit.yaml
@@ -35,14 +35,17 @@ jobs:
         with:
           go-version: ${{ matrix.go-version }}
 
-      - name: "Cache Go modules"
+      - name: "Cache dependencies"
         uses: actions/cache@v2
         with:
+          # This combines unrelated caches because actions/cache@v2 doesn't support multiple
+          # instances, rather a combined path. https://github.com/actions/cache/issues/16
           path: |
+            ~/.getenvoy/builds
             ~/go/pkg/mod
             ~/go/bin/*-v*
           # '.bingo/*.sum' files generate inconsistently when building `~/go/bin/*-v*`. We key '.bingo/*.mod' instead.
-          key: test-${{ runner.os }}-${{ matrix.go-version }}-go-${{ hashFiles('go.sum', '.bingo/*.mod') }}
+          key: test-${{ runner.os }}-${{ matrix.go-version }}-go-${{ hashFiles('pkg/reference.txt', 'go.sum', '.bingo/*.mod') }}
           restore-keys: test-${{ runner.os }}-${{ matrix.go-version }}-go-
 
       - name: "Verify clean check-in"
@@ -52,7 +55,7 @@ jobs:
         # Prefetch envoy to avoid latency during "go test" which contributes to timeouts.
         # This version must align with pkg/binary/envoytest/util.go
         run: |
-          go run cmd/getenvoy/main.go fetch standard:1.17.1
+          go run cmd/getenvoy/main.go fetch $(cat pkg/reference.txt)
           make test
 
       - name: "Generate test coverage report"
@@ -117,14 +120,17 @@ jobs:
         with:
           go-version: ${{ matrix.go-version }}
 
-      - name: "Cache Go modules"
+      - name: "Cache dependencies"
         uses: actions/cache@v2
         with:
+          # This combines unrelated caches because actions/cache@v2 doesn't support multiple
+          # instances, rather a combined path. https://github.com/actions/cache/issues/16
           path: |
+            ~/.getenvoy/builds
             ~/go/pkg/mod
             ~/go/bin/*-v*
           # '.bingo/*.sum' files generate inconsistently when building `~/go/bin/*-v*`. We key '.bingo/*.mod' instead.
-          key: e2e-${{ runner.os }}-${{ matrix.go-version }}-go-${{ hashFiles('go.sum', '.bingo/*.mod') }}
+          key: e2e-${{ runner.os }}-${{ matrix.go-version }}-go-${{ hashFiles('pkg/reference.txt', 'go.sum', '.bingo/*.mod') }}
           restore-keys: e2e-${{ runner.os }}-${{ matrix.go-version }}-go-
 
       - name: "Re-use the `getenvoy` binary pre-built by the upstream job"
diff --git a/.licenserignore b/.licenserignore
index 0677762..be4aa61 100644
--- a/.licenserignore
+++ b/.licenserignore
@@ -10,3 +10,5 @@ go.sum
 .bingo
 .dockerignore
 .idea
+
+reference.txt
diff --git a/Makefile b/Makefile
index ac49a33..81f399b 100644
--- a/Makefile
+++ b/Makefile
@@ -18,7 +18,7 @@
 # bingo manages go binaries needed for building the project
 include .bingo/Variables.mk
 
-ENVOY = standard:1.17.1
+ENVOY = $(shell cat pkg/reference.txt)
 HUB ?= docker.io/getenvoy
 GETENVOY_TAG ?= dev
 BUILDERS_LANGS := rust tinygo
@@ -225,5 +225,6 @@ check:  ## CI blocks merge until this passes. If this fails, run "make check" lo
 .PHONY: clean
 clean: $(GOLANGCI_LINT) ## Clean all binaries
 	@echo "--- $@ ---"
+	@rm -rf build
 	@go clean -testcache
 	@$(GOLANGCI_LINT) cache clean
diff --git a/pkg/cmd/extension/init/cmd.go b/pkg/cmd/extension/init/cmd.go
index c2cfb07..1c5ffa5 100644
--- a/pkg/cmd/extension/init/cmd.go
+++ b/pkg/cmd/extension/init/cmd.go
@@ -20,6 +20,7 @@ import (
 
 	"github.com/spf13/cobra"
 
+	reference "github.com/tetratelabs/getenvoy/pkg"
 	"github.com/tetratelabs/getenvoy/pkg/cmd/extension/globals"
 	scaffold "github.com/tetratelabs/getenvoy/pkg/extension/init"
 	"github.com/tetratelabs/getenvoy/pkg/extension/workspace/config/extension"
@@ -55,7 +56,7 @@ var (
 	// 1. according to command-line options
 	// 2. otherwise, according to the example-specific configuration (.getenvoy/extension/examples/<example>/example.yaml)
 	// 3. otherwise, according to extension descriptor (.getenvoy/extension/extension.yaml)
-	defaultSupportedEnvoyVersion = "standard:1.17.1"
+	defaultSupportedEnvoyVersion = reference.Latest
 )
 
 // NewCmd returns a command that generates the initial set of files
diff --git a/pkg/cmd/extension/run/cmd.go b/pkg/cmd/extension/run/cmd.go
index 65abac0..7870980 100644
--- a/pkg/cmd/extension/run/cmd.go
+++ b/pkg/cmd/extension/run/cmd.go
@@ -21,6 +21,7 @@ import (
 
 	"github.com/spf13/cobra"
 
+	reference "github.com/tetratelabs/getenvoy/pkg"
 	"github.com/tetratelabs/getenvoy/pkg/cmd/extension/build"
 	"github.com/tetratelabs/getenvoy/pkg/cmd/extension/common"
 	examplecmd "github.com/tetratelabs/getenvoy/pkg/cmd/extension/example"
@@ -140,12 +141,12 @@ func NewCmd() *cobra.Command {
 		Short: "Run Envoy extension in the example setup.",
 		Long: `
 Run Envoy extension in the example setup.`,
-		Example: `
+		Example: fmt.Sprintf(`
   # Run Envoy extension in the "default" example setup
   getenvoy extension run
 
   # Run Envoy extension in the "default" example setup using a particular Envoy release provided by getenvoy.io
-  getenvoy extension run --envoy-version standard:1.17.1
+  getenvoy extension run --envoy-version %s
 
   # Run Envoy extension in the "default" example setup using a custom Envoy binary
   getenvoy extension run --envoy-path /path/to/envoy
@@ -163,9 +164,9 @@ Run Envoy extension in the example setup.`,
   getenvoy extension run --toolchain-container-options '-e VAR=VALUE -v /host/path:/container/path'
 
   # Run Envoy extension in the "default" example setup; build the extension using Docker build container with SSH agent forwarding enabled (Docker for Mac)
-  getenvoy extension run --toolchain-container-options ` +
-			`'--mount type=bind,src=/run/host-services/ssh-auth.sock,target=/run/host-services/ssh-auth.sock ` +
-			`-e SSH_AUTH_SOCK=/run/host-services/ssh-auth.sock'`,
+  getenvoy extension run --toolchain-container-options `+
+			`'--mount type=bind,src=/run/host-services/ssh-auth.sock,target=/run/host-services/ssh-auth.sock `+
+			`-e SSH_AUTH_SOCK=/run/host-services/ssh-auth.sock'`, reference.Latest),
 		Args: func(*cobra.Command, []string) error {
 			if err := opts.Run.Validate(); err != nil {
 				return err
diff --git a/pkg/cmd/run.go b/pkg/cmd/run.go
index d5199b2..4108e5e 100644
--- a/pkg/cmd/run.go
+++ b/pkg/cmd/run.go
@@ -21,6 +21,7 @@ import (
 
 	"github.com/spf13/cobra"
 
+	reference "github.com/tetratelabs/getenvoy/pkg"
 	"github.com/tetratelabs/getenvoy/pkg/binary/envoy"
 	"github.com/tetratelabs/getenvoy/pkg/binary/envoy/debug"
 	"github.com/tetratelabs/getenvoy/pkg/flavors"
@@ -36,23 +37,20 @@ var (
 // NewRunCmd create a command responsible for starting an Envoy process
 func NewRunCmd() *cobra.Command {
 	cmd := &cobra.Command{
-		Use:   "run <reference|filepath> [flags] [-- <envoy-args>]",
+		Use:   "run <reference> [flags] [-- <envoy-args>]",
 		Short: "Runs an instance of Envoy.",
 		Long: `
 Manages full lifecycle of Envoy including bootstrap generation and automated collection of access logs,
 Envoy state and machine state into the ` + "`~/.getenvoy/debug`" + ` directory.`,
-		Example: `# Run using a manifest reference.
-getenvoy run standard:1.11.1 -- --config-path ./bootstrap.yaml
-
-# Run using a filepath.
-getenvoy run ./envoy -- --config-path ./bootstrap.yaml
+		Example: fmt.Sprintf(`# Run using a manifest reference.
+getenvoy run %[1]s -- --config-path ./bootstrap.yaml
 
 # List available Envoy flags.
-getenvoy run standard:1.11.1 -- --help
+getenvoy run %[1]s -- --help
 
 # Run with Postgres specific configuration bootstrapped
 getenvoy run postgres:nightly --templateArg endpoints=127.0.0.1:5432,192.168.0.101:5432 --templateArg inport=5555
-`,
+`, reference.Latest),
 		RunE: func(cmd *cobra.Command, args []string) error {
 			runtime, err := envoy.NewRuntime(envoy.RuntimeOption(
 				func(r *envoy.Runtime) {
diff --git a/pkg/reference.go b/pkg/reference.go
new file mode 100644
index 0000000..158987d
--- /dev/null
+++ b/pkg/reference.go
@@ -0,0 +1,25 @@
+// Copyright 2021 Tetrate
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package reference
+
+import (
+	// Embedding the current version makes sharing the value externally easier.
+	_ "embed"
+)
+
+// Latest includes the default version in manifest.NewKey format. This is embedded for re-use in build and CI
+// scripts.
+//go:embed reference.txt
+var Latest string
diff --git a/pkg/reference.txt b/pkg/reference.txt
new file mode 100644
index 0000000..fd5aed8
--- /dev/null
+++ b/pkg/reference.txt
@@ -0,0 +1,1 @@
+standard:1.17.1
\ No newline at end of file


Test patch:
diff --git a/pkg/binary/envoy/fetch_test.go b/pkg/binary/envoy/fetch_test.go
index ef70335..d7c9245 100644
--- a/pkg/binary/envoy/fetch_test.go
+++ b/pkg/binary/envoy/fetch_test.go
@@ -15,6 +15,7 @@
 package envoy
 
 import (
+	"fmt"
 	"io"
 	"io/ioutil"
 	"net/http"
@@ -26,11 +27,16 @@ import (
 	"github.com/mholt/archiver/v3"
 	"github.com/stretchr/testify/require"
 
+	reference "github.com/tetratelabs/getenvoy/pkg"
 	"github.com/tetratelabs/getenvoy/pkg/manifest"
 )
 
 func TestRuntime_Fetch(t *testing.T) {
-	defaultDarwinKey := &manifest.Key{Flavor: "standard", Version: "1.17.1", Platform: "darwin"}
+	key, err := manifest.NewKey(reference.Latest)
+	require.NoError(t, err)
+
+	defaultDarwinKey := &manifest.Key{Flavor: key.Flavor, Version: key.Version, Platform: "darwin"}
+	buildsDir := fmt.Sprintf("builds/%s/%s", key.Flavor, key.Version)
 	tests := []struct {
 		name             string
 		key              *manifest.Key
@@ -49,8 +55,8 @@ func TestRuntime_Fetch(t *testing.T) {
 			tarballStructure: "envoy",
 			tarExtension:     ".tar.gz",
 			responseStatus:   http.StatusOK,
-			envoyLocation:    "builds/standard/1.17.1/darwin/bin/envoy",
-			libLocation:      "builds/standard/1.17.1/darwin/lib/somelib",
+			envoyLocation:    buildsDir + "/darwin/bin/envoy",
+			libLocation:      buildsDir + "/darwin/lib/somelib",
 			wantServerCalled: true,
 		},
 		{
@@ -59,15 +65,15 @@ func TestRuntime_Fetch(t *testing.T) {
 			tarballStructure: "envoy",
 			tarExtension:     ".tar.xz",
 			responseStatus:   http.StatusOK,
-			envoyLocation:    "builds/standard/1.17.1/darwin/bin/envoy",
-			libLocation:      "builds/standard/1.17.1/darwin/lib/somelib",
+			envoyLocation:    buildsDir + "/darwin/bin/envoy",
+			libLocation:      buildsDir + "/darwin/lib/somelib",
 			wantServerCalled: true,
 		},
 		{
 			name:             "Does nothing if it already has a local copy",
 			key:              defaultDarwinKey,
-			envoyLocation:    "builds/standard/1.17.1/darwin/bin/envoy",
-			libLocation:      "builds/standard/1.17.1/darwin/lib/somelib",
+			envoyLocation:    buildsDir + "/darwin/bin/envoy",
+			libLocation:      buildsDir + "/darwin/lib/somelib",
 			alreadyLocal:     true,
 			wantServerCalled: false,
 		},
diff --git a/pkg/binary/envoytest/util.go b/pkg/binary/envoytest/util.go
index 172c9f1..4997593 100644
--- a/pkg/binary/envoytest/util.go
+++ b/pkg/binary/envoytest/util.go
@@ -27,20 +27,17 @@ import (
 	"github.com/stretchr/testify/require"
 	"github.com/tetratelabs/log"
 
+	reference "github.com/tetratelabs/getenvoy/pkg"
 	"github.com/tetratelabs/getenvoy/pkg/binary"
 	"github.com/tetratelabs/getenvoy/pkg/binary/envoy"
 	"github.com/tetratelabs/getenvoy/pkg/manifest"
 )
 
-// reference indicates the default Envoy version to be used for testing.
-// This currently latest, but we may support a range at some point.
-var reference = "standard:1.17.1"
-
 var once sync.Once
 var errorFetchingEnvoy error
 
 // FetchEnvoyAndRun retrieves the Envoy indicated by reference only once. This is intended to be used with TestMain.
-// In CI, you can execute this to obviate latency during test runs: "go run cmd/getenvoy/main.go fetch standard:1.17.1"
+// Execute this to obviate latency during test runs: go run cmd/getenvoy/main.go fetch $(cat pkg/reference.txt)
 func FetchEnvoyAndRun(m *testing.M) {
 	once.Do(func() {
 		errorFetchingEnvoy = fetchEnvoy()
@@ -55,9 +52,9 @@ func FetchEnvoyAndRun(m *testing.M) {
 }
 
 func fetchEnvoy() error {
-	key, err := manifest.NewKey(reference)
+	key, err := manifest.NewKey(reference.Latest)
 	if err != nil {
-		return fmt.Errorf("unable to make manifest key %v: %w", reference, err)
+		return fmt.Errorf("unable to make manifest key %v: %w", reference.Latest, err)
 	}
 
 	r, err := envoy.NewRuntime()
@@ -87,7 +84,7 @@ type RunKillOptions struct{ Bootstrap string }
 //
 // When the configPath parameter is non-empty, it becomes the "--config-path" argument to envoy.
 func RequireRunTerminate(t *testing.T, r binary.Runner, configPath string) {
-	key, err := manifest.NewKey(reference)
+	key, err := manifest.NewKey(reference.Latest)
 	require.NoError(t, err)
 	var args []string
 	if configPath != "" {
diff --git a/pkg/cmd/extension/init/cmd_test.go b/pkg/cmd/extension/init/cmd_test.go
index d40d451..054a3cc 100644
--- a/pkg/cmd/extension/init/cmd_test.go
+++ b/pkg/cmd/extension/init/cmd_test.go
@@ -22,6 +22,7 @@ import (
 
 	"github.com/stretchr/testify/require"
 
+	reference "github.com/tetratelabs/getenvoy/pkg"
 	workspaces "github.com/tetratelabs/getenvoy/pkg/extension/workspace"
 	"github.com/tetratelabs/getenvoy/pkg/extension/workspace/config/extension"
 	toolchains "github.com/tetratelabs/getenvoy/pkg/extension/workspace/toolchain"
@@ -101,7 +102,6 @@ func TestGetEnvoyExtensionInitValidateFlag(t *testing.T) {
 
 func TestGetEnvoyExtensionInit(t *testing.T) {
 	const extensionName = "getenvoy_extension_init"
-	const envoyVersion = "standard:1.17.1"
 
 	type testCase struct {
 		name string
@@ -170,7 +170,7 @@ func TestGetEnvoyExtensionInit(t *testing.T) {
 			require.Equal(t, extensionName, descriptor.Name, `wrong extension name running [%v]: %s`, c, descriptor)
 			require.Equal(t, test.Category, descriptor.Category, `wrong extension category running [%v]: %s`, c, descriptor)
 			require.Equal(t, test.Language, descriptor.Language, `wrong extension language running [%v]: %s`, c, descriptor)
-			require.Equal(t, envoyVersion, descriptor.Runtime.Envoy.Version, `wrong extension envoy version running [%v]: %s`, c, descriptor)
+			require.Equal(t, reference.Latest, descriptor.Runtime.Envoy.Version, `wrong extension envoy version running [%v]: %s`, c, descriptor)
 
 			// Check the default toolchain is loadable
 			toolchain, err := toolchains.LoadToolchain(toolchains.Default, workspace)
diff --git a/pkg/extension/workspace/config/extension/extension_test.go b/pkg/extension/workspace/config/extension/extension_test.go
index 597a820..7df1ced 100644
--- a/pkg/extension/workspace/config/extension/extension_test.go
+++ b/pkg/extension/workspace/config/extension/extension_test.go
@@ -21,11 +21,12 @@ import (
 	"github.com/stretchr/testify/require"
 	"gopkg.in/yaml.v3"
 
+	reference "github.com/tetratelabs/getenvoy/pkg"
 	. "github.com/tetratelabs/getenvoy/pkg/extension/workspace/config/extension"
 )
 
 func TestDescriptorValidate(t *testing.T) {
-	input := `#
+	input := fmt.Sprintf(`#
 # Envoy Wasm extension created with getenvoy toolkit.
 #
 kind: Extension
@@ -38,8 +39,8 @@ language: rust
 # Runtime the extension is being developed against.
 runtime:
   envoy:
-    version: standard:1.17.1
-`
+    version: %[1]s
+`, reference.Latest)
 	var descriptor Descriptor
 	err := yaml.Unmarshal([]byte(input), &descriptor)
 	require.NoError(t, err)
@@ -80,7 +81,7 @@ runtime:
 		},
 		{
 			name: "missing extension name",
-			input: `#
+			input: fmt.Sprintf(`#
 # Envoy Wasm extension created with getenvoy toolkit.
 #
 kind: Extension
@@ -91,17 +92,17 @@ language: rust
 # Runtime the extension is being developed against.
 runtime:
   envoy:
-    version: standard:1.17.1
-`,
+    version: %[1]s
+`, reference.Latest),
 			expectedErr: `extension name cannot be empty`,
 		}, {
 			name: "invalid extension name",
-			input: `#
+			input: fmt.Sprintf(`#
 # Envoy Wasm extension created with getenvoy toolkit.
 #
 kind: Extension
 
-name: ?!@#$%
+name: ?!@#$%%
 
 category: envoy.filters.http
 language: rust
@@ -109,8 +110,8 @@ language: rust
 # Runtime the extension is being developed against.
 runtime:
   envoy:
-    version: standard:1.17.1
-`,
+    version: %[1]s
+`, reference.Latest),
 			expectedErr: `"?!@#$%" is not a valid extension name. Extension name must match the format "^[a-z0-9_]+(\\.[a-z0-9_]+)*$". E.g., 'mycompany.filters.http.custom_metrics'`,
 		},
 	}
diff --git a/pkg/extension/workspace/toolchain/lookup_test.go b/pkg/extension/workspace/toolchain/lookup_test.go
index 81cdd91..1217c5f 100644
--- a/pkg/extension/workspace/toolchain/lookup_test.go
+++ b/pkg/extension/workspace/toolchain/lookup_test.go
@@ -20,6 +20,7 @@ import (
 
 	"github.com/stretchr/testify/require"
 
+	reference "github.com/tetratelabs/getenvoy/pkg"
 	workspaces "github.com/tetratelabs/getenvoy/pkg/extension/workspace"
 	"github.com/tetratelabs/getenvoy/pkg/extension/workspace/fs"
 	"github.com/tetratelabs/getenvoy/pkg/extension/workspace/model"
@@ -73,7 +74,7 @@ func TestLoadToolchainCreatesDefaultWhenMissing(t *testing.T) {
 	dir, err := fs.CreateWorkspaceDir(outputDir)
 	require.NoError(t, err)
 
-	err = dir.WriteFile(model.DescriptorFile, []byte(`
+	err = dir.WriteFile(model.DescriptorFile, []byte(fmt.Sprintf(`
 kind: Extension
 
 name: mycompany.filters.http.custom_metrics
@@ -84,8 +85,8 @@ language: rust
 # Runtime the extension is being developed against.
 runtime:
   envoy:
-    version: standard:1.17.1
-`))
+    version: %s
+`, reference.Latest)))
 	require.NoError(t, err)
 
 	workspace, err := workspaces.GetWorkspaceAt(outputDir)
diff --git a/test/e2e/getenvoy_extension_init_test.go b/test/e2e/getenvoy_extension_init_test.go
index 2c42f7f..03e1b36 100644
--- a/test/e2e/getenvoy_extension_init_test.go
+++ b/test/e2e/getenvoy_extension_init_test.go
@@ -21,6 +21,7 @@ import (
 
 	"github.com/stretchr/testify/require"
 
+	reference "github.com/tetratelabs/getenvoy/pkg"
 	workspaces "github.com/tetratelabs/getenvoy/pkg/extension/workspace"
 	"github.com/tetratelabs/getenvoy/pkg/extension/workspace/config/extension"
 	toolchains "github.com/tetratelabs/getenvoy/pkg/extension/workspace/toolchain"
@@ -33,7 +34,6 @@ import (
 // "getenvoy extension init" does not use Docker. See TestMain for general notes on about the test runtime.
 func TestGetEnvoyExtensionInit(t *testing.T) {
 	const extensionName = "getenvoy_extension_init"
-	const envoyVersion = "standard:1.17.1"
 
 	type testCase struct {
 		name string
@@ -94,7 +94,7 @@ func TestGetEnvoyExtensionInit(t *testing.T) {
 			require.Equal(t, extensionName, descriptor.Name, `wrong extension name running [%v]: %s`, c, descriptor)
 			require.Equal(t, test.Category, descriptor.Category, `wrong extension category running [%v]: %s`, c, descriptor)
 			require.Equal(t, test.Language, descriptor.Language, `wrong extension language running [%v]: %s`, c, descriptor)
-			require.Equal(t, envoyVersion, descriptor.Runtime.Envoy.Version, `wrong extension envoy version running [%v]: %s`, c, descriptor)
+			require.Equal(t, reference.Latest, descriptor.Runtime.Envoy.Version, `wrong extension envoy version running [%v]: %s`, c, descriptor)
 
 			// Check the default toolchain is loadable
 			toolchain, err := toolchains.LoadToolchain(toolchains.Default, workspace)
diff --git a/test/e2e/getenvoy_run_test.go b/test/e2e/getenvoy_run_test.go
index 37fa4ca..340f1bf 100644
--- a/test/e2e/getenvoy_run_test.go
+++ b/test/e2e/getenvoy_run_test.go
@@ -26,6 +26,7 @@ import (
 	"github.com/stretchr/testify/require"
 	"github.com/tetratelabs/log"
 
+	reference "github.com/tetratelabs/getenvoy/pkg"
 	"github.com/tetratelabs/getenvoy/pkg/common"
 	. "github.com/tetratelabs/getenvoy/pkg/test/morerequire"
 	e2e "github.com/tetratelabs/getenvoy/test/e2e/util"
@@ -39,9 +40,9 @@ func TestGetEnvoyRun(t *testing.T) {
 	debugDir, revertOriginalDebugDir := backupDebugDir(t)
 	defer revertOriginalDebugDir()
 
-	c := getEnvoy(`run standard:1.17.1`). // TODO #106
-						Args(`--`, `--config-yaml`). // Below is the minimal config needed to run envoy
-						Arg(`admin: {access_log_path: '/dev/stdout', address: {socket_address: {address: '127.0.0.1', port_value: 0}}}`)
+	c := getEnvoy(`run`).Arg(reference.Latest) // TODO allow implicit version #106
+	// Below is the minimal config needed to run envoy
+	c.Args(`--`, `--config-yaml`, `admin: {access_log_path: '/dev/stdout', address: {socket_address: {address: '127.0.0.1', port_value: 0}}}`)
 
 	stdout, stderr, terminate := c.Start(t, terminateTimeout)