Skip to content

Commit 7ab6ac2

Browse files
committed
Placate linter
Signed-off-by: Christopher Crone <[email protected]>
1 parent cb61722 commit 7ab6ac2

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

compliance_test.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ import (
1212
const (
1313
localhost = "127.0.0.1"
1414
pingEntrypoint = "http://" + localhost + ":8080/ping"
15-
pingTargetUrl = "target:8080/ping"
16-
pingUrl = pingEntrypoint + "?address=" + pingTargetUrl
15+
pingTargetURL = "target:8080/ping"
16+
pingURL = pingEntrypoint + "?address=" + pingTargetURL
1717

1818
volumefileEntrypoint = "http://" + localhost + ":8080/volumefile"
19-
volumeUrl = volumefileEntrypoint + "?filename="
19+
volumeURL = volumefileEntrypoint + "?filename="
2020

2121
udpEntrypoint = "http://" + localhost + ":8080/udp"
2222

@@ -40,7 +40,7 @@ func TestSimpleNetwork(t *testing.T) {
4040
specRef: "Networks-top-level-element",
4141
}
4242
h.TestUpDown(func() {
43-
actual := h.getHttpBody(pingUrl)
43+
actual := h.getHTTPBody(pingURL)
4444
expected := jsonResponse("PONG FROM TARGET")
4545
h.Check(expected, actual)
4646
})
@@ -53,7 +53,7 @@ func TestSimpleNetworkFail(t *testing.T) {
5353
specRef: "Networks-top-level-element",
5454
}
5555
h.TestUpDown(func() {
56-
actual := h.getHttpBody(pingEntrypoint + "?address=notatarget:8080/ping")
56+
actual := h.getHTTPBody(pingEntrypoint + "?address=notatarget:8080/ping")
5757
expected := jsonResponse("Could not reach address: notatarget:8080/ping")
5858
h.Check(expected, actual)
5959
})
@@ -66,7 +66,7 @@ func TestDifferentNetworks(t *testing.T) {
6666
specRef: "Networks-top-level-element",
6767
}
6868
h.TestUpDown(func() {
69-
actual := h.getHttpBody(pingUrl)
69+
actual := h.getHTTPBody(pingURL)
7070
expected := jsonResponse("Could not reach address: target:8080/ping")
7171
h.Check(expected, actual)
7272
})
@@ -79,7 +79,7 @@ func TestVolumeFile(t *testing.T) {
7979
specRef: "volumes-top-level-element",
8080
}
8181
h.TestUpDown(func() {
82-
actual := h.getHttpBody(volumeUrl + "test_volume.txt")
82+
actual := h.getHTTPBody(volumeURL + "test_volume.txt")
8383
expected := jsonResponse("MYVOLUME")
8484
h.Check(expected, actual)
8585

@@ -93,7 +93,7 @@ func TestSecretFile(t *testing.T) {
9393
specRef: "secrets-top-level-element",
9494
}
9595
h.TestUpDown(func() {
96-
actual := h.getHttpBody(volumeUrl + "test_secret.txt")
96+
actual := h.getHTTPBody(volumeURL + "test_secret.txt")
9797
expected := jsonResponse("MYSECRET")
9898
h.Check(expected, actual)
9999
})
@@ -107,7 +107,7 @@ func TestConfigFile(t *testing.T) {
107107
specRef: "configs-top-level-element",
108108
}
109109
h.TestUpDown(func() {
110-
actual := h.getHttpBody(volumeUrl + "test_config.txt")
110+
actual := h.getHTTPBody(volumeURL + "test_config.txt")
111111
expected := jsonResponse("MYCONFIG")
112112
h.Check(expected, actual)
113113
})
@@ -133,7 +133,7 @@ func TestUdpPort(t *testing.T) {
133133
_, err = Conn.Write(buf)
134134
h.NilError(err)
135135
time.Sleep(time.Second) // Wait for the registration
136-
actual := h.getHttpBody(udpEntrypoint)
136+
actual := h.getHTTPBody(udpEntrypoint)
137137
expected := jsonResponse(udpValue)
138138
h.Check(expected, actual)
139139
})
@@ -148,7 +148,7 @@ func TestScaling(t *testing.T) {
148148
}
149149
h.TestUpDown(func() {
150150
time.Sleep(2 * time.Second) // Wait so the clients can register
151-
actual := h.getHttpBody(scaleEntrypoint)
151+
actual := h.getHTTPBody(scaleEntrypoint)
152152
responseArray := Response{}
153153
err := yaml.Unmarshal([]byte(actual), &responseArray)
154154
h.NilError(err)

tests_helper.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
const (
1919
commandsDir = "commands"
2020
baseSpecReference = "https://github.com/compose-spec/compose-spec/blob/master/spec.md"
21-
defaultHealthCheckUrl = "http://127.0.0.1:8080/ping"
21+
defaultHealthCheckURL = "http://127.0.0.1:8080/ping"
2222
)
2323

2424
type Config struct {
@@ -63,15 +63,15 @@ func (h TestHelper) TestUpDown(fun func()) {
6363
}
6464
}
6565
h.executeUp(c)
66-
h.waitHttpReady(defaultHealthCheckUrl, 5*time.Second)
66+
h.waitHTTPReady(defaultHealthCheckURL, 5*time.Second)
6767
fun()
6868
h.executeDown(c)
6969
h.checkCleanUp(c)
7070
})
7171
}
7272
}
7373

74-
func (h TestHelper) waitHttpReady(url string, timeout time.Duration) {
74+
func (h TestHelper) waitHTTPReady(url string, timeout time.Duration) {
7575
limit := time.Now().Add(timeout)
7676
for limit.After(time.Now()) {
7777
resp, err := http.Get(url)
@@ -188,7 +188,7 @@ func (h TestHelper) checkCleanUp(c *Config) {
188188
"There shouldn't be any containers before or after a test.")
189189
}
190190

191-
func (h TestHelper) getHttpBody(address string) string {
191+
func (h TestHelper) getHTTPBody(address string) string {
192192
resp, err := http.Get(address)
193193
h.NilError(err)
194194
defer resp.Body.Close()

0 commit comments

Comments
 (0)