tests: Include etcd-last-release in BinPath

Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
This commit is contained in:
Marek Siarkowicz 2022-10-17 12:54:56 +02:00
parent 0f9e15fc37
commit 9bba38e51f
8 changed files with 20 additions and 17 deletions

View File

@ -38,7 +38,7 @@ func TestDowngradeUpgradeClusterOf3(t *testing.T) {
func testDowngradeUpgrade(t *testing.T, clusterSize int) {
currentEtcdBinary := e2e.BinPath.Etcd
lastReleaseBinary := e2e.BinDir + "/etcd-last-release"
lastReleaseBinary := e2e.BinPath.EtcdLastRelease
if !fileutil.Exist(lastReleaseBinary) {
t.Skipf("%q does not exist", lastReleaseBinary)
}

View File

@ -38,7 +38,7 @@ func TestTLSClusterOf3UsingDiscovery(t *testing.T) { testClusterUsingDiscovery(t
func testClusterUsingDiscovery(t *testing.T, size int, peerTLS bool) {
e2e.BeforeTest(t)
lastReleaseBinary := e2e.BinDir + "/etcd-last-release"
lastReleaseBinary := e2e.BinPath.EtcdLastRelease
if !fileutil.Exist(lastReleaseBinary) {
t.Skipf("%q does not exist", lastReleaseBinary)
}

View File

@ -29,7 +29,7 @@ import (
// TestReleaseUpgrade ensures that changes to master branch does not affect
// upgrade from latest etcd releases.
func TestReleaseUpgrade(t *testing.T) {
lastReleaseBinary := e2e.BinDir + "/etcd-last-release"
lastReleaseBinary := e2e.BinPath.EtcdLastRelease
if !fileutil.Exist(lastReleaseBinary) {
t.Skipf("%q does not exist", lastReleaseBinary)
}
@ -113,7 +113,7 @@ func TestReleaseUpgrade(t *testing.T) {
}
func TestReleaseUpgradeWithRestart(t *testing.T) {
lastReleaseBinary := e2e.BinDir + "/etcd-last-release"
lastReleaseBinary := e2e.BinPath.EtcdLastRelease
if !fileutil.Exist(lastReleaseBinary) {
t.Skipf("%q does not exist", lastReleaseBinary)
}

View File

@ -32,7 +32,7 @@ import (
)
func TestEtctlutlMigrate(t *testing.T) {
lastReleaseBinary := e2e.BinDir + "/etcd-last-release"
lastReleaseBinary := e2e.BinPath.EtcdLastRelease
tcs := []struct {
name string

View File

@ -75,7 +75,7 @@ func TestV2DeprecationFlags(t *testing.T) {
e2e.BeforeTest(t)
dataDirPath := t.TempDir()
lastReleaseBinary := e2e.BinDir + "/etcd-last-release"
lastReleaseBinary := e2e.BinPath.EtcdLastRelease
if !fileutil.Exist(lastReleaseBinary) {
t.Skipf("%q does not exist", lastReleaseBinary)
}
@ -101,7 +101,7 @@ func TestV2DeprecationSnapshotMatches(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
lastReleaseBinary := e2e.BinDir + "/etcd-last-release"
lastReleaseBinary := e2e.BinPath.EtcdLastRelease
currentReleaseBinary := e2e.BinPath.Etcd
if !fileutil.Exist(lastReleaseBinary) {
@ -136,7 +136,7 @@ func TestV2DeprecationSnapshotRecover(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
lastReleaseBinary := e2e.BinDir + "/etcd-last-release"
lastReleaseBinary := e2e.BinPath.EtcdLastRelease
currentReleaseBinary := e2e.BinPath.Etcd
if !fileutil.Exist(lastReleaseBinary) {

View File

@ -40,9 +40,10 @@ func init() {
func initBinPathCov(binDir string) binPath {
return binPath{
Etcd: binDir + "/etcd_test",
Etcdctl: binDir + "/etcdctl_test",
Etcdutl: binDir + "/etcdutl_test",
Etcd: binDir + "/etcd_test",
EtcdLastRelease: binDir + "/etcd-last-release",
Etcdctl: binDir + "/etcdctl_test",
Etcdutl: binDir + "/etcdutl_test",
}
}

View File

@ -33,9 +33,10 @@ func init() {
func initBinPathNoCov(binDir string) binPath {
return binPath{
Etcd: binDir + "/etcd",
Etcdctl: binDir + "/etcdctl",
Etcdutl: binDir + "/etcdutl",
Etcd: binDir + "/etcd",
EtcdLastRelease: binDir + "/etcd-last-release",
Etcdctl: binDir + "/etcdctl",
Etcdutl: binDir + "/etcdutl",
}
}

View File

@ -45,9 +45,10 @@ var (
)
type binPath struct {
Etcd string
Etcdctl string
Etcdutl string
Etcd string
EtcdLastRelease string
Etcdctl string
Etcdutl string
}
func InitFlags() {