Skip to content

feat: add parallel Vitest test suite and cross-repo CI trigger (issue #49)#55

Closed
aditya-8787 wants to merge 1 commit intometacall:masterfrom
aditya-8787:feat/vitest-parallel-test-suite
Closed

feat: add parallel Vitest test suite and cross-repo CI trigger (issue #49)#55
aditya-8787 wants to merge 1 commit intometacall:masterfrom
aditya-8787:feat/vitest-parallel-test-suite

Conversation

@aditya-8787
Copy link
Copy Markdown

What this PR does

Foundation PR for improving test reliability across metacall/protocol,
metacall/faas and metacall/deploy as discussed in issue #49 .

Changes

File What
vitest.config.js Vitest config targeting test/*.vitest.ts only
test/protocol.vitest.ts First TypeScript test file — 11 tests, all passing
package.json Added test:vitest and test:coverage scripts
.github/workflows/ci.yml Vitest blocking + Mocha non-blocking + dispatch trigger

Approach

1. Parallel test suite
New tests live in test/*.vitest.ts. Mocha picks up dist/test/*.js so
the two runners never conflict. Mocha stays non-blocking
(continue-on-error: true) since CI is already known fragile. Old tests
removed only once full TypeScript coverage is verified — clean cut, not
a dragged-out migration.

2. Cross-repo CI trigger
Added repository_dispatch: protocol-updated to CI so faas and deploy can
be pinged when protocol master changes. Downstream workflows that install
protocol from GitHub master instead of pinned npm are follow-up PRs in
those repos.

3. Secrets handling
pull_request_target + protected environment approach for METACALL_API_KEY
belongs in the deploy repo — will be handled there.

Test results

✓ index module loads without errors
✓ has correct package name
✓ has a valid semver version string
✓ deployment module loads
✓ login module loads
✓ token module loads
✓ plan module loads
✓ signup module loads
✓ language module loads
✓ package module loads
✓ protocol module loads

Test Files: 1 passed | Tests: 11 passed | Duration: 539ms

What comes next

  • Workflow in metacall/faas listening for protocol-updated, installing
    protocol from GitHub master instead of pinned npm
  • Same for metacall/deploy + secrets handling with protected environments
  • More .vitest.ts tests covering protocol logic and edge cases

@aditya-8787
Copy link
Copy Markdown
Author

@viferga as we discussed, I have started working on the testing improvements
for issue #49. I have set up the parallel Vitest test suite alongside the
existing Mocha tests with 11 passing tests covering all source modules. I have
also added the repository_dispatch trigger for cross-repo CI. I am raising the
PR now and will follow up with the downstream workflows in faas and deploy repos
as the next steps. Please have a look when you get a chance. Thanks

@viferga
Copy link
Copy Markdown
Member

viferga commented Mar 20, 2026

This is wrong. I can't merge it.

@viferga viferga closed this Mar 20, 2026
@viferga viferga reopened this Mar 20, 2026
@aditya-8787
Copy link
Copy Markdown
Author

@viferga Before I proceed further, I wanted to share my plan
for the next steps and get your confirmation that I am going in the
right direction.

Here is what I am planning next:

  1. protocol repo — Add a trigger-downstream job to the existing CI
    that pings metacall/faas and metacall/deploy via repository_dispatch
    after every master push, so they can test against latest protocol
    instead of a pinned version.

  2. faas repo — Add a small workflow that listens for the
    protocol-updated event, replaces the pinned protocol version with
    metacall/protocol#master and runs existing tests.

  3. deploy repo — Same as faas, plus split into two jobs: unit tests
    run on all PRs normally, integration tests only run when a maintainer
    applies a safe-to-test label so METACALL_API_KEY is never exposed to
    fork PRs.

Does this align with what you had in mind? Let me know if I should
approach anything differently before I start. Thanks

@viferga
Copy link
Copy Markdown
Member

viferga commented Mar 31, 2026

You added vitest but it was not strictly necessary. What we needed is adding a proper testing that triggers deploy and faas repositories. We have added them recently with @Priyanshu-u07

@viferga viferga closed this Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants