Skip to content

Commit

Permalink
Tuning's matching tests gather all mismatches before failing out
Browse files Browse the repository at this point in the history
[#147896081]

- Originally, we would fail out of the test on the first mismatch, which
is a bit slow for iteration

Signed-off-by: Sam Serrano <[email protected]>
  • Loading branch information
Alex Stupakov authored and utricularian committed Jul 25, 2017
1 parent 66653e7 commit ff83ea1
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions cf-mysql-service/tuning/tuning_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"encoding/json"
"fmt"
"io/ioutil"
"strings"

"github.com/cloudfoundry-incubator/cf-mysql-acceptance-tests/helpers"
_ "github.com/go-sql-driver/mysql"
Expand Down Expand Up @@ -64,8 +65,16 @@ var _ = Describe("MySQL Server Tuning Configuration", func() {
Expect(err).ToNot(HaveOccurred())
}

for k, v := range compareConfig {
Expect(mysqlVariables[k]).To(Equal(v), fmt.Sprintf("mismatch in %v", k))
var mismatchErrors []string

for k := range compareConfig {
if mysqlVariables[k] != compareConfig[k] {
mismatchErrors = append(mismatchErrors, fmt.Sprintf("%s: \n\t(Expected):\t%s \n\t(Actual):\t%s",
k, compareConfig[k], mysqlVariables[k]))

}
}

Expect(len(mismatchErrors)).To(Equal(0), strings.Join(mismatchErrors, "\n"))
})
})

0 comments on commit ff83ea1

Please sign in to comment.