Skip to content

test: expand unit and integration test coverage#85

Merged
designcode merged 2 commits intomainfrom
chore/update-tests
Apr 10, 2026
Merged

test: expand unit and integration test coverage#85
designcode merged 2 commits intomainfrom
chore/update-tests

Conversation

@designcode
Copy link
Copy Markdown
Collaborator

@designcode designcode commented Apr 10, 2026

Summary

  • Add 6 new unit test files covering previously untested utilities and auth modules
  • Add access-keys lifecycle integration tests (create → assign → rotate → delete)
  • Add OAuth-guarded integration test block for IAM policies, users, and organizations
  • Fix bundle compression auto-detection (remove default: none from specs)
  • Test count: 575 → 643 (+68 tests)

New unit tests

File Covers
test/utils/upload.test.ts calculateUploadParams boundary cases
test/utils/concurrency.test.ts Pool limiting, ordering, error propagation
test/utils/bucket-info.test.ts All conditional branches (TTL, lifecycle, CORS, etc.)
test/utils/interactive.test.ts TTY detection guard
test/auth/fly.test.ts Fly org prefix detection
test/auth/iam.test.ts OAuth and credential config resolution

New integration tests

  • Access-keys: create, get, list, assign (bucket + admin), revoke, rotate, delete
  • Access-keys error cases: missing args, missing confirmation
  • Whoami: text and JSON output
  • OAuth block (skipped unless TIGRIS_OAUTH_TEST=true): IAM policies lifecycle, users list, orgs list

Test plan

  • npm test — 643 unit tests pass
  • npm run test:integration — all integration tests pass
  • npm run lint:fix — no errors

🤖 Generated with Claude Code


Note

Low Risk
Primarily adds tests and gating for OAuth-only integration coverage; the only behavior-adjacent change is a spec/default tweak for bundle --compression, which is low risk but could affect CLI defaults if the spec is used for argument parsing.

Overview
Expands test coverage across auth, utilities, and CLI workflows. Adds new unit tests for isFlyOrganization, getOAuthIAMConfig/getIAMConfig, and several utility helpers (bucket info formatting, concurrency limiting, interactive/TTY guard, and multipart upload parameter calculation).

Broadens integration coverage for operational commands. Extends cli.test.ts with end-to-end lifecycle tests for access-keys (create/assign/rotate/delete), adds whoami assertions, and introduces an OAuth-gated integration block (enabled via TIGRIS_OAUTH_TEST=true) to exercise IAM policy/user/org listing flows.

CLI spec tweak. Updates bundle’s --compression option description to indicate auto-detection from output extension and removes the explicit default.

Reviewed by Cursor Bugbot for commit 1e40560. Bugbot is set up for automated code reviews on this repo. Configure here.

designcode and others added 2 commits April 10, 2026 12:01
The specs.yaml default: none caused Commander to always set compressionArg,
preventing auto-detection from output file extension (.tar.gz → gzip).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Unit tests for previously untested utilities and auth modules:
- upload.ts: calculateUploadParams boundary cases
- concurrency.ts: pool limiting, ordering, error propagation
- bucket-info.ts: all conditional branches (TTL, lifecycle, CORS, etc.)
- interactive.ts: TTY detection guard
- auth/fly.ts: Fly org prefix detection
- auth/iam.ts: OAuth and credential config resolution branches

Integration tests for access-keys lifecycle:
- create, get, list, assign (bucket + admin), revoke, rotate, delete
- Error cases for missing args and confirmation prompts

Also adds OAuth-guarded test block for IAM policies, users, and orgs
(skipped unless TIGRIS_OAUTH_TEST=true), and whoami command tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@designcode designcode merged commit c6ed6db into main Apr 10, 2026
5 checks passed
@designcode designcode deleted the chore/update-tests branch April 10, 2026 12:02
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 2.18.0-beta.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants