Skip to content

Commit

Permalink
fix (ui): unit-test display results (#2855)
Browse files Browse the repository at this point in the history
* fix (ui): unit-test display results

fix user issue CD-1862

before fix:
```
>       assert free_devices == host.flashcache_free_devices
E       AssertionError: assert [] == []
E         Left contains more items, first extra item:
E         Full diff:
E         - []
E         + []
```

with the fix:
```
>       assert free_devices == host.flashcache_free_devices
E       AssertionError: assert [<Mock id='139953411755408'>] == []
E         Left contains more items, first extra item: <Mock id='139953411755408'>
E         Full diff:
E         - [<Mock id='139953411755408'>]
E         + []
```

Signed-off-by: Yvonnick Esnault <yvonnick.esnault@corp.ovh.com>

* cr

Signed-off-by: Yvonnick Esnault <yvonnick.esnault@corp.ovh.com>
  • Loading branch information
yesnault authored Jun 11, 2018
1 parent cb23c74 commit 64208c7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import {Component, Input} from '@angular/core';
import {Table} from '../../../../../../shared/table/table';
import {TestCase, TestSuite} from '../../../../../../model/pipeline.model';

declare var ansi_up: any;

@Component({
selector: 'app-workflow-test-table',
templateUrl: './test.table.html',
Expand Down Expand Up @@ -76,11 +74,4 @@ export class WorkflowRunTestTableComponent extends Table {
}
}
}

getLogs(logs) {
if (logs && logs.value) {
return ansi_up.ansi_to_html(logs.value);
}
return '';
}
}
4 changes: 2 additions & 2 deletions ui/src/app/views/workflow/run/node/test/table/test.table.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
<tr *ngIf="tc.displayed && (tc.errors || tc.failures)" class="log">
<td>
<div *ngIf="tc.errors && tc.errors.length > 0">
<pre [innerHTML]="getLogs(e)" *ngFor="let e of tc.errors"></pre>
<pre *ngFor="let e of tc.errors">{{e.value}}</pre>
</div>
<div *ngIf="tc.failures && tc.failures.length > 0">
<pre [innerHTML]="getLogs(f)" *ngFor="let f of tc.failures"></pre>
<pre *ngFor="let f of tc.failures">{{f.value}}</pre>
</div>
</td>
</tr>
Expand Down

0 comments on commit 64208c7

Please sign in to comment.