|
23 | 23 | Value.Metadata([Value]),
|
24 | 24 | Config[Suite.MetaField]
|
25 | 25 | )
|
26 |
| - ) otherwise |
| 26 | + ) otherwise if LooksLikeSuiteWithError([Name], [Value]) |
| 27 | + then |
| 28 | + ErrorSuiteMarker |
| 29 | + else |
27 | 30 | null
|
28 | 31 | ),
|
29 | 32 | each [SuiteVersion] <> null
|
30 | 33 | ),
|
| 34 | + LooksLikeSuiteWithError = (name, object) => |
| 35 | + let |
| 36 | + NameLikeTest = Text.StartsWith(name, Config[Test.Prefix], Comparer.OrdinalIgnoreCase), |
| 37 | + ObjLikeError = |
| 38 | + Value.Is(object, type record) |
| 39 | + and Record.FieldCount(object) = 3 |
| 40 | + and Record.FieldNames(object) = {"Reason", "Message", "Detail"}, |
| 41 | + Return = NameLikeTest and ObjLikeError |
| 42 | + in |
| 43 | + Return, |
| 44 | + PropagateErrors = (suite) => |
| 45 | + #table( |
| 46 | + { "Test", "Result", "Status", "Description"}, |
| 47 | + {{ null, suite, "ERROR", suite[Reason] & ": " &suite[Message]}} |
| 48 | + ), |
| 49 | + ErrorSuiteMarker = "This looks like a test suite with invalid code", |
31 | 50 | SuitesValid =
|
32 | 51 | if Table.IsEmpty(SuitesFilter)
|
33 | 52 | then error Error.Record("LibPQ.TestsNotFound", "No tests were found among local modules", null)
|
|
39 | 58 | {"Suite", "Object", "Version"}
|
40 | 59 | })
|
41 | 60 | ),
|
42 |
| - SuiteRunners = Record.FromList( |
43 |
| - List.Transform( |
44 |
| - Record.FieldValues(Config[Suite.Runners]), |
45 |
| - each LibPQ(_) |
| 61 | + SuiteRunners = |
| 62 | + Record.AddField( |
| 63 | + Record.FromList( |
| 64 | + List.Transform( |
| 65 | + Record.FieldValues(Config[Suite.Runners]), |
| 66 | + each LibPQ(_) |
| 67 | + ), |
| 68 | + Record.FieldNames(Config[Suite.Runners]) |
| 69 | + ), |
| 70 | + ErrorSuiteMarker, |
| 71 | + PropagateErrors |
46 | 72 | ),
|
47 |
| - Record.FieldNames(Config[Suite.Runners]) |
48 |
| - ), |
49 | 73 | Run = Table.AddColumn(
|
50 | 74 | Suites,
|
51 | 75 | "Results",
|
|
0 commit comments