Project

General

Profile

action #128588

Updated by tinita over 1 year ago

## Observation 

 In https://openqa.opensuse.org/tests/3260493#investigation and https://openqa.opensuse.org/tests/3260745#investigation the tab is loading forever. The console points to a Javascript error: 
 ``` 
 test_result.js:105 Uncaught TypeError: Cannot read properties of null (reading '1') 
     at githashToLink (test_result.js:105:218) 
     at test_result.js:127:1680 
     at Array.forEach (<anonymous>) 
     at Object.renderInvestigationTab [as renderContents] (test_result.js:127:747) 
     at Object.success (test_result.js:85:187) 
     at fire (bootstrap.js:245:231) 
     at Object.fireWith [as resolveWith] (bootstrap.js:251:181) 
     at done (bootstrap.js:680:95) 
     at XMLHttpRequest.<anonymous> (bootstrap.js:693:314) 
 ``` 
 ``` 
 function githashToLink(value, repo) { 
     const logItems = value.split(/(?=^[0-9a-f])/gm); 
     const commits = []; 
     for (let i = 0; i < logItems.length; i++) { 
         const item = logItems[i]; 
         const match = item.match(/^([0-9a-f]{9}) (.*)/); 
         const sha = match[1];              // <-------- 
         const msg = match[2]; 
         commits.push({ 
             link: sha.link(repo + sha), 
             msg: msg, 
             stat: item.match(/^ .*/gm) 
         }); 
     } 
     return commits; 
 } 
 ``` 

 ## Steps to reproduce 
 * Click on https://openqa.opensuse.org/tests/3260493#investigation and observe the error from developer console 

 ## Acceptance criteria 
 * **AC1:** No more JavaScript errors on the investigation tab 
 * **AC2:** A ui test exists 

 ## Suggestions 
 - See https://openqa.opensuse.org/tests/3260493/investigation_ajax for the returned json 
 - Narrow down what cases exhibit this issue (it did not fail tests and doesn't always break) 
 - Always check for a null result on regex matches

Back