Add basic E2E tests for SDK endpoints with GitHub Actions workflow#64
Merged
Add basic E2E tests for SDK endpoints with GitHub Actions workflow#64
Conversation
Co-Authored-By: Kirthi Kumar <kirthi.kumar50@gmail.com>
Contributor
Author
Original prompt from Kirthi
|
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.pdfas 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_KEYis not set, the test file throws immediately (hard fail) rather than silently skipping.Changes
tests/e2e/sdk.e2e.test.ts— 12 test cases across 6 describe blocks.github/workflows/e2e.yml— runs E2E tests on PRs tomain/nextjest.config.ts— addedtests/e2etotestPathIgnorePatternsso the regulartestCI job doesn't run E2E tests (which require an API key)testPathIgnorePatternsvia CLI (--testPathIgnorePatterns='scripts') so only the E2E tests are discovered and runjest.setTimeout(180_000)in the E2E test file to accommodate polling tests that wait for async jobsCI status:
lint✓,build✓,test✓,e2e✓ — all checks pass including E2E against the live API.Review & Testing Checklist for Human
parse.createresponse assertion logic: The test casts the response toParseResponseand conditionally checksresult.type === 'full'before asserting on chunks. If the API returns aURLResultor anAsyncParseResponse, the chunk assertion is silently skipped. Consider whether this is acceptable or if it should fail explicitly.testPathIgnorePatternsoverride is fragile: The E2E workflow uses--testPathIgnorePatterns='scripts'to override the config-level ignore list. If new ignore patterns are added tojest.config.tsin the future, they won't apply to the E2E workflow (and vice versa). Verify this tradeoff is acceptable.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
pull_request), not on pushes.jest.config.ts's default test paths so./scripts/test(used by the existingtestCI job) does not run them.REDUCTO_API_KEYrepo secret is now configured and working.Link to Devin session: https://app.devin.ai/sessions/f2da3186d09d47d097d4ceec519841a1
Requested by: @kirthi20