-
Notifications
You must be signed in to change notification settings - Fork 83
Handle skipped tests in "Not run" column #3743
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The parts of this file which are used should be moved to a scope on the |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| <?php | ||
|
|
||
| namespace App\Utils; | ||
|
|
||
| use App\Models\Test; | ||
|
|
||
| final class TestDisplay | ||
| { | ||
| /** | ||
| * CTest sets Details="Disabled" for tests marked DISABLED. | ||
| */ | ||
| public const DISABLED_DETAILS = 'Disabled'; | ||
|
|
||
| public static function isAcceptableNotRun(?string $details): bool | ||
| { | ||
| return $details === self::DISABLED_DETAILS; | ||
| } | ||
|
|
||
| public static function statusColorClass(string $status, ?string $details): string | ||
| { | ||
| if ($status === Test::NOTRUN && self::isAcceptableNotRun($details)) { | ||
| return 'normal'; | ||
| } | ||
|
|
||
| return match ($status) { | ||
| Test::PASSED => 'normal', | ||
| Test::FAILED => 'error', | ||
| Test::NOTRUN => 'warning', | ||
| default => '', | ||
| }; | ||
| } | ||
|
|
||
| public static function statusTextColorClass(string $status, ?string $details): string | ||
| { | ||
| return match (self::statusColorClass($status, $details)) { | ||
| 'normal' => 'normal-text', | ||
| 'warning' => 'warning-text', | ||
| 'error' => 'error-text', | ||
| default => '', | ||
| }; | ||
| } | ||
|
|
||
| public static function graphqlStatusColorClass(string $status, ?string $details): string | ||
| { | ||
| $dbStatus = match ($status) { | ||
| 'NOT_RUN' => Test::NOTRUN, | ||
| 'PASSED' => Test::PASSED, | ||
| 'FAILED' => Test::FAILED, | ||
| default => strtolower($status), | ||
| }; | ||
|
|
||
| return self::statusColorClass($dbStatus, $details); | ||
| } | ||
| } |
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The changes to this file appear to be unnecessary now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Querying every test for every build on the index page is simply infeasible for the largest CDash instances. Instead, I think it would be better to add a
testnotrunwarningcolumn on thebuildtable. Doing so will require a migration to create and populate the column, as well as logic to populate the column on every Test.xml submission.