Skip to content

common_test: empty heading resulting with no heading #10051

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

Open
wants to merge 1 commit into
base: maint
Choose a base branch
from

Conversation

u3s
Copy link
Contributor

@u3s u3s commented Jul 18, 2025

  • allow user to actually specify no heading in print output

@u3s u3s requested a review from Copilot July 18, 2025 08:37
@u3s u3s self-assigned this Jul 18, 2025
@u3s u3s added the team:PS Assigned to OTP team PS label Jul 18, 2025
Copilot

This comment was marked as outdated.

Copy link
Contributor

github-actions bot commented Jul 18, 2025

CT Test Results

  2 files   57 suites   1h 15m 23s ⏱️
451 tests 436 ✅ 15 💤 0 ❌
485 runs  467 ✅ 18 💤 0 ❌

Results for commit 09ea2f4.

♻️ This comment has been updated with latest results.

To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.

See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.

Artifacts

// Erlang/OTP Github Action Bot

@u3s u3s requested review from IngelaAndin and Whaileee July 18, 2025 09:58
- allow user to actually specify no heading in print output
@u3s u3s force-pushed the kuba/common_test/empty_heading/OTP-19714 branch from 7c1381c to 09ea2f4 Compare July 18, 2025 13:45
@u3s u3s requested a review from Copilot July 18, 2025 13:51
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR modifies the tc_print function in Common Test to allow users to specify no heading in print output. When an empty string is provided as the heading, the output will exclude the header and use single line break instead of double.

  • Updates heading handling logic to treat empty strings as "no heading" requests
  • Changes line break formatting based on whether a heading is present
Comments suppressed due to low confidence (1)

lib/common_test/src/ct_logs.erl:551

  • [nitpick] The variable name 'Parts' is somewhat generic. Consider a more descriptive name like 'FormatParts' or 'OutputParts' to clarify its purpose as components of the formatted output string.
            Parts =

Comment on lines +553 to +554
"" -> [Format, "\n"];
_ -> [get_header(Heading),Format,"\n\n"]
Copy link
Preview

Copilot AI Jul 18, 2025

Choose a reason for hiding this comment

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

The hardcoded line break pattern creates inconsistency. Consider defining constants or using a more systematic approach to handle line break variations, as this logic may need to be maintained consistently across similar formatting functions.

Suggested change
"" -> [Format, "\n"];
_ -> [get_header(Heading),Format,"\n\n"]
"" -> [Format, ?LINE_BREAK];
_ -> [get_header(Heading),Format,?LINE_BREAK, ?LINE_BREAK]

Copilot uses AI. Check for mistakes.

@u3s u3s added the testing currently being tested, tag is used by OTP internal CI label Jul 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team:PS Assigned to OTP team PS testing currently being tested, tag is used by OTP internal CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants