Opened 2 years ago

Closed 2 years ago

#22912 closed defect (fixed)

tpf parsing drops trailing newline

Reported by: iwakeh Owned by: iwakeh
Priority: High Milestone: metrics-lib 2.1.0
Component: Metrics/Library Version:
Severity: Normal Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

When descriptors are read from a file the trailing newline should be preserved (which is the case for all types except tpf desc.).

The raw-byte dump of TorperfResult drops the newlines at the end.

Setting to high-prio b/c this blocks #21759.

Child Tickets

Change History (10)

comment:1 Changed 2 years ago by karsten

Status: newneeds_review

Like this?

comment:2 Changed 2 years ago by iwakeh

That looks fine! Thanks for the quick fix!

I'll apply this to #21759 and once that works, set this ticket to merge-ready.

What about a test for that and the other trailing newlines?

comment:3 Changed 2 years ago by iwakeh

The fix works fine for #21759; test still welcome.

comment:4 Changed 2 years ago by karsten

Like this?

comment:5 Changed 2 years ago by iwakeh

Looks fine for the TorperfResult case, but shouldn't all descriptors end in newline?
If yes, the test could be run for several input data (parametrized test).
If no, there should be different tests and data for the various cases.

comment:6 Changed 2 years ago by karsten

I think it's okay to assume that all descriptors should end in newline. Would you want to add a parameterized test?

comment:7 in reply to:  6 Changed 2 years ago by iwakeh

Owner: changed from metrics-team to iwakeh
Status: needs_reviewaccepted

Replying to karsten:

I think it's okay to assume that all descriptors should end in newline. Would you want to add a parameterized test?

Yup, I can do that.
Setting to accepted.

comment:8 Changed 2 years ago by iwakeh

Status: acceptedneeds_review

Please review the branch with tests.

The tests verify most of the Descriptor methods and stay implementation independent.

The fix&tests could be released this week as preparation of CollecTor 1.3.0 (cf. #21759).

comment:9 Changed 2 years ago by iwakeh

Milestone: metrics-lib 2.1.0

comment:10 Changed 2 years ago by karsten

Resolution: fixed
Status: needs_reviewclosed

Merged with a tiny one-line tweak to the test data. Closing. Thanks!

Note: See TracTickets for help on using tickets.