mirror of
https://github.com/fleetdm/fleet
synced 2026-05-24 09:28:54 +00:00
fix mysql tests by with a regexp assertion of possible error messages (#5444)
this fixes #5377 by asserting that the error message starts with "tsl" or "x509" as either of the strings represent the same error depending on the mysql version. we should refactor the code to avoid checking on the error messages and probably use different error types instead.
This commit is contained in:
parent
26abd032db
commit
2c23cb5f24
1 changed files with 3 additions and 1 deletions
|
|
@ -778,7 +778,9 @@ func TestNewUsesRegisterTLS(t *testing.T) {
|
|||
// This fails because the certificate mysql is using is different than the one generated here
|
||||
_, err := newDSWithConfig(t, dbName, mysqlConfig)
|
||||
require.Error(t, err)
|
||||
require.Equal(t, "x509: certificate is not valid for any names, but wanted to match localhost", err.Error())
|
||||
// TODO: we're using a Regexp because the message is different depending on the version of mysql,
|
||||
// we should refactor and use different error types instead.
|
||||
require.Regexp(t, "^(x509|tls)", err.Error())
|
||||
}
|
||||
|
||||
func TestWhereFilterTeams(t *testing.T) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue