integration: Port tests to use standalone etcd

This ports the integration tests to use a standalone etcd server instead
of depending on the flaky elastic etcd clustering. Hopefully we will
polish and/or reimplement that at some point in the future, but at least
for now let's make things reliable.
This commit is contained in:
James Shubin
2023-08-30 02:32:17 -04:00
parent fb57fb714a
commit b60d222c81
3 changed files with 177 additions and 6 deletions

View File

@@ -158,6 +158,7 @@ func TestCluster1(t *testing.T) {
name string
code string // mcl code
fail bool
etcd bool // standalone etcd?
hosts []string
expect map[string]map[string]string // hostname, file, contents
}
@@ -178,6 +179,7 @@ func TestCluster1(t *testing.T) {
name: "simple pair",
code: code,
fail: false,
etcd: true,
hosts: []string{"h1", "h2"},
expect: map[string]map[string]string{
"h1": {
@@ -204,6 +206,7 @@ func TestCluster1(t *testing.T) {
name: "hello world",
code: code,
fail: false,
etcd: true,
hosts: []string{"h1", "h2", "h3"},
expect: map[string]map[string]string{
"h1": {
@@ -221,9 +224,10 @@ func TestCluster1(t *testing.T) {
for index, tc := range testCases { // run all the tests
t.Run(fmt.Sprintf("test #%d (%s)", index, tc.name), func(t *testing.T) {
code, fail, hosts, expect := tc.code, tc.fail, tc.hosts, tc.expect
code, fail, etcd, hosts, expect := tc.code, tc.fail, tc.etcd, tc.hosts, tc.expect
c := Cluster{
Etcd: etcd,
Hostnames: hosts,
Preserve: true,
Debug: false, // TODO: set to true if not too wordy