-
Notifications
You must be signed in to change notification settings - Fork 66
test: add full-stack testing infrastructure for Java → TypeScript generation #4297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4297 +/- ##
==========================================
- Coverage 86.33% 86.31% -0.03%
==========================================
Files 123 123
Lines 8474 8474
Branches 1301 1302 +1
==========================================
- Hits 7316 7314 -2
- Misses 1135 1137 +2
Partials 23 23
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
fee59bf to
263bc2c
Compare
Phase 1 of consolidating generator tests to verify complete Java → TypeScript pipeline instead of split Java→OpenAPI and OpenAPI→TypeScript tests. New infrastructure components: 1. **NodeRunner.java** - Utility for executing Node.js scripts from Java tests - Captures stdout/stderr - Handles timeouts - Throws exceptions on non-zero exit codes 2. **run-generator.mjs** - Node.js script that runs TypeScript generator - Reads OpenAPI JSON from stdin - Imports all generator plugins dynamically - Outputs generated files as JSON to stdout 3. **FullStackTestHelper.java** - Main test helper class - Executes full pipeline: Java → OpenAPI → TypeScript - Parses generator output - Provides assertions against snapshot files 4. **TypeScriptComparator.java** - File comparison utility - Line-by-line diff with clear error messages - Whitespace normalization - Reports missing/extra files 5. **full-stack-test.md** - Complete migration plan documentation Next steps: - Debug runtime issue in SignalProcessor - Generate initial TypeScript snapshots for existing tests - Convert first test to use full-stack approach 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Add infrastructure for Java → TypeScript full-stack testing: - NodeRunner.java: Execute Node.js scripts from Java tests - run-generator.mjs: Node.js script to run TS generator - FullStackTestHelper.java: Main test helper for full-stack tests - TypeScriptComparator.java: Compare generated TS against snapshots Convert 4 transfertypes tests to full-stack approach: - UUIDFullStackTest: UUID → string conversion - JsonNodeFullStackTest: JsonNode → unknown conversion - MultipartFileFullStackTest: MultipartFile → File conversion - PushTypeFullStackTest: Flux/EndpointSubscription → Subscription All tests verify complete Java → OpenAPI → TypeScript pipeline. SignalsPlugin temporarily disabled due to runtime error. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
…lass Create AbstractFullStackTest base class that encapsulates all common configuration (plugins, classpath, annotations) to drastically simplify test code. Tests now only need to extend the base class and call assertTypescriptMatchesSnapshot(). Changes: - Add AbstractFullStackTest with all plugins and extended classpath - Refactor and rename 4 existing tests to use the base class - UUIDFullStackTest → UUIDTest (~50% less code) - JsonNodeFullStackTest → JsonNodeTest (~50% less code) - MultipartFileFullStackTest → MultipartFileTest (~50% less code) - PushTypeFullStackTest → PushTypeTest (~50% less code) The base class includes: - All plugins (Backbone, TransferTypes, Model, Nonnull, SubTypes, MultipartFileChecker) - Extended classpath with Flux and EndpointSubscription - Both @endpoint and @EndpointExposed annotations - Simple one-line test assertions Net result: -302 lines of boilerplate code 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Integrate FullStackTestHelper functionality directly into AbstractFullStackTest to eliminate an unnecessary layer of indirection. All helper methods are now private methods of the base test class. Changes: - Move all FullStackTestHelper methods into AbstractFullStackTest - Move GeneratedFiles and FullStackExecutionException as inner classes - Remove FullStackTestHelper.java entirely - Simplify constructor and field initialization Net result: -39 lines, cleaner architecture with one less class 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Remove custom NodeRunner implementation and use existing FrontendUtils.executeCommand from Flow instead. This eliminates 197 lines of duplicate code by reusing battle-tested infrastructure. Benefits: - Zero new code needed - uses existing Flow utility - Platform-aware command execution (Windows/Unix) - Proper stream handling and error reporting - No custom implementation to maintain Changes: - Remove NodeRunner.java (197 lines) - Update AbstractFullStackTest to use FrontendUtils.executeCommand - Uses temp file for stdin (FrontendUtils doesn't support piping) Net result: -197 lines, better architecture 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Update documentation to reflect all simplifications made through 3 refactoring commits: 1. AbstractFullStackTest base class creation 2. FullStackTestHelper merge into base class 3. NodeRunner replacement with FrontendUtils.executeCommand Changes: - Update Phase 1 to show AbstractFullStackTest instead of separate components - Update test examples to show simplified single-line approach - Add "Architecture Improvements" section documenting refactorings - Update test naming (removed "FullStack" suffix) - Show before/after comparison (63 lines → 33 lines per test) - Document net -436 lines code reduction Documentation now accurately reflects the current simplified state where writing tests requires only extending AbstractFullStackTest and calling assertTypescriptMatchesSnapshot(). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1492da2 to
140caf6
Compare
f5a5711 to
094151c
Compare
- Applied SignalsPlugin fix from bcb43396b (getIdentifier() ?? add() pattern) - Converted SignalTest to use AbstractFullStackTest - Created SignalEndpoint.ts snapshot with correct type imports - Added slf4j-simple test dependency to eliminate SLF4J warnings - Updated full-stack-test.md progress (5/47 tests converted) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
094151c to
8235e42
Compare
|



Introduces unified testing approach that verifies the complete Java→TypeScript
code generation pipeline, replacing the previous split architecture where
Java→OpenAPI and OpenAPI→TypeScript were tested separately.
What Changed
New Infrastructure (3 files)
all plugins, extended classpath, and single-line test assertions
Flow's FrontendUtils.executeCommand()
Converted Tests (5 of 47)
Transformed existing Java→OpenAPI tests into full-stack Java→TypeScript tests:
Each test now includes TypeScript snapshots containing only files relevant
to what's being tested.
Progress: 5 of 47 tests converted (10% complete)