Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
cwaldren-ld committed May 8, 2024
1 parent cb4f3a4 commit 63597b8
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 18 deletions.
1 change: 1 addition & 0 deletions framework/harness/harness.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ type TestHarness struct {
https bool
}

// SetHTTPS tells the test harness to generate HTTPS endpoints when NewMockEndpoint is called.
func (h *TestHarness) SetHTTPS(https bool) {
h.https = https
}
Expand Down
2 changes: 1 addition & 1 deletion framework/harness/mock_endpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ func (m *mockEndpointsManager) serveHTTP(w http.ResponseWriter, r *http.Request)
e.lock.Unlock()
}

// BaseURL returns the base path of the mock endpoint using http transport and port.
// BaseURL returns the base path of the mock endpoint.
func (e *MockEndpoint) BaseURL() string {
return e.owner.externalBaseURL + e.basePath
}
Expand Down
5 changes: 0 additions & 5 deletions framework/ldtest/test_scope.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,6 @@ type TestConfiguration struct {
Capabilities []string
}

func (t TestConfiguration) WithContext(context interface{}) TestConfiguration {
t.Context = context
return t
}

// Run starts a top-level test scope.
func Run(
config TestConfiguration,
Expand Down
8 changes: 0 additions & 8 deletions framework/opt/maybe.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,6 @@ func (m Maybe[V]) AsPtr() *V {
return nil
}

// Map transforms the value using the given function if it exists, or returns None if it doesn't.
func (m Maybe[V]) Map(f func(V) V) Maybe[V] {
if m.defined {
return Some(f(m.value))
}
return None[V]()
}

// OrElse returns the value of the Maybe if any, or the valueIfUndefined otherwise.
func (m Maybe[V]) OrElse(valueIfUndefined V) V {
if m.defined {
Expand Down
3 changes: 2 additions & 1 deletion params.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ func (c *commandParams) Read(args []string) bool {
fs := flag.NewFlagSet("", flag.ExitOnError)
fs.StringVar(&c.serviceURL, "url", "", "test service URL")
fs.StringVar(&c.host, "host", "localhost", "external hostname of the test harness")
fs.IntVar(&c.port, "port", defaultPort, "http port that the test harness will listen on")
fs.IntVar(&c.port, "port", defaultPort, "http port that the test harness will listen on"+
" (if TLS capability enabled in an SDK, then port+1 will be used for HTTPS)")
fs.Var(&c.filters.MustMatch, "run", "regex pattern(s) to select tests to run")
fs.Var(&c.filters.MustNotMatch, "skip", "regex pattern(s) to select tests not to run")
fs.BoolVar(&c.stopServiceAtEnd, "stop-service-at-end", false, "tell test service to exit after the test run")
Expand Down
3 changes: 2 additions & 1 deletion sdktests/common_tests_poll_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ func (c CommonPollingTests) RequestMethodAndHeaders(t *ldtest.T, credential stri
m.In(t).For("request method").Assert(request.Method, m.Equal(string(method)))
m.In(t).For("request headers").Assert(request.Headers, c.authorizationHeaderMatcher(credential))
if t.Capabilities().Has(servicedef.CapabilityPollingGzip) {
m.In(t).For("request headers").Assert(request.Headers, Header("Accept-Encoding").Should(m.StringContains("gzip")))
m.In(t).For("request headers").Assert(request.Headers,
Header("Accept-Encoding").Should(m.StringContains("gzip")))
}
})
}
Expand Down
3 changes: 1 addition & 2 deletions servicedef/sdk_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ type SDKConfigParams struct {
}

type SDKConfigTLSParams struct {
VerifyPeer bool `json:"verifyPeer,omitempty"`
CertificateAuthorityPath string `json:"certificateAuthorityPath,omitempty"`
VerifyPeer bool `json:"verifyPeer,omitempty"`
}
type SDKConfigServiceEndpointsParams struct {
Streaming string `json:"streaming,omitempty"`
Expand Down

0 comments on commit 63597b8

Please sign in to comment.