-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
[chore][pkg/stanza] Add detailed split func test helper #26717
Merged
djaglowski
merged 2 commits into
open-telemetry:main
from
djaglowski:pkg-stanza-split-test
Sep 26, 2023
Merged
[chore][pkg/stanza] Add detailed split func test helper #26717
djaglowski
merged 2 commits into
open-telemetry:main
from
djaglowski:pkg-stanza-split-test
Sep 26, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65f2ab4
to
46b4fbf
Compare
djaglowski
added a commit
that referenced
this pull request
Sep 22, 2023
Subset of #26717 Our current split func tests depend on a `bufio.Scanner`, which has the advantage of being somewhat similar to our typical usage of the split func. However, this does not allow us to validate some detailed expectations of the split funcs, such as what they report for `advance`. This is a new framework for testing split funcs. It's attempts to thoroughly exercise the "read more" behavior of every function. It has capabilities for inserting sleeps in between steps, and always validates that each test ends with the split func returning a "read more", indicating that it can find no more tokens in the input.
c0d3257
to
3fb7794
Compare
@open-telemetry/collector-contrib-approvers, this is waiting for a review. |
dmitryax
approved these changes
Sep 26, 2023
jmsnll
pushed a commit
to jmsnll/opentelemetry-collector-contrib
that referenced
this pull request
Nov 12, 2023
…try#27074) Subset of open-telemetry#26717 Our current split func tests depend on a `bufio.Scanner`, which has the advantage of being somewhat similar to our typical usage of the split func. However, this does not allow us to validate some detailed expectations of the split funcs, such as what they report for `advance`. This is a new framework for testing split funcs. It's attempts to thoroughly exercise the "read more" behavior of every function. It has capabilities for inserting sleeps in between steps, and always validates that each test ends with the split func returning a "read more", indicating that it can find no more tokens in the input.
jmsnll
pushed a commit
to jmsnll/opentelemetry-collector-contrib
that referenced
this pull request
Nov 12, 2023
…ry#26717) This PR migrates all tests in the `split` package to the new framework. Notable changes: - No longer a need to have special non-standard tests. These are either redundant, or were absorbed into the standard pattern. - Flush at EOF tests moved into standard pattern. - Encoded newline tests moved into standard pattern. - Removes tests relating to flushing, as these are a concern of the `flush` package now. - Removes tests relating to trimming, as these are a concern of the `trim` package now. - Removes tests for buffer overflow, as these were caused by using `bufio.Scanner`.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR migrates all tests in the
split
package to the new framework.Notable changes:
flush
package now.trim
package now.bufio.Scanner
.