-
Notifications
You must be signed in to change notification settings - Fork 4
Implement randomized schema test #227
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
Conversation
Benchmark ResultBenchmark diff with base branchBenchmark result |
8436946 to
512a35d
Compare
002bfaa to
b1c3718
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements a randomized schema testing framework that generates random STEF schemas and validates the code generation pipeline. It also fixes several bugs discovered during the implementation.
- Adds a new
TestRandomizedSchematest that generates random schemas using a configurable seed for reproducibility - Fixes template logic for handling enum types in arrays and multimap SetKey methods
- Adds schema pretty-printing functionality to help debug failing test cases
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| stefc/templates/go/multimap.go.tmpl | Fixes conditional logic for generating SetKey method based on primitive types |
| stefc/templates/go/array.go.tmpl | Adds enum support in CopyFromSlice and fixes storage type conversion in mutateRandom |
| stefc/generator/testdata/enum_array.stef | Adds test data file for enum array functionality |
| stefc/generator/generator_test.go | Implements randomized schema generator and test infrastructure |
| stefc/generator/compileschema.go | Improves type resolution for arrays and adds enum validation |
| go/pkg/schema/schema_prettyprint_test.go | Adds comprehensive tests for schema pretty-printing functionality |
| go/pkg/schema/schema.go | Implements PrettyPrint method for converting schemas back to SDL format |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
b1c3718 to
3dec842
Compare
maheshkanote
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tigrannajaryan this is interesting way of verifying the stef schemas.
8ad734c to
7fbd9a1
Compare
Resolves #183 This adds a new TestRandomizedSchema that generates a schema using random number generator, then compiles and runs the tests for the schema. The new test revealed a number of bugs. I fixed a few of the smaller ones. There are more bugs, but I don't want to overload this PR. For now TestRandomizedSchema does not fail the build when it finds a buggy schema, but merely logs it. After this PR is merged I will fix every failing schema one by one.
7fbd9a1 to
21a9929
Compare
Resolves #183
This adds a new TestRandomizedSchema that generates a schema using random number generator, then compiles and runs the tests for the schema.
The new test revealed a number of bugs. I fixed a few of the smaller ones. There are more bugs but I don't want to overload this PR. For now TestRandomizedSchema does not fail the build when it finds a buggy schema, but merely logs it. After this PR is merged I will fix every failing schema one by one.