-
Notifications
You must be signed in to change notification settings - Fork 2.3k
fix missing skip test when there is no DB available #1594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThe recent changes introduce a conditional check in the Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Outside diff range and nitpick comments (16)
driver_test.go (16)
Line range hint
2380-2382
: Undefined references to internal types and variables.Please ensure that all referenced types such as
mysqlConn
,mysqlStmt
,binaryRows
, andtextRows
are defined and imported correctly in your project.Also applies to: 2389-2390, 2397-2400
Line range hint
3311-3311
: Undefined reference toMySQLDriver
.Ensure that the
MySQLDriver
type is correctly defined and accessible within the scope of this file.Also applies to: 1507-1507
Line range hint
3342-3342
: Undefined reference toConfig
.Ensure that the
Config
type from the MySQL driver package is correctly imported and accessible in this file.
Line range hint
43-43
: Undefined reference todriverName
.Ensure that
driverName
is defined and correctly set to the MySQL driver's name in your project.
Line range hint
126-126
: Undefined functionParseDSN
.Ensure that the
ParseDSN
function is defined and correctly imported from the MySQL driver package.Also applies to: 160-160, 222-222
Line range hint
270-270
: Undefined typeMySQLError
.Ensure that the
MySQLError
type is defined and correctly imported from the MySQL driver package to handle MySQL-specific errors.Also applies to: 2996-2996, 3005-3005
Line range hint
1361-1361
: Undefined functionsRegisterLocalFile
andRegisterReaderHandler
.Ensure that these functions are defined and correctly imported from the MySQL driver package to handle file-based operations.
Also applies to: 1392-1392
Line range hint
1462-1462
: Undefined errorErrNoTLS
.Ensure that the
ErrNoTLS
error is defined and correctly imported from the MySQL driver package to handle TLS-related errors.
Line range hint
1495-1495
: Undefined functionRegisterTLSConfig
.Ensure that the
RegisterTLSConfig
function is defined and correctly imported from the MySQL driver package to handle TLS configurations.
Line range hint
1649-1649
: Undefined variabledefaultBufSize
.Ensure that
defaultBufSize
is defined and correctly set to manage buffer sizes in your project.
Line range hint
1918-1918
: Undefined functionreadBool
.Ensure that the
readBool
function is defined and correctly imported to handle boolean reading operations.
Line range hint
1994-1994
: Undefined functions related to connection handling.Ensure that functions like
RegisterDialContext
,BeforeConnect
, andNewConnector
are defined and correctly imported from the MySQL driver package to handle connection setups.Also applies to: 2032-2032, 2059-2059, 2064-2064
Line range hint
2144-2144
: Undefined variables and functions related to logging.Ensure that variables like
defaultLogger
and functions likeSetLogger
are defined and correctly imported from the MySQL driver package to handle logging operations.Also applies to: 2149-2149, 2152-2152
Line range hint
2238-2238
: Undefined typesmysqlRows
andmysqlField
.Ensure that types like
mysqlRows
andmysqlField
are defined and correctly imported from the MySQL driver package to handle row and field operations.Also applies to: 2240-2240
Line range hint
2591-2591
: Undefined typeResult
.Ensure that the
Result
type is defined and correctly imported from the MySQL driver package to handle SQL operation results.
Line range hint
3064-3078
: Undefined variables related to scan types.Ensure that variables like
scanTypeBytes
,scanTypeNullInt
,scanTypeInt8
, etc., are defined and correctly set to manage data scanning operations in your project.
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- driver_test.go (1 hunks)
Additional context used
golangci-lint
driver_test.go
49-49: undefined: binaryRows (typecheck)
50-50: undefined: textRows (typecheck)
2380-2380: undefined: mysqlConn (typecheck)
2381-2381: undefined: mysqlConn (typecheck)
2382-2382: undefined: mysqlConn (typecheck)
2389-2389: undefined: mysqlStmt (typecheck)
2390-2390: undefined: mysqlStmt (typecheck)
2397-2397: undefined: binaryRows (typecheck)
2398-2398: undefined: textRows (typecheck)
2399-2399: undefined: binaryRows (typecheck)
2400-2400: undefined: textRows (typecheck)
3311-3311: undefined: MySQLDriver (typecheck)
3342-3342: undefined: Config (typecheck)
43-43: undefined: driverName (typecheck)
126-126: undefined: ParseDSN (typecheck)
160-160: undefined: ParseDSN (typecheck)
222-222: undefined: ParseDSN (typecheck)
270-270: undefined: MySQLError (typecheck)
1361-1361: undefined: RegisterLocalFile (typecheck)
1392-1392: undefined: RegisterReaderHandler (typecheck)
1462-1462: undefined: ErrNoTLS (typecheck)
1495-1495: undefined: RegisterTLSConfig (typecheck)
1507-1507: undefined: MySQLDriver (typecheck)
1649-1649: undefined: defaultBufSize (typecheck)
1918-1918: undefined: readBool (typecheck)
1994-1994: undefined: RegisterDialContext (typecheck)
2032-2032: undefined: RegisterDialContext (typecheck)
2059-2059: undefined: BeforeConnect (typecheck)
2064-2064: undefined: NewConnector (typecheck)
2144-2144: undefined: defaultLogger (typecheck)
2149-2149: undefined: SetLogger (typecheck)
2152-2152: undefined: SetLogger (typecheck)
2238-2238: undefined: mysqlRows (typecheck)
2239-2239: undefined: resultSet (typecheck)
2240-2240: undefined: mysqlField (typecheck)
2591-2591: undefined: Result (typecheck)
2996-2996: undefined: MySQLError (typecheck)
3005-3005: undefined: MySQLError (typecheck)
3064-3064: undefined: scanTypeBytes (typecheck)
3065-3065: undefined: scanTypeNullInt (typecheck)
3066-3066: undefined: scanTypeInt8 (typecheck)
3067-3067: undefined: scanTypeNullInt (typecheck)
3068-3068: undefined: scanTypeInt16 (typecheck)
3069-3069: undefined: scanTypeNullInt (typecheck)
3071-3071: undefined: scanTypeInt32 (typecheck)
3073-3073: undefined: scanTypeInt64 (typecheck)
3075-3075: undefined: scanTypeUint8 (typecheck)
3076-3076: undefined: scanTypeUint16 (typecheck)
3077-3077: undefined: scanTypeUint64 (typecheck)
3078-3078: undefined: scanTypeUint32 (typecheck)
@@ -3539,6 +3539,9 @@ func TestConnectionAttributes(t *testing.T) { | |||
} | |||
|
|||
func TestErrorInMultiResult(t *testing.T) { | |||
if !available { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure proper handling of unavailable MySQL server.
- if !available {
+ if !isMySQLServerAvailable() {
Committable suggestion was skipped due to low confidence.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Fix `go test` fails when no DB is set up. (cherry picked from commit 9b8d28e)
Description
Fix
go test
fails when no DB is set up.Needs backport to 1.8
Checklist
Summary by CodeRabbit