Skip to content

test(onedrive): skip integration suite when ONEDRIVE_ACCESS_TOKEN is missing - #801

Open
Rudra2637 wants to merge 1 commit into
corsairdev:mainfrom
Rudra2637:test/onedrive-skip-without-token
Open

test(onedrive): skip integration suite when ONEDRIVE_ACCESS_TOKEN is missing#801
Rudra2637 wants to merge 1 commit into
corsairdev:mainfrom
Rudra2637:test/onedrive-skip-without-token

Conversation

@Rudra2637

@Rudra2637 Rudra2637 commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes #722

packages/onedrive/integration.test.ts previously returned early inside each individual test case (if (!setup) return), causing Jest to report the suite as passed rather than skipped when ONEDRIVE_ACCESS_TOKEN was not set.

This PR updates packages/onedrive/integration.test.ts to follow the standard integration test pattern:

  • Checks configuredAccessToken and hasCredentials.
  • Uses describeIf (hasCredentials ? describe : describe.skip) to skip the suite when credentials are not configured.
  • Emits console.warn once if ONEDRIVE_ACCESS_TOKEN is missing.
  • Removes all 18 per-test if (!setup) return guards without altering assertions.

Checklist

  • I have run pnpm lint and all checks pass
  • I have run pnpm typecheck and there are no TypeScript errors
  • I have run pnpm build and all packages build successfully
  • I have run pnpm test and all tests pass
  • I have added or updated tests where applicable
  • I have added or updated necessary documentation

Screenshots / Demos (if applicable)

Screenshot 2026-08-16 165300

Summary by CodeRabbit

  • Tests
    • Improved OneDrive integration test reliability.
    • Test suites now handle unavailable credentials gracefully by skipping without producing misleading failures.
    • Credential values are normalized before validation, while existing API and database checks remain unchanged.

@vercel

vercel Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
www Skipped Skipped Aug 16, 2026 11:28am

Request Review

@github-actions github-actions Bot added the plugin Changes inside a plugin package label Aug 16, 2026
@coderabbitai

coderabbitai Bot commented Aug 16, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: fc30a6b7-2e94-429d-862f-da6236852ec9

📥 Commits

Reviewing files that changed from the base of the PR and between bd8f313 and 4adbf94.

📒 Files selected for processing (1)
  • packages/onedrive/integration.test.ts

Included review availability: Your plan includes up to 10 reviews per rolling hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

OneDrive integration tests now normalize credentials once, warn and skip the suite when the access token is missing, and remove per-test setup guards. Existing API, database, and operation-specific assertions remain unchanged.

Changes

OneDrive integration test execution

Layer / File(s) Summary
Credential detection and suite gating
packages/onedrive/integration.test.ts
The module trims the access token, warns when it is unavailable, conditionally skips the suite, and creates clients with the validated token.
Non-null integration test setup
packages/onedrive/integration.test.ts
Tests and setup hooks no longer return early for missing client setup.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 4adbf

This localized test-only change makes the OneDrive integration suite skip when credentials are unavailable, with no actionable merge-blocking risk remaining after normal checks and review.

Possibly related issues

  • corsairdev/corsair issue 724: Defines the same suite-level skip behavior for missing integration credentials and removal of per-test early returns.

Possibly related PRs

Suggested reviewers: devjain32

🚥 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: skipping the OneDrive integration suite when ONEDRIVE_ACCESS_TOKEN is missing.
Linked Issues check ✅ Passed The changes warn once, skip the suite without credentials, remove per-test guards, and preserve test execution with a configured token.
Out of Scope Changes check ✅ Passed All changes support the linked issue by centralizing credential handling and preserving the existing integration assertions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@greptile-apps

greptile-apps Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR changes the OneDrive integration suite to report a skipped suite when its access token is unavailable instead of silently passing individual tests.

  • Trims and snapshots ONEDRIVE_ACCESS_TOKEN during module initialization.
  • Selects describe or describe.skip once for the complete integration suite.
  • Removes redundant per-test null guards and emits one warning when credentials are missing.

Confidence Score: 4/5

The PR appears safe to merge, with only a non-blocking request to document or avoid the new token assertion.

The suite-level credential gate is consistent with repository test setup and prevents credential-dependent setup from running when skipped; the remaining concern is limited to maintainability of the assertion.

Files Needing Attention: packages/onedrive/integration.test.ts

Important Files Changed

Filename Overview
packages/onedrive/integration.test.ts Correctly consolidates missing-credential handling at suite level, with one non-blocking undocumented non-null assertion.

Reviews (1): Last reviewed commit: "test(onedrive): skip integration suite w..." | Re-trigger Greptile

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

Labels

plugin Changes inside a plugin package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(onedrive): skip integration suite when ONEDRIVE_ACCESS_TOKEN is missing

1 participant