Skip to content

fix: resolve CRAN test failures and improve API error handling#85

Open
kyleGrealis wants to merge 1 commit into
masterfrom
dev-20260219
Open

fix: resolve CRAN test failures and improve API error handling#85
kyleGrealis wants to merge 1 commit into
masterfrom
dev-20260219

Conversation

@kyleGrealis
Copy link
Copy Markdown
Collaborator

Fixes CRAN test failures on 8/14 platforms (Linux/Windows) by making import_instruments() tests resilient to external API unavailability.

Changes:

  • Add API availability check before running import_instruments() tests
  • Tests now skip gracefully when external REDCap API is inaccessible
  • Enhanced import_instruments() with clear error messages for API failures
  • Users now get actionable guidance when API calls fail (check URL, token, network)

Technical details:

  • Replaced unconditional test setup with conditional check (api_available)
  • Added skip_if() logic based on actual API accessibility
  • Improved error handling in R/import_instruments.R with rlang::abort()
  • No breaking changes to function behavior when API works correctly

Test results:

  • 44 tests pass
  • 1 test skips when API unavailable (expected)
  • 0 failures

This addresses the CRAN check failures while maintaining test coverage when the API is accessible and improving the user experience with better error diagnostics.

Fixes CRAN test failures on 8/14 platforms (Linux/Windows) by making
import_instruments() tests resilient to external API unavailability.

Changes:
- Add API availability check before running import_instruments() tests
- Tests now skip gracefully when external REDCap API is inaccessible
- Enhanced import_instruments() with clear error messages for API failures
- Users now get actionable guidance when API calls fail (check URL, token, network)

Technical details:
- Replaced unconditional test setup with conditional check (api_available)
- Added skip_if() logic based on actual API accessibility
- Improved error handling in R/import_instruments.R with rlang::abort()
- No breaking changes to function behavior when API works correctly

Test results:
- 44 tests pass
- 1 test skips when API unavailable (expected)
- 0 failures

This addresses the CRAN check failures while maintaining test coverage
when the API is accessible and improving the user experience with
better error diagnostics.
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.

1 participant