Skip to content

Add graphql-java-arbitrary property generators - #4421

Open
andimarek wants to merge 6 commits into
masterfrom
codex/kotest-schema-property-testing
Open

Add graphql-java-arbitrary property generators#4421
andimarek wants to merge 6 commits into
masterfrom
codex/kotest-schema-property-testing

Conversation

@andimarek

@andimarek andimarek commented Jul 31, 2026

Copy link
Copy Markdown
Member

Summary

  • add a new graphql-java-arbitrary Gradle subproject, published as com.graphql-java:graphql-java-arbitrary with the same version and release lifecycle as graphql-java
  • provide configurable Kotest Arb generators in the graphql.arbitrary package for native graphql-java schemas, types, names, executable documents, execution inputs, output values, code registries, runtime wiring, and executable GraphQL instances
  • keep the generators and their supporting configuration/types in src/main/kotlin, with the generator test suites in src/test/kotlin
  • publish reusable JUnit property-testing infrastructure (ArbPropertyBase and DeepArbSuite) as Gradle test fixtures
  • use JUnit 5 for the test suites while retaining Kotest Property's generation, shrinking, seeding, and assertion support
  • isolate Kotlin and Kotest dependencies to the new artifact; the main graphql-java artifact remains Java-only
  • publish the binary, sources, and Dokka-generated Javadoc artifacts with the README and MIT/Apache-2.0 license material
  • collect JUnit XML results from every Gradle subproject in CI

Usage

testImplementation("com.graphql-java:graphql-java-arbitrary:<graphql-java-version>")

Consumers that want the reusable test bases can also add:

testImplementation(testFixtures("com.graphql-java:graphql-java-arbitrary:<graphql-java-version>"))

The module README includes configuration guidance and a JUnit/Kotest Property example.

Testing

The existing Gradle/CI matrix covers the new subproject on Java 11, 17, 21, and 25, together with assemble, check, and Javadoc generation. The module's suites include schema and SDL round trips, type relationships and cycles, generated executable documents and execution inputs, input/output values, runtime wiring, configuration, and generator utility behavior.

Provenance

The implementation is adapted from Airbnb Viaduct's core/shared/arbitrary module, originally created by James Bellenger. The module README links both the Airbnb Viaduct repository and the pinned source revision, and the Apache License 2.0 text is included in the published artifacts.

@andimarek
andimarek force-pushed the codex/kotest-schema-property-testing branch from 2f2b616 to cb80946 Compare July 31, 2026 23:36
@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Test Report

Test Results

Java Version Total Passed Failed Errors Skipped
Java 11 6149 (+222 🟢) 6088 (+217 🟢) 0 (±0) 0 (±0) 61 (+5)
Java 17 6149 (+222 🟢) 6087 (+217 🟢) 0 (±0) 0 (±0) 62 (+5)
Java 21 6149 (+222 🟢) 6087 (+217 🟢) 0 (±0) 0 (±0) 62 (+5)
Java 25 6149 (+222 🟢) 6087 (+217 🟢) 0 (±0) 0 (±0) 62 (+5)
jcstress 32 (±0) 32 (±0) 0 (±0) 0 (±0) 0 (±0)
Total 24628 (+888 🟢) 24381 (+868 🟢) 0 (±0) 0 (±0) 247 (+20)

Code Coverage (Java 25)

Metric Covered Missed Coverage vs Master
Lines 30046 3121 90.6% ±0.0%
Branches 8785 1519 85.3% ±0.0%
Methods 8026 1206 86.9% ±0.0%

No per-class coverage changes detected.

Full HTML report: build artifact jacoco-html-report

Updated: 2026-08-09 23:54:34 UTC

@andimarek
andimarek force-pushed the codex/kotest-schema-property-testing branch from cb80946 to 05bd88b Compare August 3, 2026 23:07
@andimarek andimarek changed the title Add Kotest schema property testing Add Kotest schema and document property testing Aug 3, 2026
@andimarek
andimarek force-pushed the codex/kotest-schema-property-testing branch from 05bd88b to f643a61 Compare August 3, 2026 23:56
@andimarek andimarek changed the title Add Kotest schema and document property testing Add Kotest GraphQL property-testing support Aug 3, 2026
Port Airbnb Viaduct's arbitrary GraphQL schema support to graphql-java native schema and AST types. Cover generated schema validity, SDL round trips, defaults, input cycles, oneOf inputs, coercion, and applied directives with Kotest properties.
@andimarek
andimarek force-pushed the codex/kotest-schema-property-testing branch from f643a61 to 8e57399 Compare August 4, 2026 23:15
@andimarek andimarek changed the title Add Kotest GraphQL property-testing support Publish Kotest GraphQL property-testing generators Aug 4, 2026
…-refactor

Refine arbitrary GraphQL generators
@andimarek andimarek changed the title Publish Kotest GraphQL property-testing generators Add graphql-java-arbitrary property generators Aug 9, 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