Repository navigation
TPT-4472: Create tests for stream commands - #901
psnoch-akamai wants to merge 5 commits into
Conversation
ef2bcee to
46eb9cb
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Negative tests assume ID 1 is invalid and can delete unrelated destinations or create unmanaged streams, while fixture defects cause setup failures and incomplete cleanup.
5 open issues
Avoid hard-coded destination IDs in negative tests · New Use the CLI to list buckets instead of building a URL from token · New Create and clean up a temporary bucket in the test fixture · New Propagate destination-view errors other than confirmed 404s · New Match the HTTP 404 marker when retrying stream errors · New
What changed in this PR
Adds integration coverage for the CLI’s stream and destination commands, including error handling and resource lifecycle checks.
Changes:
- Adds help, listing, and negative-command tests, with smoke coverage for listings.
- Exercises destination creation, viewing, history, and deletion, plus an opt-in long-running stream test.
- Adds resource fixtures, status polling, and shared command registration.
| File | Description |
|---|---|
tests/integration/streams/test_streams.py |
Tests stream help, listing, errors, creation, and viewing. |
tests/integration/streams/test_destination.py |
Tests destination listing, errors, lifecycle, and history. |
tests/integration/streams/fixtures.py |
Provides storage-key, destination, and stream fixtures with cleanup and polling. |
tests/integration/helpers.py |
Registers streams in the shared command map. |
Review effort: Balanced
| @pytest.fixture | ||
| def create_object_storage_keys(): | ||
| label = get_random_text(8) + "_destination_cli_test" | ||
| test_bucket = get_object_storage_buckets()["data"][0] |
There was a problem hiding this comment.
46eb9cb to
ef70629
Compare
| "--details.access_key_secret", | ||
| create_object_storage_keys[1], |
There was a problem hiding this comment.
…est_create_view_stream
ef70629 to
3202789
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
The new integration fixtures fail during setup when optional API overrides are absent or the account has no existing Object Storage buckets, preventing the destination and stream success tests from exercising the commands.
3 open issues
Review effort: Balanced
| @pytest.fixture | ||
| def create_object_storage_keys(): | ||
| label = get_random_text(8) + "_destination_cli_test" | ||
| if get_object_storage_buckets()["data"][0] is None: |
There was a problem hiding this comment.
It will fail if there is no buckets at all (then data=[] leads to 'list index out of range' error). Moreover, wouldnt be better to create a bucket instead of checking if there is any already? It would let you run the tests no matter if it exists or not
There was a problem hiding this comment.
🟡 Changes recommended
The undefined wait_for_stream_status import causes pytest collection to fail, preventing all tests in the streams module from running.
5 open issues
Remove undefined fixture import that breaks test collection · New Attempt stream cleanup even when status polling times out · New Redact credentials from command failure output Create and clean up a temporary bucket in the test fixture Use the CLI to list buckets instead of building a URL from token
Review effort: Balanced
| create_object_storage_keys, | ||
| create_stream, | ||
| is_expected_stream_status, | ||
| wait_for_stream_status, |
| ) | ||
| result_create_json = json.loads(result_create)[0] | ||
| yield result_create_json | ||
| wait_for_condition( |


📝 Description
Create tests for stream commands
✔️ How to Test