Winetests Health Indicator

Suggestions and comments about the ReactOS website

Moderator: Moderator Team

Post Reply
Lone_Rifle
Test Team
Posts: 802
Joined: Thu Apr 03, 2008 2:17 pm
Contact:

Winetests Health Indicator

Post by Lone_Rifle »

I've been working on the abovementioned whilst in the office, since I had some time to spare. Due to company restrictions, I will have to rewrite this when I get home, and only then after I sort out my other personal things. For now though, here's how it currently looks like (revision is r43681):
[ external image ]

The concept for colour rendering is thus:
For 0-50% failures within each test, the colour goes from RGB value 00FF00 to FFFF00.
For 50% and above, FFFF00 to FF0000.

The failure rate is of course expressed as failures/tests.

For <50%, we have to scale red between 0 and 255, so effectively we mult the rate by 2, so that the range covers 2 * rate * 255 = 0 to 255, instead of 0 to 127 with rate*255.

For >50%, we have to scale blue from 255 to 0, so we subtract 0.5 from the rate, and then mult by 2, so that we cover 255 - ((rate-0.5)*2*255) = 510 - (2*rate*255). as rate goes from 0.5 to 1, blue hence goes from 255 to 0.

The pseudocode that determines the colour is thus as follows:

Code: Select all

sub doColour{
   my ($tests,$failures) = @_;
   if ($tests == 0){
     return ($failures == 0)? '00FF00' : 'FF0000';
   }
   return 'FF0000' if ($tests < $failures);
   my $offset = $failures * 2 * 255 / $tests;
   if ($offset < 255){
     return sprintf("%02X",$offset).'FF00';
   }else{
     return 'FF'.sprintf("%02X",510-$offset).'00';
   }
}
Last edited by Lone_Rifle on Sun Oct 25, 2009 12:37 pm, edited 1 time in total.
vicmarcal
Test Team
Posts: 2733
Joined: Mon Jul 07, 2008 12:35 pm

Re: Winetests Health Indicator

Post by vicmarcal »

I see a lot of greenn wweeeeee
is that good right? :p
Lone_Rifle
Test Team
Posts: 802
Joined: Thu Apr 03, 2008 2:17 pm
Contact:

Re: Winetests Health Indicator

Post by Lone_Rifle »

Okay, evidently, it's not possible to see which winetests have no failures and which ones have a few, so I'm changing the algo: If there's at least one failure, the colour will scale from yellow to red, otherwise the colour will be green.

Code: Select all

function doColour($tests,$failures){
    if ($failures == 0) return array(0,255,0);
    if ($failures >= $tests) return array(255,0,0);
    $offset = intval($failures * 255 / $tests);
    return array(255,255-$offset,0);
}
Last edited by Lone_Rifle on Sun Oct 25, 2009 12:40 pm, edited 1 time in total.
Lone_Rifle
Test Team
Posts: 802
Joined: Thu Apr 03, 2008 2:17 pm
Contact:

Re: Winetests Health Indicator

Post by Lone_Rifle »

I've been implementing the entire thing in PHP so far, and the only thing that's left to be done is to find a host which allows access to external URLs, and then hooking that functionality into the script. For now though, it processes a csv which is already there (specifically, the results for r43719). End result is thus:
[ external image ]

Code is as follows:

Code: Select all

<?php 
/** START **/
$build = $_GET['build'];

header('Content-Type: image/jpeg');
$location = 'Results.csv';
$results = getResults($location);
$image = generateImage($results);
imagejpeg($image);
imagedestroy($image);
/** END **/

function getResults(&$location){
  $results = array();
  if ($handle = fopen($location, 'rt')) {
    $buffer='';

    while (!feof($handle) ) {
        $values = fgetcsv($handle,1024,';');
        if ($values[0] != ''){
            $test = (strcmp($values[2],'OK') == 0)? 
                doColour($values[3],$values[4]) : array(255,0,0); 
            array_push($results,$test);
        }
    }
    fclose($handle);
  }
  return $results;
}

function generateImage(&$results){
    $count = count($results);
    $height = 20;
    $resultwidth = 1;
    $image = imagecreatetruecolor($count*$resultwidth,$height);
   
    for ($i = 0; $i < $count; $i++) {
        $result = $results[$i];
        $offset = $i*$resultwidth;
        $colour = imagecolorallocate($image,$result[0],$result[1],$result[2]);
        imagefilledrectangle($image,$offset,0,$offset + ($resultwidth-1),$height-1,$colour);
    }
    return $image;
}

function doColour(&$tests,&$failures){
    if ($failures == 0) return array(0,255,0);
    if ($failures >= $tests) return array(255,0,0);
    $offset = intval($failures * 255 / $tests);
    return array(255,255-$offset,0);
}
?>
Last edited by Lone_Rifle on Sun Oct 25, 2009 1:46 pm, edited 1 time in total.
vicmarcal
Test Team
Posts: 2733
Joined: Mon Jul 07, 2008 12:35 pm

Re: Winetests Health Indicator

Post by vicmarcal »

Uhmmm...so much scary this last bar, i mean: Do we have so many test failing?

We are testing 7304292 tests while we are failing "just" 4158 tests which is 0.05% of all the tests.
The second bar gives me the feeling that we are failing much much much more than 0.05%.
Btw, how many test arent we executing?Can it be shown?Not executing as we are skipping since the failed tests are closing the possibility of testing them. And another question: Is it counting the WIne-TODOs as failed?it would be nice if we can discount or represent those tests that Wine isnt passing :)
Lone_Rifle
Test Team
Posts: 802
Joined: Thu Apr 03, 2008 2:17 pm
Contact:

Re: Winetests Health Indicator

Post by Lone_Rifle »

We may be having very few failures, but don't forget these are spread across a bunch of modules. I want to give a sense of the number of modules where we are not passing 100%. I can't determine if a test executed is a wine to-do, since I'm processing a statistics file, not the log itself... Don't know if we can include information about skipped tests as well...
vicmarcal
Test Team
Posts: 2733
Joined: Mon Jul 07, 2008 12:35 pm

Re: Winetests Health Indicator

Post by vicmarcal »

Maybe another Round-cheese graphics with % of Failed,%Nontested, %Passed.
Optimally would be nice if on Failed we can see TODO´sWine separated from own ReactOS fail. Same with Skipped/Nontested dividing between the skipped because a TODO-Wine or because an own fail. But as you say that isnt possible now ;) as you are using Logs and Logs doesnt show this separation.
I think these Round Cheese graphics could be a nice visual way for obtaining details of a set of tests(Maybe clicking on the Winetests Health Indicator can open these graphics?With the typical information Mouse over.)And/Or also accessing via clicking on the name of the subset of tests ;) and comparing Round-cheese graphics instead numbers and numbers. :)

the Winetests Cheesecake Indicator (WCI)!! :p

TestMan v2? :)
healthywz
Posts: 1
Joined: Fri Feb 07, 2025 9:30 am
Contact:

Re: Winetests Health Indicator

Post by healthywz »

I’ve been following ReactOS development for a while now, and it’s fascinating to see how the project has evolved over the years. The discussion about system health, stability, and long-term reliability is particularly relevant as more users consider alternative operating systems.

One of the key factors in ensuring a stable OS is efficient memory management and robust error handling. Given that ReactOS is still in alpha, what are the biggest challenges the team is facing in improving system stability? Are there any ongoing initiatives to enhance how ReactOS handles resource allocation to prevent crashes and performance bottlenecks?
bank118
Posts: 1
Joined: Sun Feb 09, 2025 12:17 am
Contact:

Re: Winetests Health Indicator

Post by bank118 »

It looks like you're working on an algorithm for color rendering based on failure rates in tests. Below, I’ve written out a structured pseudocode to match the explanation you provided regarding how the RGB values are adjusted based on the failure rate:
Color Rendering Pseudocode

// Function to calculate the RGB color based on failure rate
function calculateColor(failureRate):
// Initialize red, green, and blue values
red = 0
green = 0
blue = 255

// Handle failure rate less than 50% (0 to 0.5)
if failureRate < 0.5:
// Scale red and green values
red = failureRate * 2 * 255
green = 255 - red
// Handle failure rate greater than or equal to 50% (0.5 to 1)
else:
// Scale blue and red values
blue = 255 - (2 * (failureRate - 0.5) * 255)
red = (failureRate - 0.5) * 2 * 255
green = 255 - red

// Ensure all RGB values are within valid bounds (0 to 255)
red = clamp(red, 0, 255)
green = clamp(green, 0, 255)
blue = clamp(blue, 0, 255)

// Return the calculated RGB color
return (red, green, blue)

// Helper function to ensure the RGB values are within the range of 0 to 255
function clamp(value, min, max):
if value < min:
return min
if value > max:
return max
return value

Explanation:

For failure rates between 0 and 50% (failureRate < 0.5):
The red value is directly proportional to the failure rate, i.e., it scales between 0 and 255.
The green value decreases from 255 to 0 as the failure rate increases from 0 to 50%.

For failure rates between 50% and 100% (failureRate >= 0.5):
The blue value decreases as the failure rate increases, going from 255 to 0.
The red value increases as the failure rate goes up, starting from 0 and going up to 255.
The green value also adjusts similarly to balance the color transition.

Clamp Function: Ensures that the RGB values are within valid bounds (0 to 255), so no color component exceeds the maximum allowed value.

This pseudocode should give you the desired color rendering logic where:

Green to Yellow for failure rates below 50%
Yellow to Red for failure rates above 50

Let me know if you'd like any further adjustments!
MadWolf
Posts: 721
Joined: Sat Dec 31, 2005 4:19 am
Contact:

Re: Winetests Health Indicator

Post by MadWolf »

hi
looking at the first example I do not think it is a good way to show tests failed and tests passed

In the second example, the page has expired. "Notice: The website http://reactos.agilityhoster.com has expired."

I think having a 3 colour bar will be a better way to show the information the first part of the bar will be tests passed the second will be tests failed and the last part test skipped also this will be more accessible for people who are cooler colour blind
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests