Skip to content
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

[1.x] Improve test Sample generation #1506

Merged
merged 3 commits into from
Apr 27, 2023

Conversation

armiol
Copy link
Contributor

@armiol armiol commented Apr 20, 2023

In server-side test code, there is a utility called Sample. It allows to generate sample values for any given Proto message. However, it does a lousy job with Proto strings. In particular, it just creates them as eight random bytes treated as UTF-8-encoded Java String.

Such an approach is problematic if such values are stored either as IDs, or as entity column values into some real DB. For instance, MySQL 5.7 is not able to store such strings as-is — which was discovered when running Spine tests against MySQL in scope of spine-rdbms development.

This changeset updates this Sample tool, so that string-typed fields in Proto messages get UUID-generated values instead of random bytes.

The library version is set to 1.9.0-SNAPSHOT.12.

@armiol armiol self-assigned this Apr 20, 2023
@armiol armiol merged commit c7efe66 into 1.x-dev Apr 27, 2023
@armiol armiol deleted the 1.x-improve-test-sample-generation branch April 27, 2023 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant