Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'gitlab-reporter-fixed-for-real-hopefully' of https://gi…
…thub.com/baronfel/FAKE into release/next
- Loading branch information
Showing
4 changed files
with
56 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
module Fake.BuildServer.GitLab | ||
|
||
open Expecto | ||
open Fake.Core | ||
open Fake.BuildServer | ||
|
||
let testCases = [ | ||
test "can emit correct collapsed output" { | ||
let mutable messages = [] | ||
let writer _ _ newLine message = | ||
let message = if newLine then message + @"\n" else message | ||
messages <- message :: messages | ||
let sameTicks _ = 1L | ||
let sameColorMapper _ = System.ConsoleColor.White | ||
let listener = GitLab.GitLabTraceListener(writer, sameColorMapper, sameTicks) :> Fake.Core.ITraceListener | ||
|
||
let tag = KnownTags.Target("my_first_section") | ||
let traceMessages = [ | ||
TraceData.OpenTag(tag, Some "Header of the 1st collapsible section") | ||
TraceData.LogMessage("this line should be hidden when collapsed", true) | ||
TraceData.CloseTag(tag, System.TimeSpan.FromSeconds 1., TagStatus.Success) | ||
] | ||
for trace in traceMessages do | ||
listener.Write trace | ||
|
||
let inOrder = List.rev messages | ||
let expected = [ | ||
@"section_start:1:target_my_first_section\r\e[0KHeader of the 1st collapsible section\n" | ||
@"this line should be hidden when collapsed\n" | ||
@"section_end:1:target_my_first_section\r\e[0K\n" | ||
] | ||
Expect.equal inOrder expected "should have output the correct collapsible trace" | ||
} | ||
] | ||
|
||
|
||
[<Tests>] | ||
let tests = testList "Fake.BuildeServer.GitLab.Tests" testCases |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters