oppia/oppia

[Feature Request]: Colorize the errors on CI for acceptance tests

Open

#21,448 opened on 2024年12月16日

GitHub で見る
 (70 comments) (0 reactions) (0 assignees)Python (3,534 forks)batch import
Impact: MediumWork: Lowenhancementgood first issue

Repository metrics

Stars
 (5,292 stars)
PR merge metrics
 (平均マージ 20d 19h) (30d で 71 merged PRs)

説明

Is your feature request related to a problem? Please describe.

It's challenging to identify the exact error for acceptance test fails in the CI run failure; we need to look at it closely, which is time-consuming.

Describe the solution (or solutions) you'd like

Highlight the errors on the CI similar to the E2E tests

[EDIT] Suggested technical approach (added based on discussion in #21971):

  • Implement the following in scripts/common.py:
    • A LogType enum with values INFO, ERROR, SUCCESS, WARNING, etc.
    • A log_to_terminal(message, message_type) function that takes two args, the message to be printed and the message type which should be one of the LogType enum values. The first argument is mandatory and the second argument is optional. If the second argument is provided then the appropriately-coloured log message is printed. If the second argument is not provided then the automatic functionality from process_logs_and_highlight_errors() should be used when deciding how to print the message.
  • Refactor the relevant scripts to use log_to_terminal() instead of print().

Describe alternatives you've considered and rejected

No response

Additional context

No response

コントリビューターガイド