@@ -1250,11 +1250,22 @@ withenv(
1250
1250
@test isdir (dirname (test_file))
1251
1251
end
1252
1252
1253
- # Test error handling function
1254
- @test Coverage. CoverageUtils. handle_upload_error (ErrorException (" 404 Not Found" ), " TestService" ) == false
1255
- @test Coverage. CoverageUtils. handle_upload_error (ErrorException (" 401 Unauthorized" ), " TestService" ) == false
1256
- @test Coverage. CoverageUtils. handle_upload_error (ErrorException (" Connection timeout" ), " TestService" ) == false
1257
- @test Coverage. CoverageUtils. handle_upload_error (ErrorException (" Generic error" ), " TestService" ) == false
1253
+ # Test error handling function with proper log testing
1254
+ @test_logs (:error , r" Failed to upload to TestService" ) (:warn , r" Check if the repository is registered with TestService" ) begin
1255
+ @test Coverage. CoverageUtils. handle_upload_error (ErrorException (" 404 Not Found" ), " TestService" ) == false
1256
+ end
1257
+
1258
+ @test_logs (:error , r" Failed to upload to TestService" ) (:warn , r" Authentication failed. Check your TestService token" ) begin
1259
+ @test Coverage. CoverageUtils. handle_upload_error (ErrorException (" 401 Unauthorized" ), " TestService" ) == false
1260
+ end
1261
+
1262
+ @test_logs (:error , r" Failed to upload to TestService" ) (:warn , r" Connection timeout. Check your network connection" ) begin
1263
+ @test Coverage. CoverageUtils. handle_upload_error (ErrorException (" Connection timeout" ), " TestService" ) == false
1264
+ end
1265
+
1266
+ @test_logs (:error , r" Failed to upload to TestService" ) begin
1267
+ @test Coverage. CoverageUtils. handle_upload_error (ErrorException (" Generic error" ), " TestService" ) == false
1268
+ end
1258
1269
end
1259
1270
1260
1271
end # of withenv( => nothing)
0 commit comments