From 5d62b8dc771621305072e03e576a0eda49786aa7 Mon Sep 17 00:00:00 2001 From: windyboy Date: Wed, 24 Jul 2024 17:38:39 +0800 Subject: [PATCH] refactor: Add DLA message parsing logic to BodyParser --- internal/config/config.go | 11 + internal/domain/dla.go | 25 +- internal/domain/dla_test.go | 26 +- internal/parsers/aviation_parser.go | 9 + internal/parsers/aviation_parser_test.go | 18 + internal/parsers/ginkgo.report | 905 +++++++++++++++++++++++ 6 files changed, 964 insertions(+), 30 deletions(-) create mode 100644 internal/parsers/ginkgo.report diff --git a/internal/config/config.go b/internal/config/config.go index 998cb97..0b3b687 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -100,6 +100,8 @@ const ( fplPatternString = `\((?P[A-Z]{3})-(?P[A-Z]+\d+)-(?P[A-Z]{2})\n-(?P[A-Z]+\d+\/?[A-Z]?)\n?-(?P.*)\n?-(?P[A-Z]{4})(?P\d{4})\n?-(?P[A-Z]+\d+)(?P[A-Z0-9]+)\s+(?P(.|\n)+)\n-(?P[A-Z]{4})(?P\d{4})\s?(?P(\s[A-Z]{4})+)\n?-([A-Z]{3}\/(?:[A-Z]{4}\d{4}\s?)+)?(?P(?m)[A-Z]{3}\/(.|\n)*)\)$` cnlPatternString = `^\((?P[A-Z]{3})-(?P\w+\d+)-?(?P[A-Z]{4})?-?(?[A-Z]{4})\)$` + + dlaPatternString = `^\((?P[A-Z]{3})-(?P\w+\d+)-?(?P[A-Z]{4})(?P\d{4})?-?(?[A-Z]{4})(?\d{4})?\)$` ) // Initialize the bodyPatterns map @@ -140,6 +142,15 @@ var bodyPatterns = map[string]BodyConfig{ }, }, }, + "DLA": { + Patterns: []PatternConfig{ + { + Pattern: dlaPatternString, + Comments: "Pattern for DLA message", + Expression: regexp.MustCompile(dlaPatternString), + }, + }, + }, } func GetBodyPatterns() map[string]BodyConfig { diff --git a/internal/domain/dla.go b/internal/domain/dla.go index 6de0839..df59a6b 100644 --- a/internal/domain/dla.go +++ b/internal/domain/dla.go @@ -56,14 +56,14 @@ Description: Optional field for any additional relevant information. // DLA 电报体中的延误报文结构 type DLA struct { - Category string `json:"category"` // 电报类别 - AircraftID string `json:"aircraft_id"` // 航空器识别标志 - SSRModeAndCode string `json:"ssr_mode_and_code"` // SSR 模式及编码 - DepartureAirport string `json:"departure_airport"` // 起飞机场 - NewDepartureTime string `json:"new_departure_time"` // 新的起飞时间 - ArrivalAirport string `json:"arrival_airport"` // 到达机场 - EstimatedElapsedTime string `json:"estimated_elapsed_time"` // 估计总耗时 - OtherInfo string `json:"other_info,omitempty"` // 其他信息 (optional) + Category string `json:"category"` // 电报类别 + AircraftID string `json:"aircraft_id"` // 航空器识别标志 + SSRModeAndCode string `json:"ssr_mode_and_code,omitempty"` // SSR 模式及编码 + DepartureAirport string `json:"departure_airport"` // 起飞机场 + NewDepartureTime string `json:"new_departure_time,omitempty"` // 新的起飞时间 + ArrivalAirport string `json:"arrival_airport"` // 到达机场 + ArrivalTime string `json:"estimated_elapsed_time,omitempty"` // 估计总耗时 + OtherInfo string `json:"other_info,omitempty"` // 其他信息 (optional) } // Validate validates the DLA struct fields @@ -74,20 +74,11 @@ func (d *DLA) Validate() error { if d.AircraftID == "" { return fmt.Errorf("aircraft id is required") } - if d.SSRModeAndCode == "" { - return fmt.Errorf("ssr mode and code is required") - } if d.DepartureAirport == "" { return fmt.Errorf("departure airport is required") } - if d.NewDepartureTime == "" { - return fmt.Errorf("new departure time is required") - } if d.ArrivalAirport == "" { return fmt.Errorf("arrival airport is required") } - if d.EstimatedElapsedTime == "" { - return fmt.Errorf("estimated elapsed time is required") - } return nil } diff --git a/internal/domain/dla_test.go b/internal/domain/dla_test.go index ecfa568..b352959 100644 --- a/internal/domain/dla_test.go +++ b/internal/domain/dla_test.go @@ -13,14 +13,14 @@ var _ = Describe("DLA", func() { BeforeEach(func() { original = DLA{ - Category: "DLA", - AircraftID: "ABCD1234", - SSRModeAndCode: "A1234", - DepartureAirport: "JFK", - NewDepartureTime: time.Now().Add(1 * time.Hour).Format("150405"), // HHMMSS format - ArrivalAirport: "LAX", - EstimatedElapsedTime: "0500", // Example format - OtherInfo: "Test flight delay", + Category: "DLA", + AircraftID: "ABCD1234", + SSRModeAndCode: "A1234", + DepartureAirport: "JFK", + NewDepartureTime: time.Now().Add(1 * time.Hour).Format("150405"), // HHMMSS format + ArrivalAirport: "LAX", + ArrivalTime: "0500", // Example format + OtherInfo: "Test flight delay", } }) @@ -47,11 +47,11 @@ var _ = Describe("DLA", func() { invalidDLA := DLA{ Category: "DLA", // AircraftID is missing - SSRModeAndCode: "A1234", - DepartureAirport: "JFK", - NewDepartureTime: "150405", - ArrivalAirport: "LAX", - EstimatedElapsedTime: "0500", + SSRModeAndCode: "A1234", + DepartureAirport: "JFK", + NewDepartureTime: "150405", + ArrivalAirport: "LAX", + ArrivalTime: "0500", } err := invalidDLA.Validate() diff --git a/internal/parsers/aviation_parser.go b/internal/parsers/aviation_parser.go index b99a3b9..8eb8c6c 100644 --- a/internal/parsers/aviation_parser.go +++ b/internal/parsers/aviation_parser.go @@ -126,6 +126,15 @@ func (bp *BodyParser) createBodyData(data map[string]string) (string, interface{ DepartureAirport: data["departure"], DestinationAirport: data["destination"], }, nil + case "DLA": + return category, &domain.DLA{ + Category: data["category"], + AircraftID: data["number"], + DepartureAirport: data["departure"], + NewDepartureTime: data["departure_time"], + ArrivalAirport: data["arrival"], + ArrivalTime: data["arrival_time"], + }, nil case "FPL": otherData := parseOther(data["other"]) return category, &domain.FPL{ diff --git a/internal/parsers/aviation_parser_test.go b/internal/parsers/aviation_parser_test.go index 5e0f568..0ef8456 100644 --- a/internal/parsers/aviation_parser_test.go +++ b/internal/parsers/aviation_parser_test.go @@ -228,6 +228,24 @@ NNNN` }) }) + Context("with DLA body", func() { + It("should parse the body correctly", func() { + body := "(DLA-CSN3133-ZGGG0110-ZBTJ)" + parser := NewBodyParser(body) + category, parsedBody, err := parser.Parse() + Expect(err).ToNot(HaveOccurred()) + Expect(parsedBody).ToNot(BeNil()) + Expect(category).To(Equal("DLA")) + Expect(parsedBody).To(BeAssignableToTypeOf(&domain.DLA{})) + dlaMessage := parsedBody.(*domain.DLA) + Expect(dlaMessage.AircraftID).To(Equal("CSN3133")) + Expect(dlaMessage.DepartureAirport).To(Equal("ZGGG")) + Expect(dlaMessage.NewDepartureTime).To(Equal("0110")) + Expect(dlaMessage.ArrivalAirport).To(Equal("ZBTJ")) + + }) + }) + }) Describe("Parse whole real message", func() { diff --git a/internal/parsers/ginkgo.report b/internal/parsers/ginkgo.report new file mode 100644 index 0000000..472e1d1 --- /dev/null +++ b/internal/parsers/ginkgo.report @@ -0,0 +1,905 @@ +[ + { + "SuitePath": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers", + "SuiteDescription": "Parsers Suite", + "SuiteLabels": [], + "SuiteSucceeded": true, + "SuiteHasProgrammaticFocus": false, + "SpecialSuiteFailureReasons": null, + "PreRunStats": { + "TotalSpecs": 22, + "SpecsThatWillRun": 1 + }, + "StartTime": "2024-07-24T17:38:12.204183+08:00", + "EndTime": "2024-07-24T17:38:12.204756+08:00", + "RunTime": 573176, + "SuiteConfig": { + "RandomSeed": 1721813889, + "RandomizeAllSpecs": false, + "FocusStrings": [ + "Aviation Parser ParseBody with DLA body" + ], + "SkipStrings": null, + "FocusFiles": null, + "SkipFiles": null, + "LabelFilter": "", + "FailOnPending": false, + "FailOnEmpty": false, + "FailFast": false, + "FlakeAttempts": 0, + "MustPassRepeatedly": 0, + "DryRun": false, + "PollProgressAfter": 0, + "PollProgressInterval": 0, + "Timeout": 3598113440305, + "EmitSpecProgress": false, + "OutputInterceptorMode": "", + "SourceRoots": null, + "GracePeriod": 30000000000, + "ParallelProcess": 1, + "ParallelTotal": 1, + "ParallelHost": "" + }, + "SpecReports": [ + { + "ContainerHierarchyTexts": [ + "Aviation Parser", + "ParseHeader", + "with a real ARR context" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 10 + }, + { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 11 + }, + { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 13 + } + ], + "ContainerHierarchyLabels": [ + [], + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 19 + }, + "LeafNodeLabels": [], + "LeafNodeText": "should get a clean body text", + "State": "skipped", + "StartTime": "2024-07-24T17:38:12.204386+08:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Aviation Parser", + "ParseHeader" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 10 + }, + { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 11 + } + ], + "ContainerHierarchyLabels": [ + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 29 + }, + "LeafNodeLabels": [], + "LeafNodeText": "should parse the header correctly", + "State": "skipped", + "StartTime": "2024-07-24T17:38:12.204407+08:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Aviation Parser", + "ParseHeader" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 10 + }, + { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 11 + } + ], + "ContainerHierarchyLabels": [ + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 57 + }, + "LeafNodeLabels": [], + "LeafNodeText": "should parse the header correctly with originator information", + "State": "skipped", + "StartTime": "2024-07-24T17:38:12.204416+08:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Aviation Parser", + "ParseBody", + "with ARR body (ARR-CES5470-ZBTJ-ZSHC1614)" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 10 + }, + { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 102 + }, + { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 104 + } + ], + "ContainerHierarchyLabels": [ + [], + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 107 + }, + "LeafNodeLabels": [], + "LeafNodeText": "should parse the body correctly", + "State": "skipped", + "StartTime": "2024-07-24T17:38:12.204425+08:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Aviation Parser", + "ParseBody", + "with ARR body" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 10 + }, + { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 102 + }, + { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 123 + } + ], + "ContainerHierarchyLabels": [ + [], + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 125 + }, + "LeafNodeLabels": [], + "LeafNodeText": "should parse the body (ARR-AB123/A1234-KJFK-KLAX1234) correctly", + "State": "skipped", + "StartTime": "2024-07-24T17:38:12.204434+08:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Aviation Parser", + "ParseBody", + "with ARR body" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 10 + }, + { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 102 + }, + { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 123 + } + ], + "ContainerHierarchyLabels": [ + [], + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 141 + }, + "LeafNodeLabels": [], + "LeafNodeText": "should parse the body (ARR-JAE7433/A0132-RKSI-ZBTJ1604) correctly", + "State": "skipped", + "StartTime": "2024-07-24T17:38:12.204472+08:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Aviation Parser", + "ParseBody", + "with DEP body" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 10 + }, + { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 102 + }, + { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 159 + } + ], + "ContainerHierarchyLabels": [ + [], + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 161 + }, + "LeafNodeLabels": [], + "LeafNodeText": "should parse the body (DEP-CYZ9017/A5633-ZBTJ1638-ZSPD) correctly", + "State": "skipped", + "StartTime": "2024-07-24T17:38:12.204484+08:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Aviation Parser", + "ParseBody", + "with FPL body" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 10 + }, + { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 102 + }, + { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 179 + } + ], + "ContainerHierarchyLabels": [ + [], + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 181 + }, + "LeafNodeLabels": [], + "LeafNodeText": "should parse the body correctly", + "State": "skipped", + "StartTime": "2024-07-24T17:38:12.204495+08:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Aviation Parser", + "ParseBody", + "with CNL body" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 10 + }, + { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 102 + }, + { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 216 + } + ], + "ContainerHierarchyLabels": [ + [], + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 218 + }, + "LeafNodeLabels": [], + "LeafNodeText": "should parse the body correctly", + "State": "skipped", + "StartTime": "2024-07-24T17:38:12.204503+08:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Aviation Parser", + "ParseBody", + "with DLA body" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 10 + }, + { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 102 + }, + { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 231 + } + ], + "ContainerHierarchyLabels": [ + [], + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 232 + }, + "LeafNodeLabels": [], + "LeafNodeText": "should parse the body correctly", + "State": "passed", + "StartTime": "2024-07-24T17:38:12.204518+08:00", + "EndTime": "2024-07-24T17:38:12.204659+08:00", + "RunTime": 141208, + "ParallelProcess": 1, + "NumAttempts": 1, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0, + "SpecEvents": [ + { + "SpecEventType": "Node", + "CodeLocation": { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 232 + }, + "TimelineLocation": { + "Order": 1, + "Time": "2024-07-24T17:38:12.204529+08:00" + }, + "Message": "should parse the body correctly", + "NodeType": "It" + }, + { + "SpecEventType": "Node (End)", + "CodeLocation": { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 232 + }, + "TimelineLocation": { + "Order": 3, + "Time": "2024-07-24T17:38:12.204655+08:00" + }, + "Message": "should parse the body correctly", + "Duration": 126585, + "NodeType": "It" + } + ] + }, + { + "ContainerHierarchyTexts": [ + "Aviation Parser", + "Parse whole real message", + "with a real ARR message" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 10 + }, + { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 251 + }, + { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 253 + } + ], + "ContainerHierarchyLabels": [ + [], + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 265 + }, + "LeafNodeLabels": [], + "LeafNodeText": "should parse the whole message correctly", + "State": "skipped", + "StartTime": "2024-07-24T17:38:12.204672+08:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Aviation Parser", + "Parse whole real message", + "with this real FPL message" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 10 + }, + { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 251 + }, + { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 287 + } + ], + "ContainerHierarchyLabels": [ + [], + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 316 + }, + "LeafNodeLabels": [], + "LeafNodeText": "should parse the whole message correctly", + "State": "skipped", + "StartTime": "2024-07-24T17:38:12.20468+08:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Aviation Parser", + "Utility Functions" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 10 + }, + { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 348 + } + ], + "ContainerHierarchyLabels": [ + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 350 + }, + "LeafNodeLabels": [], + "LeafNodeText": "should clean text correctly", + "State": "skipped", + "StartTime": "2024-07-24T17:38:12.204686+08:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Aviation Parser", + "Utility Functions" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 10 + }, + { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 348 + } + ], + "ContainerHierarchyLabels": [ + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 361 + }, + "LeafNodeLabels": [], + "LeafNodeText": "should parse start indicator correctly", + "State": "skipped", + "StartTime": "2024-07-24T17:38:12.204694+08:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Aviation Parser", + "Utility Functions" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 10 + }, + { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 348 + } + ], + "ContainerHierarchyLabels": [ + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 370 + }, + "LeafNodeLabels": [], + "LeafNodeText": "should return error for invalid start indicator line", + "State": "skipped", + "StartTime": "2024-07-24T17:38:12.2047+08:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Aviation Parser", + "Utility Functions" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 10 + }, + { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 348 + } + ], + "ContainerHierarchyLabels": [ + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 376 + }, + "LeafNodeLabels": [], + "LeafNodeText": "should parse priority and primary address correctly", + "State": "skipped", + "StartTime": "2024-07-24T17:38:12.204704+08:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Aviation Parser", + "Utility Functions" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 10 + }, + { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 348 + } + ], + "ContainerHierarchyLabels": [ + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 383 + }, + "LeafNodeLabels": [], + "LeafNodeText": "should return empty strings for invalid priority and primary address line", + "State": "skipped", + "StartTime": "2024-07-24T17:38:12.204712+08:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Aviation Parser", + "Utility Functions" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 10 + }, + { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 348 + } + ], + "ContainerHierarchyLabels": [ + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/aviation_parser_test.go", + "LineNumber": 390 + }, + "LeafNodeLabels": [], + "LeafNodeText": "should parse remaining lines correctly", + "State": "skipped", + "StartTime": "2024-07-24T17:38:12.20473+08:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Pattern Parser", + "FindPatterns" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/pattern_test.go", + "LineNumber": 8 + }, + { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/pattern_test.go", + "LineNumber": 10 + } + ], + "ContainerHierarchyLabels": [ + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/pattern_test.go", + "LineNumber": 11 + }, + "LeafNodeLabels": [], + "LeafNodeText": "should return the correct BodyConfig based on the message body", + "State": "skipped", + "StartTime": "2024-07-24T17:38:12.204735+08:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Pattern Parser", + "FindPatterns" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/pattern_test.go", + "LineNumber": 8 + }, + { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/pattern_test.go", + "LineNumber": 10 + } + ], + "ContainerHierarchyLabels": [ + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/pattern_test.go", + "LineNumber": 18 + }, + "LeafNodeLabels": [], + "LeafNodeText": "should return nil if no pattern matches", + "State": "skipped", + "StartTime": "2024-07-24T17:38:12.204743+08:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Pattern Parser", + "ParseBody" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/pattern_test.go", + "LineNumber": 8 + }, + { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/pattern_test.go", + "LineNumber": 25 + } + ], + "ContainerHierarchyLabels": [ + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/pattern_test.go", + "LineNumber": 26 + }, + "LeafNodeLabels": [], + "LeafNodeText": "should parse the message body and extract data based on patterns", + "State": "skipped", + "StartTime": "2024-07-24T17:38:12.204749+08:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + }, + { + "ContainerHierarchyTexts": [ + "Pattern Parser", + "ParseBody" + ], + "ContainerHierarchyLocations": [ + { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/pattern_test.go", + "LineNumber": 8 + }, + { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/pattern_test.go", + "LineNumber": 25 + } + ], + "ContainerHierarchyLabels": [ + [], + [] + ], + "LeafNodeType": "It", + "LeafNodeLocation": { + "FileName": "/Users/windy/Projects/airport/byia/poc/new-telegram/go-caatsm/internal/parsers/pattern_test.go", + "LineNumber": 37 + }, + "LeafNodeLabels": [], + "LeafNodeText": "should return nil if no patterns match", + "State": "skipped", + "StartTime": "2024-07-24T17:38:12.204753+08:00", + "EndTime": "0001-01-01T00:00:00Z", + "RunTime": 0, + "ParallelProcess": 1, + "NumAttempts": 0, + "MaxFlakeAttempts": 0, + "MaxMustPassRepeatedly": 0 + } + ] + } +]