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

bugfix: add newline in stdout exporter #6848

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

zeitlinger
Copy link
Member

@zeitlinger zeitlinger commented Nov 4, 2024

fixes #6836

@zeitlinger zeitlinger requested a review from a team as a code owner November 4, 2024 11:10
Copy link

codecov bot commented Nov 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.49%. Comparing base (ef03239) to head (a732cbf).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #6848      +/-   ##
============================================
- Coverage     90.49%   90.49%   -0.01%     
- Complexity     6599     6600       +1     
============================================
  Files           731      731              
  Lines         19738    19742       +4     
  Branches       1938     1938              
============================================
+ Hits          17862    17865       +3     
  Misses         1285     1285              
- Partials        591      592       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -1115,7 +1115,9 @@ private static void assertMatches(String expected, String actual) {
*/
private static String toPattern(String expected) {
Map<String, String> replacePatterns = new HashMap<>();
replacePatterns.put("timestamp", "[0-9]+(\\.[0-9]+)?");
String timestampPattern = "[0-9]+(\\.[0-9]+)?";
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is fixing a flaky test, because nanos are omitted if 0

@zeitlinger
Copy link
Member Author

@jack-berg can you take a look?

@@ -38,6 +38,14 @@ public final void writeJsonTo(JsonGenerator output) throws IOException {
}
}

/** Marshals into the {@link JsonGenerator} in proto JSON format and adds a newline. */
public final void writeJsonWithNewline(JsonGenerator output) throws IOException {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this code call output.writeRaw('\n') or should StreamJsonWriter? Seems like an implementation detail of StreamJsonWriter to me.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried calling from StreamJsonWriter, but this method closes the generator, so it fails

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants