Skip to content

refactor: move ablytest under internal/ to make it unimportable externally - #707

Merged
SimonWoolf merged 1 commit into
mainfrom
refactor/ablytest-internal
Jul 7, 2026
Merged

refactor: move ablytest under internal/ to make it unimportable externally#707
SimonWoolf merged 1 commit into
mainfrom
refactor/ablytest-internal

Conversation

@SimonWoolf

@SimonWoolf SimonWoolf commented Jul 7, 2026

Copy link
Copy Markdown
Member

The ablytest package is test scaffolding for ably-go's own suite — in particular its sandbox helpers (NewSandbox etc.) provision test apps against the Ably backend, which is meant for developing and contributing to the SDK, not as an API for consumers of the package.

Moving it to internal/ablytest makes Go's toolchain reject any import from outside this module.

This is not a security boundary (the code can obviously be copied for a start), but rather an unambiguous request. We don't want to actually put any security barries in place, because we want SDK development to be open to all, and there's no way to verify whether a given test app will be used for SDK development or not. But at least we can make it unambiguous and avoid any unintentional reliance

Summary by CodeRabbit

  • Bug Fixes
    • Updated test support references to use the internal helper package path across the codebase, keeping test execution aligned with the current project layout.
    • Fixed a resource lookup path used by test setup so required test data is found consistently.
  • Documentation
    • Added clearer guidance for the internal test helper package so its intended scope is easier to understand.

@SimonWoolf
SimonWoolf requested a review from lmars July 7, 2026 15:46
@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7642fe89-5369-40ac-8b9b-72dc1c20e815

📥 Commits

Reviewing files that changed from the base of the PR and between aab2209 and affba27.

📒 Files selected for processing (34)
  • ably/ably_test.go
  • ably/auth_integration_test.go
  • ably/event_emitter_integration_test.go
  • ably/event_emitter_spec_integration_test.go
  • ably/http_paginated_response_integration_test.go
  • ably/main_integration_test.go
  • ably/message_updates_integration_test.go
  • ably/proto_message_integration_test.go
  • ably/proto_presence_message_test.go
  • ably/realtime_channel_delta_integration_test.go
  • ably/realtime_channel_integration_test.go
  • ably/realtime_channel_spec_integration_test.go
  • ably/realtime_client_integration_test.go
  • ably/realtime_conn_integration_test.go
  • ably/realtime_conn_spec_integration_test.go
  • ably/realtime_presence_integration_test.go
  • ably/rest_channel_integration_test.go
  • ably/rest_channel_spec_integration_test.go
  • ably/rest_client_integration_test.go
  • ably/rest_presence_spec_integration_test.go
  • ably/transitioner_integration_test.go
  • internal/ablytest/ablytest.go
  • internal/ablytest/cryptodata.go
  • internal/ablytest/fmt.go
  • internal/ablytest/fmt_test.go
  • internal/ablytest/logger.go
  • internal/ablytest/msgpack.go
  • internal/ablytest/pagination.go
  • internal/ablytest/proxies.go
  • internal/ablytest/recorders.go
  • internal/ablytest/resultgroup.go
  • internal/ablytest/sandbox.go
  • internal/ablytest/test_utils.go
  • internal/ablytest/timeout.go

Walkthrough

The ablytest helper package moves from github.com/ably/ably-go/ablytest (and one instance of ably/internal/ablytest) to github.com/ably/ably-go/internal/ablytest. All test files referencing it are updated accordingly, a package doc comment is added to internal/ablytest/ablytest.go, and sandbox.go's relative path for locating test-app-setup.json is corrected.

Changes

ablytest Package Relocation

Layer / File(s) Summary
Internal package documentation and path fix
internal/ablytest/ablytest.go, internal/ablytest/sandbox.go, internal/ablytest/fmt_test.go
Adds a package doc comment describing scope of internal test helpers, fixes the relative path used to load test-app-setup.json (adds an extra .. level), and updates fmt_test.go's own import to the internal path.
ably package test import updates
ably/ably_test.go, ably/auth_integration_test.go, ably/event_emitter_integration_test.go, ably/event_emitter_spec_integration_test.go, ably/http_paginated_response_integration_test.go, ably/main_integration_test.go, ably/message_updates_integration_test.go, ably/proto_message_integration_test.go, ably/proto_presence_message_test.go, ably/realtime_channel_*integration_test.go, ably/realtime_client_integration_test.go, ably/realtime_conn_*integration_test.go, ably/realtime_presence_integration_test.go, ably/rest_channel_*integration_test.go, ably/rest_client_integration_test.go, ably/rest_presence_spec_integration_test.go, ably/transitioner_integration_test.go
All 21 test files update their ablytest import statement to reference github.com/ably/ably-go/internal/ablytest instead of the previous package path; no test logic changes.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Poem

A hop, a skip, a package moves in,
from ablytest's old home to internal's den.
Twenty-one imports, updated with care,
and one sneaky path fix hidden in there.
🐇 Test suite still green, nothing's amiss —
just tidier burrows for code like this!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: moving ablytest under internal/ to prevent external imports.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/ablytest-internal

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…nally

The ablytest package is test scaffolding for ably-go's own suite — in
particular its sandbox helpers (NewSandbox etc.) provision test apps against
the Ably backend, which is meant for developing and contributing to the SDK,
not as an API for consumers of the package.

Moving it to internal/ablytest makes Go's toolchain reject any import from
outside this module.

This is not a security boundary (the code can obviously be copied for a
start), but rather an unambiguous request. We don't want to actually
put any security barries in place, because we want SDK development to be
open to all, and there's no way to verify whether a given test app will
be used for SDK development or not. But at least we can make it
unambiguous and avoid any unintentional reliance

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@SimonWoolf
SimonWoolf merged commit a023b51 into main Jul 7, 2026
8 checks passed
@SimonWoolf
SimonWoolf deleted the refactor/ablytest-internal branch July 7, 2026 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants