Skip to content

Instantly share code, notes, and snippets.

@cbascom
Created June 11, 2022 01:12
Show Gist options
  • Save cbascom/f868e34f11ae7406efb927fbd9c3e1ab to your computer and use it in GitHub Desktop.
Save cbascom/f868e34f11ae7406efb927fbd9c3e1ab to your computer and use it in GitHub Desktop.
http-helper test run
go test -v ./modules/http-helper λ:master [  ]
=== RUN TestRunDummyServer
=== PAUSE TestRunDummyServer
=== RUN TestContinuouslyCheck
=== PAUSE TestContinuouslyCheck
=== RUN TestHttpGet
=== PAUSE TestHttpGet
=== RUN TestTLSHttpGet
=== PAUSE TestTLSHttpGet
=== RUN TestOkBody
=== PAUSE TestOkBody
=== RUN TestTLSOkBody
=== PAUSE TestTLSOkBody
=== RUN TestHTTPDoWithValidation
=== PAUSE TestHTTPDoWithValidation
=== RUN TestHTTPDoWithCustomValidation
=== PAUSE TestHTTPDoWithCustomValidation
=== RUN TestOkHeaders
=== PAUSE TestOkHeaders
=== RUN TestWrongStatus
=== PAUSE TestWrongStatus
=== RUN TestRequestTimeout
=== PAUSE TestRequestTimeout
=== RUN TestOkWithRetry
=== PAUSE TestOkWithRetry
=== RUN TestErrorWithRetry
=== PAUSE TestErrorWithRetry
=== CONT TestRunDummyServer
=== CONT TestHTTPDoWithCustomValidation
=== CONT TestRequestTimeout
=== CONT TestOkWithRetry
=== CONT TestErrorWithRetry
TestHTTPDoWithCustomValidation 2022-06-10T21:05:29-04:00 http_helper.go:260: Making an HTTP POST call to URL http://127.0.0.1:59742
TestRunDummyServer 2022-06-10T21:05:29-04:00 dummy_server.go:37: Starting dummy HTTP server in port 8081 that will return the text 'dummy-server-3oNfGy'
=== CONT TestWrongStatus
TestOkWithRetry 2022-06-10T21:05:29-04:00 retry.go:91: HTTP POST to URL http://127.0.0.1:59743
TestOkWithRetry 2022-06-10T21:05:29-04:00 http_helper.go:260: Making an HTTP POST call to URL http://127.0.0.1:59743
TestErrorWithRetry 2022-06-10T21:05:29-04:00 retry.go:91: HTTP POST to URL http://127.0.0.1:59744
TestErrorWithRetry 2022-06-10T21:05:29-04:00 http_helper.go:260: Making an HTTP POST call to URL http://127.0.0.1:59744
TestRunDummyServer 2022-06-10T21:05:29-04:00 http_helper.go:59: Making an HTTP GET call to URL http://localhost:8081
=== CONT TestOkBody
TestWrongStatus 2022-06-10T21:05:29-04:00 http_helper.go:260: Making an HTTP POST call to URL http://127.0.0.1:59747
=== CONT TestHTTPDoWithValidation
TestOkBody 2022-06-10T21:05:29-04:00 http_helper.go:260: Making an HTTP POST call to URL http://127.0.0.1:59748
TestHTTPDoWithValidation 2022-06-10T21:05:29-04:00 http_helper.go:260: Making an HTTP POST call to URL http://127.0.0.1:59749
=== CONT TestTLSOkBody
TestRequestTimeout 2022-06-10T21:05:29-04:00 http_helper.go:260: Making an HTTP DELETE call to URL http://127.0.0.1:59750
=== CONT TestOkHeaders
TestOkHeaders 2022-06-10T21:05:29-04:00 http_helper.go:260: Making an HTTP POST call to URL http://127.0.0.1:59752
TestOkWithRetry 2022-06-10T21:05:29-04:00 http_helper.go:360: output:
TestTLSOkBody 2022-06-10T21:05:29-04:00 http_helper.go:260: Making an HTTP POST call to URL https://127.0.0.1:59751
TestErrorWithRetry 2022-06-10T21:05:29-04:00 http_helper.go:360: output:
TestErrorWithRetry 2022-06-10T21:05:29-04:00 retry.go:103: HTTP POST to URL http://127.0.0.1:59744 returned an error: Validation failed for URL http://127.0.0.1:59744. Response status: 503. Response body:
. Sleeping for 1s and will try again.
--- PASS: TestWrongStatus (0.00s)
TestOkWithRetry 2022-06-10T21:05:29-04:00 retry.go:103: HTTP POST to URL http://127.0.0.1:59743 returned an error: Validation failed for URL http://127.0.0.1:59743. Response status: 503. Response body:
. Sleeping for 1s and will try again.
=== CONT TestHttpGet
--- PASS: TestOkBody (0.00s)
--- PASS: TestOkHeaders (0.00s)
--- PASS: TestHTTPDoWithCustomValidation (0.00s)
--- PASS: TestHTTPDoWithValidation (0.00s)
=== CONT TestContinuouslyCheck
=== CONT TestTLSHttpGet
TestHttpGet 2022-06-10T21:05:29-04:00 http_helper.go:59: Making an HTTP GET call to URL http://127.0.0.1:59761
TestContinuouslyCheck 2022-06-10T21:05:29-04:00 dummy_server.go:37: Starting dummy HTTP server in port 8082 that will return the text 'dummy-server-Hq8CBj'
TestTLSHttpGet 2022-06-10T21:05:29-04:00 http_helper.go:59: Making an HTTP GET call to URL https://127.0.0.1:59763
--- PASS: TestHttpGet (0.00s)
--- PASS: TestRunDummyServer (0.01s)
--- PASS: TestTLSHttpGet (0.00s)
--- PASS: TestTLSOkBody (0.01s)
TestErrorWithRetry 2022-06-10T21:05:30-04:00 retry.go:91: HTTP POST to URL http://127.0.0.1:59744
TestErrorWithRetry 2022-06-10T21:05:30-04:00 http_helper.go:260: Making an HTTP POST call to URL http://127.0.0.1:59744
TestContinuouslyCheck 2022-06-10T21:05:30-04:00 http_helper.go:59: Making an HTTP GET call to URL http://localhost:8082
TestOkWithRetry 2022-06-10T21:05:30-04:00 retry.go:91: HTTP POST to URL http://127.0.0.1:59743
TestOkWithRetry 2022-06-10T21:05:30-04:00 http_helper.go:260: Making an HTTP POST call to URL http://127.0.0.1:59743
TestErrorWithRetry 2022-06-10T21:05:30-04:00 http_helper.go:360: output:
TestErrorWithRetry 2022-06-10T21:05:30-04:00 retry.go:103: HTTP POST to URL http://127.0.0.1:59744 returned an error: Validation failed for URL http://127.0.0.1:59744. Response status: 503. Response body:
. Sleeping for 1s and will try again.
TestOkWithRetry 2022-06-10T21:05:30-04:00 http_helper.go:360: output:
TestOkWithRetry 2022-06-10T21:05:30-04:00 retry.go:103: HTTP POST to URL http://127.0.0.1:59743 returned an error: Validation failed for URL http://127.0.0.1:59743. Response status: 503. Response body:
. Sleeping for 1s and will try again.
TestContinuouslyCheck 2022-06-10T21:05:30-04:00 continuous.go:47: Got response 200 and err <nil> from URL at http://localhost:8082
TestErrorWithRetry 2022-06-10T21:05:31-04:00 retry.go:91: HTTP POST to URL http://127.0.0.1:59744
TestErrorWithRetry 2022-06-10T21:05:31-04:00 http_helper.go:260: Making an HTTP POST call to URL http://127.0.0.1:59744
TestOkWithRetry 2022-06-10T21:05:31-04:00 retry.go:91: HTTP POST to URL http://127.0.0.1:59743
TestOkWithRetry 2022-06-10T21:05:31-04:00 http_helper.go:260: Making an HTTP POST call to URL http://127.0.0.1:59743
TestErrorWithRetry 2022-06-10T21:05:31-04:00 http_helper.go:360: output:
TestErrorWithRetry 2022-06-10T21:05:31-04:00 retry.go:103: HTTP POST to URL http://127.0.0.1:59744 returned an error: Validation failed for URL http://127.0.0.1:59744. Response status: 503. Response body:
. Sleeping for 1s and will try again.
TestOkWithRetry 2022-06-10T21:05:31-04:00 http_helper.go:360: output:
TestOkWithRetry 2022-06-10T21:05:31-04:00 retry.go:103: HTTP POST to URL http://127.0.0.1:59743 returned an error: Validation failed for URL http://127.0.0.1:59743. Response status: 503. Response body:
. Sleeping for 1s and will try again.
TestContinuouslyCheck 2022-06-10T21:05:31-04:00 http_helper.go:59: Making an HTTP GET call to URL http://localhost:8082
TestContinuouslyCheck 2022-06-10T21:05:31-04:00 continuous.go:47: Got response 200 and err <nil> from URL at http://localhost:8082
TestOkWithRetry 2022-06-10T21:05:32-04:00 retry.go:91: HTTP POST to URL http://127.0.0.1:59743
TestOkWithRetry 2022-06-10T21:05:32-04:00 http_helper.go:260: Making an HTTP POST call to URL http://127.0.0.1:59743
--- PASS: TestErrorWithRetry (3.01s)
TestOkWithRetry 2022-06-10T21:05:32-04:00 http_helper.go:360: output: TEST_CONTENT
--- PASS: TestOkWithRetry (3.01s)
TestContinuouslyCheck 2022-06-10T21:05:32-04:00 http_helper.go:59: Making an HTTP GET call to URL http://localhost:8082
TestContinuouslyCheck 2022-06-10T21:05:32-04:00 continuous.go:47: Got response 200 and err <nil> from URL at http://localhost:8082
TestContinuouslyCheck 2022-06-10T21:05:33-04:00 http_helper.go:59: Making an HTTP GET call to URL http://localhost:8082
TestContinuouslyCheck 2022-06-10T21:05:33-04:00 continuous.go:47: Got response 200 and err <nil> from URL at http://localhost:8082
TestContinuouslyCheck 2022-06-10T21:05:34-04:00 continuous.go:36: Got signal to stop downtime checks for URL http://localhost:8082.
--- PASS: TestContinuouslyCheck (5.00s)
2022/06/10 21:05:44 httptest.Server blocked in Close after 5 seconds, waiting for connections:
*net.TCPConn 0x1400033a020 127.0.0.1:59758 in state active
--- PASS: TestRequestTimeout (15.01s)
PASS
ok github.com/gruntwork-io/terratest/modules/http-helper 16.146s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment