Subject: Re: [tisdk-build-scripts][PATCH 07/10] Remove ability to generate build/test report per machine To: meta-arago@lists.yoctoproject.org From: "Jonathan Humphreys" X-Originating-Location: US (192.228.67.13) X-Originating-Platform: Windows Chrome 96 User-Agent: GROUPS.IO Web Poster MIME-Version: 1.0 Date: Mon, 29 Nov 2021 15:15:12 -0800 References: <1637640060-31733-20-git-send-email-denis@denix.org> In-Reply-To: <1637640060-31733-20-git-send-email-denis@denix.org> Message-ID: <22100.1638227712671833412@lists.yoctoproject.org> Content-Type: multipart/alternative; boundary="UF5HlUKev27PJG7suER0" --UF5HlUKev27PJG7suER0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Mon, Nov 22, 2021 at 08:01 PM, Denys Dmytriyenko wrote: >=20 > From: Denys Dmytriyenko >=20 > Signed-off-by: Denys Dmytriyenko Reviewed-by: Jonathan Humphreys >=20 > --- > lib/oesdk/generate-report | 295 > ---------------------------------------------- > 1 file changed, 295 deletions(-) > delete mode 100644 lib/oesdk/generate-report >=20 > diff --git a/lib/oesdk/generate-report b/lib/oesdk/generate-report > deleted file mode 100644 > index 86813ae..0000000 > --- a/lib/oesdk/generate-report > +++ /dev/null > @@ -1,295 +0,0 @@ > -#!/bin/bash > - > -# This script is intended to be called only from the top-level > build-oesdk.sh > -# script which parses the configuration file and sets necessary > variables. > -# So check if it is being called from any other context and if so exit. > -if [ "`basename $0`" !=3D "build-oesdk.sh" ] > -then > - log $error_log echo "This is a helper script and should not be run > directly" > - exit 1 > -fi > - > -write_results_header() { > -cat >> $results_file << EOM > - > - > - > -Status for `date +%D` > - > - > - > - > -

Status for `date +%D`

> - > -

BUILD_ID: $BUILD_ID

> - > -

Clean Build: $CLEAN_BUILD

> - > -

Clean Sources: $CLEAN_ALL

> -EOM > -} > - > -write_results_footer() { > -cat >> $results_file << EOM > - > -

> -These builds were performed using the build-oesdk.sh script at: > -

> -

> -git://git.ti.com/arago-project/tisdk-build-scripts.git > -

> - > -

> -The configuration file passed to this script had the contents: > -

> -

> -EOM > - > -if [ "$RESULTS_CONFIG_COMMENTS" =3D=3D "true" ] > -then > - filter=3D"" > -else > - filter=3D"/^[^#]/" > -fi > - > -awk "$filter { print \$0 \"
\"; }" $SCRIPTS_ROOT/$inputfile >> > $results_file > - > -cat >> $results_file << EOM > -

> - > - > - > -EOM > -} > - > -write_repos_table() { > -cat >> $results_file << EOM > -

Repository Revisions

> - > - > - > - > - > - > - > - > - > -EOM > - > - while read line > - do > - # clean the parsing variables for each run > - name=3D"" > - uri=3D"" > - branch=3D"" > - commit=3D"" > - repo_layers=3D"" > - > - # Skip empty lines > - if [ "x$line" =3D "x" ] > - then > - continue > - fi > - > - # Skip comment lines > - echo $line | grep -e "^#" > /dev/null > - if [ "$?" =3D "0" ] > - then > - continue > - fi > - > - # If the line starts with OECORE then skip it > - echo $line | grep -e "^OECORE.*=3D" > /dev/null > - if [ "$?" =3D "0" ] > - then > - continue > - fi > - > - name=3D`echo $line | cut -d, -f1` > - uri=3D`echo $line | cut -d, -f2` > - branch=3D`echo $line | cut -d, -f3` > - commit=3D`echo $line | cut -d, -f4` > - repo_layers=3D`echo $line | cut -d, -f5-` > - > -cat >> $results_file << EOM > - > - > - > - > - > - > - > -EOM > - done < $CONFIG_FILE > - > -echo "
RepositoryGit URLBranchCommit IDLayers
$name$uri$branch$commit$repo_layers
" >> $results_file > -} > - > -# Set the color of the status box. Basically if the status value has > -# "FAILED" in it anywhere then set the color to red, if the status > -# value is "SKIPPED" then set the colow to yellow, else set it to green > -set_status_color() { > - status=3D"$1" > - if echo $status | grep "FAILED" > /dev/null 2>&1 > - then > - echo "red" > - elif echo $status | grep "SKIPPED" > /dev/null 2>&1 > - then > - echo "yellow" > - else > - echo "lime" > - fi > -} > - > -write_machine_results() { > - m=3D"$1" > - > - build_result=3D`cat $LOG_DIR/$m-build-result.txt` > - > - if [ "$build_result" =3D=3D "PASSED" ] > - then > - test_result=3D`cat $LOG_DIR/$m-test-result.txt` > - else > - test_result=3D"SKIPPED" > - fi > - > - build_res_color=3D`set_status_color $build_result` > - test_res_color=3D`set_status_color $test_result` > - > -cat >> $results_file << EOM > - > - $m > - $build_result > - $test_result > - > -EOM > - > -} > - > -write_results_table() { > -cat >> $results_file << EOM > -

Build and Target Test Results

> - > - > - > - > - > - > -EOM > - > - for m in $MACHINES > - do > - write_machine_results $m > - done > - > -echo "
MachineBuild ResultTarget Test Result
" >> $results_file > -} > - > -write_sdk_machine_results() { > - m=3D"$1" > - > - if [ -e "$LOG_DIR/$m-build-installer.txt" ] > - then > - installer_result=3D`cat $LOG_DIR/$m-build-installer.txt` > - else > - installer_result=3D"SKIPPED" > - fi > - > - if [ -e "$LOG_DIR/$m-build-sdcard.txt" ] > - then > - sdcard_result=3D`cat $LOG_DIR/$m-build-sdcard.txt` > - else > - sdcard_result=3D"SKIPPED" > - fi > - > - if [ -e "$LOG_DIR/$m-web-results.txt" ] > - then > - web_result=3D`cat $LOG_DIR/$m-web-results.txt` > - else > - web_result=3D"SKIPPED" > - fi > - > - installer_res_color=3D`set_status_color $installer_result` > - sdcard_res_color=3D`set_status_color $sdcard_result` > - web_res_color=3D`set_status_color $web_result` > - > -cat >> $results_file << EOM > - > - $m > - bgcolor=3D$installer_res_color>$installer_result > - $sdcard_result<= /td> > - $web_result > - > -EOM > - > -} > - > -write_sdk_results_table() { > -cat >> $results_file << EOM > -

SDK Build Results

> - > - > - > - > - > - > - > -EOM > - > - for m in $MACHINES > - do > - write_sdk_machine_results $m > - done > - > -echo "
MachineInstaller BuildSD Card BuildWeb Build
" >> $results_file > -} > - > -generate_report() { > - results_dir=3D"$DEPLOY_ROOT/results/$BUILD_ID" > - results_file=3D"$results_dir/results.html" > - > - if [ -e $results_dir ] > - then > - rm -rf $results_dir > - fi > - > - mkdir -p $results_dir > - > - # Copy all of the logs to the results directory > - cp -rv $LOG_DIR $results_dir > - > - write_results_header > - > - write_repos_table > - > - write_results_table > - > - if [ "$PRODUCTIZE_SDK" =3D=3D "true" ] > - then > - write_sdk_results_table > - fi > - > - write_results_footer > - > - # TODO: Add log files to the report and be sure to copy the files to > - # the results_dir > - > - # If BACKUP_RESULTS is not empty then copy the results_file to the > - # directory it points to. > - if [ "$BACKUP_RESULTS" !=3D "" ] > - then > - mkdir -p $BACKUP_RESULTS > - cp $results_file $BACKUP_RESULTS/ > - fi > - > - # Lastly, for niceness sake let's create a link to the results in the > - # SDK directory. > - for m in $MACHINES > - do > - if [ -d $DEPLOY_ROOT/$m ] > - then > - ln -sf $results_file $DEPLOY_ROOT/$m/results.html > - fi > - done > -} > - > -- > 2.7.4 --UF5HlUKev27PJG7suER0 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Mon, Nov 22, 2021 at 08:01 PM, Denys Dmytriyenko wrote:
From: Denys Dmytriyenko <denys@konsulko.com>

S= igned-off-by: Denys Dmytriyenko <denys@konsulko.com>
Reviewed-by: Jonathan Humphreys <= j-humphreys@ti.com>
---
lib/oesdk/generate-report | 295 ----------------------= ------------------------
1 file changed, 295 deletions(-)
delete = mode 100644 lib/oesdk/generate-report

diff --git a/lib/oesdk/gen= erate-report b/lib/oesdk/generate-report
deleted file mode 100644
index 86813ae..0000000
--- a/lib/oesdk/generate-report
+++ /dev/= null
@@ -1,295 +0,0 @@
-#!/bin/bash
-
-# This script is= intended to be called only from the top-level build-oesdk.sh
-# scrip= t which parses the configuration file and sets necessary variables.
-#= So check if it is being called from any other context and if so exit.
-if [ "`basename $0`" !=3D "build-oesdk.sh" ]
-then
- log $error= _log echo "This is a helper script and should not be run directly"
- e= xit 1
-fi
-
-write_results_header() {
-cat >> $re= sults_file << EOM
-<html>
-<head>
-<tit= le>
-Status for `date +%D`
-</title>
-</head>=
-<body>
-
-<h2>Status for `date +%D`</h2>=
-
-<h2>BUILD_ID: $BUILD_ID</h2>
-
-<h2&= gt;Clean Build: $CLEAN_BUILD</h2>
-
-<h2>Clean Source= s: $CLEAN_ALL</h2>
-EOM
-}
-
-write_results_foote= r() {
-cat >> $results_file << EOM
-
-<p><= br />-These builds were performed using the build-oesdk.sh script at:
= -</p>
-<p>
-git://git.ti.com/arago-project/tisdk-buil= d-scripts.git
-</p>
-
-<p>
-The configurati= on file passed to this script had the contents:
-</p>
-<= p>
-EOM
-
-if [ "$RESULTS_CONFIG_COMMENTS" =3D=3D "true" = ]
-then
- filter=3D""
-else
- filter=3D"/^[^#]/"
-= fi
-
-awk "$filter { print \$0 \"<br>\"; }" $SCRIPTS_ROOT/$= inputfile >> $results_file
-
-cat >> $results_file &l= t;< EOM
-</p>
-
-</body>
-</html><= br />-EOM
-}
-
-write_repos_table() {
-cat >> $re= sults_file << EOM
-<h2><u>Repository Revisions</u= ></h2>
-<table border=3D1 cellspacing=3D1 cellpadding=3D1&= gt;
- <tr>
- <th>Repository</th>
- <th&= gt;Git URL</th>
- <th>Branch</th>
- <th>C= ommit ID</th>
- <th>Layers</th>
- </tr>-
-EOM
-
- while read line
- do
- # clean the = parsing variables for each run
- name=3D""
- uri=3D""
- bran= ch=3D""
- commit=3D""
- repo_layers=3D""
-
- # Skip emp= ty lines
- if [ "x$line" =3D "x" ]
- then
- continue
- = fi
-
- # Skip comment lines
- echo $line | grep -e "^#" >= /dev/null
- if [ "$?" =3D "0" ]
- then
- continue
- fi=
-
- # If the line starts with OECORE then skip it
- echo $l= ine | grep -e "^OECORE.*=3D" > /dev/null
- if [ "$?" =3D "0" ]
- then
- continue
- fi
-
- name=3D`echo $line | cut -d= , -f1`
- uri=3D`echo $line | cut -d, -f2`
- branch=3D`echo $line = | cut -d, -f3`
- commit=3D`echo $line | cut -d, -f4`
- repo_layer= s=3D`echo $line | cut -d, -f5-`
-
-cat >> $results_file <= ;< EOM
- <tr>
- <td>$name</td>
- <td= >$uri</td>
- <td>$branch</td>
- <td>$c= ommit</td>
- <td>$repo_layers</td>
- </tr>= ;
-EOM
- done < $CONFIG_FILE
-
-echo "</table>= " >> $results_file
-}
-
-# Set the color of the status= box. Basically if the status value has
-# "FAILED" in it anywhere the= n set the color to red, if the status
-# value is "SKIPPED" then set t= he colow to yellow, else set it to green
-set_status_color() {
- = status=3D"$1"
- if echo $status | grep "FAILED" > /dev/null 2>&a= mp;1
- then
- echo "red"
- elif echo $status | grep "SKIPPED= " > /dev/null 2>&1
- then
- echo "yellow"
- else- echo "lime"
- fi
-}
-
-write_machine_results() {<= br />- m=3D"$1"
-
- build_result=3D`cat $LOG_DIR/$m-build-result.= txt`
-
- if [ "$build_result" =3D=3D "PASSED" ]
- then
= - test_result=3D`cat $LOG_DIR/$m-test-result.txt`
- else
- test_r= esult=3D"SKIPPED"
- fi
-
- build_res_color=3D`set_status_col= or $build_result`
- test_res_color=3D`set_status_color $test_result`-
-cat >> $results_file << EOM
- <tr>
= - <td>$m</td>
- <td id=3D"$m-build-result" bgcolor=3D$b= uild_res_color>$build_result</td>
- <td id=3D"$m-target-re= sult" bgcolor=3D$test_res_color>$test_result</td>
- </tr&g= t;
-EOM
-
-}
-
-write_results_table() {
-cat = >> $results_file << EOM
-<h2><u>Build and Targ= et Test Results</u></h2>
-<table border=3D1 cellspacing= =3D1 cellpadding=3D1>
- <tr>
- <th>Machine</th&= gt;
- <th>Build Result</th>
- <th>Target Test R= esult</th>
- </tr>
-EOM
-
- for m in $MACHI= NES
- do
- write_machine_results $m
- done
-
-echo= "</table>" >> $results_file
-}
-
-write_sdk_mac= hine_results() {
- m=3D"$1"
-
- if [ -e "$LOG_DIR/$m-build-i= nstaller.txt" ]
- then
- installer_result=3D`cat $LOG_DIR/$m-buil= d-installer.txt`
- else
- installer_result=3D"SKIPPED"
- fi<= br />-
- if [ -e "$LOG_DIR/$m-build-sdcard.txt" ]
- then
- s= dcard_result=3D`cat $LOG_DIR/$m-build-sdcard.txt`
- else
- sdcard= _result=3D"SKIPPED"
- fi
-
- if [ -e "$LOG_DIR/$m-web-result= s.txt" ]
- then
- web_result=3D`cat $LOG_DIR/$m-web-results.txt`<= br />- else
- web_result=3D"SKIPPED"
- fi
-
- installer= _res_color=3D`set_status_color $installer_result`
- sdcard_res_color= =3D`set_status_color $sdcard_result`
- web_res_color=3D`set_status_col= or $web_result`
-
-cat >> $results_file << EOM
-= <tr>
- <td>$m</td>
- <td id=3D"$m-installer= -result" bgcolor=3D$installer_res_color>$installer_result</td>
- <td id=3D"$m-sdcard-result" bgcolor=3D$sdcard_res_color>$sdcard_r= esult</td>
- <td id=3D"$m-web-result" bgcolor=3D$web_res_colo= r>$web_result</td>
- </tr>
-EOM
-
-}
-
-write_sdk_results_table() {
-cat >> $results_file <= < EOM
-<h2><u>SDK Build Results</u></h2>-<table border=3D1 cellspacing=3D1 cellpadding=3D1>
- <tr&= gt;
- <th>Machine</th>
- <th>Installer Build<= ;/th>
- <th>SD Card Build</th>
- <th>Web Bui= ld</th>
- </tr>
-EOM
-
- for m in $MACHINES=
- do
- write_sdk_machine_results $m
- done
-
-ech= o "</table>" >> $results_file
-}
-
-generate_rep= ort() {
- results_dir=3D"$DEPLOY_ROOT/results/$BUILD_ID"
- result= s_file=3D"$results_dir/results.html"
-
- if [ -e $results_dir ]- then
- rm -rf $results_dir
- fi
-
- mkdir -p $res= ults_dir
-
- # Copy all of the logs to the results directory
- cp -rv $LOG_DIR $results_dir
-
- write_results_header
-- write_repos_table
-
- write_results_table
-
- if = [ "$PRODUCTIZE_SDK" =3D=3D "true" ]
- then
- write_sdk_results_ta= ble
- fi
-
- write_results_footer
-
- # TODO: Add = log files to the report and be sure to copy the files to
- # the resul= ts_dir
-
- # If BACKUP_RESULTS is not empty then copy the results= _file to the
- # directory it points to.
- if [ "$BACKUP_RESULTS"= !=3D "" ]
- then
- mkdir -p $BACKUP_RESULTS
- cp $results_f= ile $BACKUP_RESULTS/
- fi
-
- # Lastly, for niceness sake le= t's create a link to the results in the
- # SDK directory.
- for = m in $MACHINES
- do
- if [ -d $DEPLOY_ROOT/$m ]
- then
= - ln -sf $results_file $DEPLOY_ROOT/$m/results.html
- fi
- done-}
-
--
2.7.4
--UF5HlUKev27PJG7suER0--