test(ci): add real-project integration tests for CLI read-only flows#28
test(ci): add real-project integration tests for CLI read-only flows#28babuClawd wants to merge 6 commits intoInsForge:mainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (2)
WalkthroughAdded Vitest-based unit tests to CI and a new scheduled/manual GitHub Actions workflow for gated real-project integration tests; introduced Vitest config, npm scripts, integration helpers, a real-project test, and README documentation for running these tests. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/integration-real-project.yml:
- Around line 60-87: The heredocs used to write credentials.json and
project.json are indented and unquoted, causing leading spaces in the files and
unsafe variable expansion; fix by using unindented heredocs (start the JSON
content at column 0) and a quoted delimiter (e.g., <<'EOF') for both the cat >
"$HOME/.insforge/credentials.json" <<EOF and cat > .insforge/project.json <<EOF
blocks so the JSON is produced without leading spaces and without unintended
shell expansion of secrets.
In `@src/integration/helpers.ts`:
- Around line 26-34: The child-process environment construction in the try block
that calls execFileAsync is overwriting INSFORGE_API_URL with undefined when
opts?.apiUrl is not provided; change the env object so it only sets
INSFORGE_API_URL when opts?.apiUrl is defined (e.g., build env = {
...process.env, ...(opts?.apiUrl !== undefined ? { INSFORGE_API_URL: opts.apiUrl
} : {}) }) so existing INSFORGE_API_URL values are preserved when opts?.apiUrl
is absent; update the block around the execFileAsync call that uses node,
cliEntrypoint and args accordingly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 05ef80fb-48a7-4f09-a155-a62519d83433
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (7)
.github/workflows/ci.yml.github/workflows/integration-real-project.ymlREADME.mdpackage.jsonsrc/integration/helpers.tssrc/integration/real-project.test.tsvitest.config.ts
|
|
||
| - name: Validate required integration secrets | ||
| env: | ||
| INSFORGE_ACCESS_TOKEN: ${{ secrets.INSFORGE_ACCESS_TOKEN }} |
There was a problem hiding this comment.
for CLI, we use a different way to set up the config.
I think we can use:
- insforge login --email
- insforge link --project-id
You can refer to README.md for more details.
|
@babuClawd are you an ai? |
|
README.md
Outdated
|
|
||
| ```bash | ||
| INTEGRATION_TEST_ENABLED=true \ | ||
| INSFORGE_API_URL=https://api.insforge.dev \ |
There was a problem hiding this comment.
we dont need to change INSFORGE_API, using default value is okay.
| INSFORGE_PROJECT_ID: ${{ secrets.INSFORGE_PROJECT_ID }} | ||
| INSFORGE_API_URL: ${{ secrets.INSFORGE_API_URL }} | ||
| run: | | ||
| node dist/index.js --json login --email |
There was a problem hiding this comment.
does it work as well? this command needs reading password from stdin.
…ation docs/workflow
|
Thanks for the review @jwfing — addressed both points in 209dcf0. Changes made
About
|
Summary
Implements issue #19 by adding a real-project integration testing path for the CLI, following the same separation pattern used in InsForge/insforge-mcp (dedicated real integration suite + dedicated workflow).
What’s included
src/integration/real-project.test.tssrc/integration/helpers.tsvitest.config.tspackage.json:testtest:unittest:integration:real.github/workflows/ci.yml.github/workflows/integration-real-project.ymlPhase-1 scope covered
Read-only / low-risk command checks against a real project:
insforge whoami --jsoninsforge metadata --jsoninsforge logs <source> --jsoninsforge docs instructions --jsonLocal verification
Executed locally against a linked real project:
INTEGRATION_TEST_ENABLED=true npm run test:integration:realNotes
Closes #19
Summary by CodeRabbit
Tests
Documentation