Skip to content

Commit

Permalink
refactor: remove debug config
Browse files Browse the repository at this point in the history
  • Loading branch information
niklastreml committed Oct 25, 2023
1 parent 7d159fb commit 7e02096
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 17 deletions.
2 changes: 0 additions & 2 deletions cmd/run/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@ import (
"context"
"log"

"github.com/caas-team/sparrow/pkg/checks"
"github.com/caas-team/sparrow/pkg/sparrow"
)

func main() {

config := sparrow.NewConfig()
config.Checks["rtt"] = checks.RoundTripConfig{}
sparrow := sparrow.New(config)

log.Println("running sparrow")
Expand Down
6 changes: 0 additions & 6 deletions pkg/checks/roundtrip.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,3 @@ func (rt *RoundTrip) Schema() (*openapi3.SchemaRef, error) {
return OpenapiFromPerfData[roundTripData](roundTripData{})

}

func NewRoundtrip() *RoundTrip {
return &RoundTrip{
name: "rtt",
}
}
8 changes: 0 additions & 8 deletions pkg/sparrow/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,6 @@ func New(config *Config) *Sparrow {
config: config,
c: make(chan checks.Result),
}
// TODO read this from config file
for k, _ := range config.Checks {
switch k {
case "roundtrip":
s.checks = append(s.checks, checks.NewRoundtrip())
}

}

return s
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/sparrow/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TestSparrow_getOpenapi(t *testing.T) {
}
tests := []test{
{name: "no checks registered", fields: fields{checks: []checks.Check{}, config: NewConfig()}, want: oapiBoilerplate, wantErr: false},
{name: "check registered", fields: fields{checks: []checks.Check{checks.NewRoundtrip()}, config: NewConfig()}, want: oapiBoilerplate, wantErr: false},
{name: "check registered", fields: fields{checks: []checks.Check{checks.GetRoundtripCheck("rtt")}, config: NewConfig()}, want: oapiBoilerplate, wantErr: false},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down

0 comments on commit 7e02096

Please sign in to comment.