Skip to content

Schedule: Add unit and integration tests to app/actions/supabase/coverage/toggle-exclusion.ts#860

Merged
gitauto-ai[bot] merged 7 commits intomainfrom
gitauto/schedule-20260422-175028-XvBu
Apr 22, 2026
Merged

Schedule: Add unit and integration tests to app/actions/supabase/coverage/toggle-exclusion.ts#860
gitauto-ai[bot] merged 7 commits intomainfrom
gitauto/schedule-20260422-175028-XvBu

Conversation

@gitauto-ai
Copy link
Copy Markdown
Contributor

@gitauto-ai gitauto-ai Bot commented Apr 22, 2026

Current Coverage for app/actions/supabase/coverage/toggle-exclusion.ts

  • Line Coverage: 25% (Uncovered: 14, 16, 24, 25, 26, 29)
  • Statement Coverage: 25%
  • Function Coverage: 0% (Uncovered: L8:toggleExclusion)
  • Branch Coverage: 0% (Uncovered: line 14, block 0, branch 0, line 24, block 1, branch 0)

Instructions

Focus on covering the uncovered areas.

Test these changes locally

git fetch origin
git checkout gitauto/schedule-20260422-175028-XvBu
git pull origin gitauto/schedule-20260422-175028-XvBu

What I Tested

I added unit tests in toggle-exclusion.test.ts and integration tests in toggle-exclusion.integration.test.ts for the toggleExclusion function in app/actions/supabase/coverage/toggle-exclusion.ts.

Unit tests (mocked supabaseAdmin) cover: empty ids array returning 0 without hitting the DB, successful bulk update of is_excluded_from_testing with correct updated_by format (userId:userName), toggling to false, and DB error propagation with console.error logging.

Integration tests hit a real Supabase instance via supabaseAdmin, seeding and tearing down owners, repositories, and coverages rows per test. They cover: toggling multiple records to excluded and back, empty ids returning 0, and partial updates (only specified ids change, unspecified ids stay untouched).

Potential Bugs Found

None found. The completion note mentions a TypeScript fix was applied (added the required updated_by field to coverage insert records in the integration test's beforeEach/test setup), meaning the implementation was not changed but the test data was corrected before merging.

Non-Code Tasks

  • Integration tests require live Supabase credentials (supabaseAdmin) to be available in the CI environment. Confirm SUPABASE_SERVICE_ROLE_KEY and SUPABASE_URL (or equivalent) are set in the CI secrets before merging.
  • Verify that test IDs generated by Math.random() do not collide with real owner/repo IDs in the shared Supabase instance, especially if CI and production share the same database.

@gitauto-ai gitauto-ai Bot requested a review from hiroshinishio April 22, 2026 17:50
@gitauto-ai gitauto-ai Bot added the gitauto label Apr 22, 2026
@gitauto-ai
Copy link
Copy Markdown
Contributor Author

gitauto-ai Bot commented Apr 22, 2026

Pull request completed! 🚀

I autonomously open pull requests on a schedule. You can manage your schedule here. Should you have any questions or wish to change settings or limits, please feel free to contact info@gitauto.ai or invite us to Slack Connect.

gitauto-ai Bot and others added 6 commits April 22, 2026 17:53
Co-Authored-By: hiroshinishio <hiroshinishio@users.noreply.github.com>
…t.ts [skip ci]

Co-Authored-By: hiroshinishio <hiroshinishio@users.noreply.github.com>
…t.ts [skip ci]

Co-Authored-By: hiroshinishio <hiroshinishio@users.noreply.github.com>
…le-exclusion.integration.test.ts [skip ci]

Co-Authored-By: hiroshinishio <hiroshinishio@users.noreply.github.com>
…le-exclusion.test.ts [skip ci]

Co-Authored-By: hiroshinishio <hiroshinishio@users.noreply.github.com>
@gitauto-ai gitauto-ai Bot merged commit 738d804 into main Apr 22, 2026
1 check passed
@gitauto-ai gitauto-ai Bot deleted the gitauto/schedule-20260422-175028-XvBu branch April 22, 2026 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants