Skip to content

test: add tests for HTTPError and PostgrestError types #737

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

grdsdev
Copy link
Collaborator

@grdsdev grdsdev commented Jun 30, 2025

Summary

This PR adds comprehensive test coverage for various components of the supabase-swift library:

Changes Made

  1. CI Workflow Improvements

    • Split combined linux_android job into separate linux and android jobs for better isolation
    • Uncommented library-evolution job that was previously commented out
    • Improved CI workflow organization and maintainability
  2. Test Coverage Enhancements

    • HTTPError Tests: Added comprehensive tests for HTTPError functionality
    • AnyJSON Tests: Added comprehensive and edge-case tests for AnyJSON handling
    • PostgrestError Tests: Added test to verify PostgrestError properly conforms to LocalizedError protocol

Benefits

  • Improved test coverage for error handling and data serialization
  • Better CI workflow organization with separate job isolation
  • Enhanced reliability through comprehensive edge-case testing
  • Better maintainability with well-structured test suites

Testing

All tests pass locally and in CI. The new tests cover:

  • Error message formatting and localization
  • JSON serialization edge cases
  • HTTP error handling scenarios
  • Protocol conformance validation

@coveralls
Copy link

coveralls commented Jun 30, 2025

Pull Request Test Coverage Report for Build 16154474100

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.8%) to 76.606%

Totals Coverage Status
Change from base Build 16143484888: 0.8%
Covered Lines: 5308
Relevant Lines: 6929

💛 - Coveralls

@grdsdev grdsdev force-pushed the guilherme/increase-code-coverage branch 2 times, most recently from a455d97 to 31df495 Compare July 7, 2025 14:37
@grdsdev grdsdev requested review from dshukertjr and o-santi July 8, 2025 20:10
@grdsdev grdsdev changed the title test(helpers): add comprehensive tests for HTTPError test(helpers): add tests for HTTPError and PostgrestError types Jul 8, 2025
@grdsdev grdsdev changed the title test(helpers): add tests for HTTPError and PostgrestError types test: add tests for HTTPError and PostgrestError types Jul 8, 2025
grdsdev added 7 commits July 8, 2025 17:11
Covers value accessors, literal initializers, error handling, extensions, and edge cases to ensure full correctness and robustness.
Add tests for the HTTPError type covering initialization, property access, and LocalizedError conformance for various data scenarios. Ensures robust error reporting and future-proofing for HTTP error handling.
- Split combined linux_android job into separate linux and android jobs for better isolation
- Uncomment library-evolution job that was previously commented out
- Improve CI workflow organization and maintainability
- Add test to verify PostgrestError properly conforms to LocalizedError protocol
- Test ensures errorDescription property returns the expected error message
- Improves test coverage for error handling functionality
- Remove Xcode 15.2 testing (keep only 15.4 for backward compatibility)
- Remove tvOS, visionOS, and watchOS platforms (less critical for backend SDK)
- Keep iOS, macOS, and macCatalyst for comprehensive coverage
- Maintain Linux and Android cross-platform testing
- Expected 50-60% reduction in CI time while maintaining good coverage

This optimization focuses on the most commonly used platforms while
significantly reducing CI resource usage and wait times.
@grdsdev grdsdev force-pushed the guilherme/increase-code-coverage branch from 3789e86 to 877ad46 Compare July 8, 2025 20:11
@grdsdev grdsdev enabled auto-merge (squash) July 8, 2025 21:12
copy-files: Tests
# tests are not yet passing on Android
run-tests: false
# android:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't really support android as a build target, and this check was added by an external contributor, I won't spent much time on trying to debug it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants