Skip to content

Add basic E2E tests for SDK endpoints with GitHub Actions workflow#64

Merged
kirthi20 merged 4 commits intomainfrom
devin/1774573372-add-e2e-tests
Mar 27, 2026
Merged

Add basic E2E tests for SDK endpoints with GitHub Actions workflow#64
kirthi20 merged 4 commits intomainfrom
devin/1774573372-add-e2e-tests

Conversation

@devin-ai-integration
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot commented Mar 27, 2026

Summary

Ports the E2E testing setup from reducto-python-sdk#95 to the Node SDK. Adds end-to-end tests that exercise the core SDK endpoints against the live Reducto API, plus a GitHub Actions workflow that runs them on PRs to main/next.

Endpoints covered: /parse, /parse_async, /extract, /extract_async, /upload, /job/{job_id}

All tests use https://ci.reducto.ai/onepager.pdf as the test document and a trivial JSON schema for extract tests. Tests validate response structure and types only — not parsing/extraction quality.

Difference from Python SDK PR: If REDUCTO_API_KEY is not set, the test file throws immediately (hard fail) rather than silently skipping.

Changes

  • New file tests/e2e/sdk.e2e.test.ts — 12 test cases across 6 describe blocks
  • New workflow .github/workflows/e2e.yml — runs E2E tests on PRs to main/next
  • jest.config.ts — added tests/e2e to testPathIgnorePatterns so the regular test CI job doesn't run E2E tests (which require an API key)
  • The E2E workflow overrides testPathIgnorePatterns via CLI (--testPathIgnorePatterns='scripts') so only the E2E tests are discovered and run
  • jest.setTimeout(180_000) in the E2E test file to accommodate polling tests that wait for async jobs

CI status: lint ✓, build ✓, test ✓, e2e ✓ — all checks pass including E2E against the live API.

Review & Testing Checklist for Human

  • Verify the parse.create response assertion logic: The test casts the response to ParseResponse and conditionally checks result.type === 'full' before asserting on chunks. If the API returns a URLResult or an AsyncParseResponse, the chunk assertion is silently skipped. Consider whether this is acceptable or if it should fail explicitly.
  • testPathIgnorePatterns override is fragile: The E2E workflow uses --testPathIgnorePatterns='scripts' to override the config-level ignore list. If new ignore patterns are added to jest.config.ts in the future, they won't apply to the E2E workflow (and vice versa). Verify this tradeoff is acceptable.
  • Flakiness under load: Polling tests loop 60 times with 2s sleep (120s max). If the API is slow, these could time out. Monitor for flakiness after merging.

Suggested test plan: Re-run the E2E workflow from the GitHub Actions UI to confirm it passes consistently. Optionally run locally with REDUCTO_API_KEY=<key> npx jest tests/e2e/ --verbose --bail --testPathIgnorePatterns='scripts'.

Notes

  • The E2E workflow triggers only on PRs (pull_request), not on pushes.
  • E2E tests are excluded from jest.config.ts's default test paths so ./scripts/test (used by the existing test CI job) does not run them.
  • REDUCTO_API_KEY repo secret is now configured and working.

Link to Devin session: https://app.devin.ai/sessions/f2da3186d09d47d097d4ceec519841a1
Requested by: @kirthi20

Co-Authored-By: Kirthi Kumar <kirthi.kumar50@gmail.com>
@devin-ai-integration
Copy link
Copy Markdown
Contributor Author

Original prompt from Kirthi

make a pull request that does the equivalent of this for the node SDK: https://github.com/reductoai/reducto-python-sdk/pull/95/changes

should be reducto-node-sdk repo

@devin-ai-integration devin-ai-integration bot requested a review from kirthi20 March 27, 2026 01:04
@devin-ai-integration
Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

devin-ai-integration bot and others added 3 commits March 27, 2026 01:05
Co-Authored-By: Kirthi Kumar <kirthi.kumar50@gmail.com>
Co-Authored-By: Kirthi Kumar <kirthi.kumar50@gmail.com>
Co-Authored-By: Kirthi Kumar <kirthi.kumar50@gmail.com>
@kirthi20 kirthi20 merged commit 16216c4 into main Mar 27, 2026
8 checks passed
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.

1 participant