Skip to content

Commit 79f05e0

Browse files
capture some test logs
1 parent 0e2090e commit 79f05e0

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

test/runtests.jl

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1250,11 +1250,22 @@ withenv(
12501250
@test isdir(dirname(test_file))
12511251
end
12521252

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
12581269
end
12591270

12601271
end # of withenv( => nothing)

0 commit comments

Comments
 (0)