Skip to content

Commit

Permalink
feat: trial warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
shreddedbacon committed Nov 6, 2023
1 parent 7bb73dd commit 7d0f8a4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/LogViewer/LogAccordion/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const LogAccordion = forwardRef(
}}
>
<div key="1" className={'log-header' + (visibility ? ' visible' : '')}>
{header} {metadata.length > 0 ? '(' + metadata + ')' : ''}
{header} {metadata[0].length > 0 ? '(' + metadata[0] + ')' : ''} {metadata[1] == true ? '(WARNING)' : ''}
</div>
</div>
<div ref={logsTopRef} />
Expand Down
11 changes: 9 additions & 2 deletions src/components/LogViewer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ const logPreprocessorProcessParse = (tokens, sectionMetadata) => {
case 'section-opener':
let metadataForSection = sectionMetadata.get(tokens[i].details.trim());
if (metadataForSection == undefined) {
metadataForSection = '';
metadataForSection.push('');
}

let node = {
Expand Down Expand Up @@ -170,8 +170,15 @@ const logPreprocessorExtractSectionEndDetails = logs => {

if (stepName != '' && stepDetails != '') {
let durationArray = stepDetails.match(durationRegexp);
let hasWarnings = false
if (stepName.match(/.* Warning$/)) {
hasWarnings = true
}
let payload = new Array();
payload.push(`Duration: ${durationArray[1]}`)
payload.push(hasWarnings)
if (durationArray.length == 2) {
ret.set(stepName, `Duration: ${durationArray[1]}`);
ret.set(stepName, payload);
}
}
}
Expand Down

0 comments on commit 7d0f8a4

Please sign in to comment.