Skip to content

Commit 0271f52

Browse files
committed
Fix linting issues in new tests
1 parent 47f16cb commit 0271f52

File tree

1 file changed

+41
-41
lines changed

1 file changed

+41
-41
lines changed

test/e2e/separate_nodes_test.go

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ import (
1212
"github.com/gruntwork-io/terratest/modules/helm"
1313
"github.com/gruntwork-io/terratest/modules/k8s"
1414
"github.com/gruntwork-io/terratest/modules/random"
15-
digest_auth "github.com/xinsnake/go-http-digest-auth-client"
1615
"github.com/tidwall/gjson"
16+
digestAuth "github.com/xinsnake/go-http-digest-auth-client"
1717
)
1818

1919
func TestSeparateEDnode(t *testing.T) {
20-
// Path to the helm chart we will test
20+
// Path to the helm chart we will test
2121
helmChartPath, e := filepath.Abs("../../charts")
22-
if (e != nil) {
22+
if e != nil {
2323
t.Fatalf(e.Error())
2424
}
2525
username := "admin"
@@ -33,14 +33,14 @@ func TestSeparateEDnode(t *testing.T) {
3333
options := &helm.Options{
3434
KubectlOptions: kubectlOptions,
3535
SetValues: map[string]string{
36-
"persistence.enabled": "false",
37-
"replicaCount": "1",
38-
"image.repository": "marklogic-centos/marklogic-server-centos",
39-
"image.tag": "10-internal",
40-
"auth.adminUsername": username,
41-
"auth.adminPassword": password,
42-
"group.name": "dnode",
43-
"logCollection.enabled": "false",
36+
"persistence.enabled": "false",
37+
"replicaCount": "1",
38+
"image.repository": "marklogic-centos/marklogic-server-centos",
39+
"image.tag": "10-internal",
40+
"auth.adminUsername": username,
41+
"auth.adminPassword": password,
42+
"group.name": "dnode",
43+
"logCollection.enabled": "false",
4444
},
4545
}
4646

@@ -49,7 +49,7 @@ func TestSeparateEDnode(t *testing.T) {
4949

5050
defer t.Logf("====Deleting namespace: " + namespaceName)
5151
defer k8s.DeleteNamespace(t, kubectlOptions, namespaceName)
52-
52+
5353
dnodeReleaseName := "test-dnode-group"
5454
t.Logf("====Installing Helm Chart" + dnodeReleaseName)
5555
helm.Install(t, options, helmChartPath, dnodeReleaseName)
@@ -64,10 +64,10 @@ func TestSeparateEDnode(t *testing.T) {
6464
kubectlOptions, k8s.ResourceTypePod, podName, 8002, 8002)
6565
defer tunnel.Close()
6666
tunnel.ForwardPort(t)
67-
hosts_endpoint := fmt.Sprintf("http://%s/manage/v2/hosts?format=json", tunnel.Endpoint())
68-
t.Logf(`Endpoint: %s`, hosts_endpoint)
67+
hostsEndpoint := fmt.Sprintf("http://%s/manage/v2/hosts?format=json", tunnel.Endpoint())
68+
t.Logf(`Endpoint: %s`, hostsEndpoint)
6969

70-
dr := digest_auth.NewRequest(username, password, "GET", hosts_endpoint, "")
70+
dr := digestAuth.NewRequest(username, password, "GET", hostsEndpoint, "")
7171

7272
if resp, err = dr.Execute(); err != nil {
7373
t.Fatalf(err.Error())
@@ -79,7 +79,7 @@ func TestSeparateEDnode(t *testing.T) {
7979
}
8080
t.Logf("Response:\n" + string(body))
8181
bootstrapHost := gjson.Get(string(body), `host-default-list.list-items.list-item.#(roleref="bootstrap").nameref`)
82-
t.Logf(`BootstrapHost: = %s` , bootstrapHost)
82+
t.Logf(`BootstrapHost: = %s`, bootstrapHost)
8383

8484
// verify bootstrap host exists on the cluster
8585
if bootstrapHost.String() == "" {
@@ -89,32 +89,32 @@ func TestSeparateEDnode(t *testing.T) {
8989
enodeOptions := &helm.Options{
9090
KubectlOptions: kubectlOptions,
9191
SetValues: map[string]string{
92-
"persistence.enabled": "false",
93-
"replicaCount": "2",
94-
"image.repository": "marklogic-centos/marklogic-server-centos",
95-
"image.tag": "10-internal",
96-
"auth.adminUsername": username,
97-
"auth.adminPassword": password,
98-
"group.name": "enode",
99-
"bootstrapHostName": bootstrapHost.String(),
100-
"logCollection.enabled": "false",
92+
"persistence.enabled": "false",
93+
"replicaCount": "2",
94+
"image.repository": "marklogic-centos/marklogic-server-centos",
95+
"image.tag": "10-internal",
96+
"auth.adminUsername": username,
97+
"auth.adminPassword": password,
98+
"group.name": "enode",
99+
"bootstrapHostName": bootstrapHost.String(),
100+
"logCollection.enabled": "false",
101101
},
102102
}
103103
enodeReleaseName := "test-enode-group"
104104
t.Logf("====Installing Helm Chart " + enodeReleaseName)
105105
helm.Install(t, enodeOptions, helmChartPath, enodeReleaseName)
106106

107-
enodePodName-0 := enodeReleaseName + "-marklogic-0"
107+
enodePodName0 := enodeReleaseName + "-marklogic-0"
108108

109109
// wait until the first enode pod is in Ready status
110-
k8s.WaitUntilPodAvailable(t, kubectlOptions, enodePodName-0, 15, 20*time.Second)
110+
k8s.WaitUntilPodAvailable(t, kubectlOptions, enodePodName0, 15, 20*time.Second)
111111

112-
group_endpoint := fmt.Sprintf("http://%s/manage/v2/groups", tunnel.Endpoint())
113-
t.Logf(`Endpoint: %s`, group_endpoint)
112+
groupEndpoint := fmt.Sprintf("http://%s/manage/v2/groups", tunnel.Endpoint())
113+
t.Logf(`Endpoint: %s`, groupEndpoint)
114114

115-
dr_groups := digest_auth.NewRequest(username, password, "GET", group_endpoint, "")
115+
drGroups := digestAuth.NewRequest(username, password, "GET", groupEndpoint, "")
116116

117-
if resp, err = dr_groups.Execute(); err != nil {
117+
if resp, err = drGroups.Execute(); err != nil {
118118
t.Fatalf(err.Error())
119119
}
120120
defer resp.Body.Close()
@@ -129,17 +129,17 @@ func TestSeparateEDnode(t *testing.T) {
129129
t.Errorf("Groups does not exists on cluster")
130130
}
131131

132-
enodePodName-1 := enodeReleaseName + "-marklogic-1"
132+
enodePodName1 := enodeReleaseName + "-marklogic-1"
133133

134134
// wait until the second enode pod is in Ready status
135-
k8s.WaitUntilPodAvailable(t, kubectlOptions, enodePodName-1, 15, 20*time.Second)
135+
k8s.WaitUntilPodAvailable(t, kubectlOptions, enodePodName1, 15, 20*time.Second)
136136

137-
enode_endpoint := fmt.Sprintf("http://%s/manage/v2/groups/enode?format=json", tunnel.Endpoint())
138-
t.Logf(`Endpoint: %s`, enode_endpoint)
137+
enodeEndpoint := fmt.Sprintf("http://%s/manage/v2/groups/enode?format=json", tunnel.Endpoint())
138+
t.Logf(`Endpoint: %s`, enodeEndpoint)
139139

140-
dr_enode := digest_auth.NewRequest(username, password, "GET", enode_endpoint, "")
140+
drEnode := digestAuth.NewRequest(username, password, "GET", enodeEndpoint, "")
141141

142-
if resp, err = dr_enode.Execute(); err != nil {
142+
if resp, err = drEnode.Execute(); err != nil {
143143
t.Fatalf(err.Error())
144144
}
145145
defer resp.Body.Close()
@@ -149,11 +149,11 @@ func TestSeparateEDnode(t *testing.T) {
149149
}
150150
t.Logf("Response:\n" + string(body))
151151

152-
enode_host_count := gjson.Get(string(body), `group-default.relations.relation-group.#(typeref="hosts").relation-count.value`)
153-
t.Logf(`enode_host_count: = %s` , enode_host_count)
152+
enodeHostCount := gjson.Get(string(body), `group-default.relations.relation-group.#(typeref="hosts").relation-count.value`)
153+
t.Logf(`enodeHostCount: = %s`, enodeHostCount)
154154

155155
// verify bootstrap host exists on the cluster
156-
if !strings.Contains(enode_host_count.String(),"2") {
156+
if !strings.Contains(enodeHostCount.String(), "2") {
157157
t.Errorf("enode hosts does not exists on cluster")
158158
}
159-
}
159+
}

0 commit comments

Comments
 (0)