-
Notifications
You must be signed in to change notification settings - Fork 94
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
fix(replays): Run TrimmingProcessor on replays #3706
Conversation
#[test] | ||
fn test_maxchars_trimming() { | ||
let json = format!(r#"{{"dist": "{}"}}"#, "0".repeat(100)); | ||
let mut replay = Annotated::<Replay>::from_json(json.as_str()).unwrap(); |
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.
test only stresses dist, should it test the other fields too?
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.
As Bruno said more test coverage is appreciated if necessary.
The max length is defined by the annotation on the fields correct? Does this mean string trimming wasn't working before?
Yep, that's correct.
Yes, let me know if I should clarify further the PR description.
The test validates that the trimming processor runs on replays, and there are separate tests to validate that the trimming processor trims fields with |
Although some fields in replays have
max_chars
defined, the trimming processor isn't run and thus the limit is not enforced. This PR runs the processor and enforces that limit.