Skip to content

test: add integration test for real-world spec - #15

Merged
halotukozak merged 12 commits into
masterfrom
fix/integration-test-ump-api
Mar 20, 2026
Merged

test: add integration test for real-world spec#15
halotukozak merged 12 commits into
masterfrom
fix/integration-test-ump-api

Conversation

@halotukozak

Copy link
Copy Markdown
Contributor

Summary

  • Add IntegrationTest with 3 test methods validating full generation pipeline against 725KB ump-api.json
  • Tests verify: enum generation without errors, ApiClientBase presence, overall compilation
  • Spec fixture gitignored (not committed)

Dependencies

Test plan

  • Copy ump-api.json to core/src/test/resources/ locally
  • ./gradlew :core:test --tests "*.IntegrationTest" passes
  • ump-api.json not tracked by git

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings March 19, 2026 15:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a large-spec integration test intended to exercise the full OpenAPI → Kotlin generation pipeline, while also introducing a Gradle plugin module and adding repository planning/analysis docs.

Changes:

  • Add IntegrationTest (plus a couple of targeted generator tests) to validate generation behavior against a local real-world ump-api.json fixture.
  • Introduce a new plugin module with a multi-spec justworks { specs { ... } } DSL and generation tasks.
  • Add .planning/ documentation files and update .gitignore (including ignoring the ump-api.json fixture).

Reviewed changes

Copilot reviewed 18 out of 19 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
settings.gradle.kts Includes the new plugin module in the build.
plugin/src/main/kotlin/com/avsystem/justworks/gradle/JustworksSpecConfiguration.kt Adds per-spec configuration model for the plugin DSL.
plugin/src/main/kotlin/com/avsystem/justworks/gradle/JustworksSharedTypesTask.kt Adds a task to generate shared response/error wrapper types.
plugin/src/main/kotlin/com/avsystem/justworks/gradle/JustworksPlugin.kt Registers the extension and per-spec generation tasks; wires outputs into source sets.
plugin/src/main/kotlin/com/avsystem/justworks/gradle/JustworksGenerateTask.kt Adds the main generation task (parse spec → model/client/base generation → write to disk).
plugin/src/main/kotlin/com/avsystem/justworks/gradle/JustworksExtension.kt Adds the top-level justworks extension exposing the specs container.
plugin/build.gradle.kts Adds Gradle plugin module build + functional test source set.
core/src/test/kotlin/com/avsystem/justworks/core/gen/TypeMappingTest.kt Adds a new assertion around Instant type mapping.
core/src/test/kotlin/com/avsystem/justworks/core/gen/ModelGeneratorTest.kt Adds a regression test for enum constant generation output.
core/src/test/kotlin/com/avsystem/justworks/core/gen/IntegrationTest.kt Adds optional local-fixture integration tests for a large real-world spec.
.planning/PROJECT.md Adds project overview/planning notes.
.planning/codebase/TESTING.md Adds testing patterns documentation.
.planning/codebase/STRUCTURE.md Adds codebase structure documentation.
.planning/codebase/STACK.md Adds stack/dependencies documentation.
.planning/codebase/INTEGRATIONS.md Adds external integrations documentation.
.planning/codebase/CONVENTIONS.md Adds coding conventions documentation.
.planning/codebase/CONCERNS.md Adds concerns/tech-debt documentation.
.planning/codebase/ARCHITECTURE.md Adds architecture documentation.
.gitignore Ignores .planning/ and the large ump-api.json fixture path.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread core/src/test/kotlin/com/avsystem/justworks/core/gen/IntegrationTest.kt Outdated
Comment thread core/src/test/kotlin/com/avsystem/justworks/core/gen/IntegrationTest.kt Outdated
Comment thread plugin/src/main/kotlin/com/avsystem/justworks/gradle/JustworksExtension.kt Outdated
Comment thread settings.gradle.kts
halotukozak and others added 8 commits March 20, 2026 10:20
- Add test asserting enum constants have no class body braces
- Add test asserting @SerialName annotations present on enum constants
- Add test asserting @serializable on generated enum class

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Verify INSTANT constant uses kotlin.time package
- Lock Instant mapping to prevent accidental regression

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Copy 5 plugin source files from draft branch to current working tree
- Fix SpecParser usage (object, not class) and ParseResult field name
- Replace non-existent generateTo/getSealedHierarchies with current core API
- Wire ApiClientBaseGenerator into JustworksGenerateTask for endpoint specs
- Add KotlinPoet dependency to plugin for FileSpec.writeTo support
- Add plugin module to settings.gradle.kts
- Add ktlint version override consistent with core module

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Create IntegrationTest.kt validating full generation pipeline against 725KB ump-api.json
- Verify enum generation produces no anonymous class body conflicts
- Verify @SerialName and @serializable annotations present on generated enums
- Verify ApiClientBase generation and full client pipeline
- Add .gitignore entry to exclude ump-api.json fixture from version control
- Tests skip gracefully when fixture file is not available

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace ump-api references with generic real-world-spec naming
to avoid exposing internal API details.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@halotukozak
halotukozak force-pushed the fix/integration-test-ump-api branch from ddeb0c6 to 8901786 Compare March 20, 2026 09:21
@halotukozak halotukozak changed the title test: add integration test for real-world ump-api.json spec test: add integration test for real-world spec Mar 20, 2026
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@halotukozak
halotukozak force-pushed the fix/integration-test-ump-api branch from f69147a to 20ab704 Compare March 20, 2026 09:56
halotukozak and others added 2 commits March 20, 2026 11:01
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@halotukozak
halotukozak force-pushed the fix/integration-test-ump-api branch from df89b97 to 8d05713 Compare March 20, 2026 10:13
@github-actions

Copy link
Copy Markdown
Overall Project 90.22% 🍏

There is no coverage information present for the Files changed

… tests

Replace skip-if-missing fixture approach with two committed anonymized
specs (platform-api.json, analytics-api.json) derived from production
OpenAPI definitions. All domain-specific names, endpoints, schemas, and
fields have been replaced with generic equivalents.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Overall Project 93.35% 🍏

There is no coverage information present for the Files changed

@halotukozak
halotukozak merged commit 9efa9c7 into master Mar 20, 2026
1 check passed
@halotukozak
halotukozak deleted the fix/integration-test-ump-api branch March 20, 2026 10:45
halotukozak added a commit that referenced this pull request Mar 20, 2026
test: add integration test for real-world spec
@halotukozak halotukozak added this to the 0.0.1 milestone Apr 2, 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