@@ -22,12 +22,12 @@ Feature: Pipeline tests using the flights dataset
2222 And there are no record rejections from the business_rules phase
2323 When I run the error report phase
2424 Then An error report is produced
25- # TODO - fix the stats calculations as they're currently incorrect for hiearchical datasets
26- # And The statistics entry for the submission shows the following information
27- # | parameter | value |
28- # | record_count | 1 |
29- # | number_file_rejections | 0 |
30- # | number_record_rejections | 0 |
25+ And The statistics entry for the submission shows the following information
26+ | parameter | value |
27+ | record_count | 1 |
28+ | number_submission_rejections | 0 |
29+ | number_record_rejections | 0 |
30+ | number_warnings | 0 |
3131
3232 Scenario : A flights submission where the root record is rejected
3333 Given I submit the flights file missing_country_id.xml for processing
@@ -44,21 +44,24 @@ Feature: Pipeline tests using the flights dataset
4444 When I run the data contract phase
4545 Then there are no file rejections from the data_contract phase
4646 And there is 1 record rejection from the data_contract phase
47+ # And there are errors with the following details and associated error_count from the data_contract phase
48+ # | ErrorType | ErrorCode | error_count |
49+ # | record | CountryIdIsMissing | 1 |
4750 When I run the business rules phase
4851 Then there are errors with the following details and associated error_count from the business_rules phase
49- | ErrorType | ErrorCode | error_count |
50- | record | AG1 | 3 |
51- | record | SG1 | 15 |
52- | record | FG1 | 10 |
53- | record | PG1 | 25 |
52+ | ErrorType | ErrorCode | error_count |
53+ | record | AirportHasNoCountry | 3 |
54+ | record | StaffHasNoAirport | 15 |
55+ | record | FlightHasNoAirport | 10 |
56+ | record | PassengerHasNoFlight | 25 |
5457 When I run the error report phase
5558 Then An error report is produced
56- # TODO - fix the stats calculations as they're currently incorrect for hiearchical datasets
57- # And The statistics entry for the submission shows the following information
58- # | parameter | value |
59- # | record_count | 1 |
60- # | number_file_rejections | 0 |
61- # | number_record_rejections | 1 |
59+ And The statistics entry for the submission shows the following information
60+ | parameter | value |
61+ | record_count | 1 |
62+ | number_submission_rejections | 0 |
63+ | number_record_rejections | 54 |
64+ | number_warnings | 0 |
6265
6366 Scenario : A flights submission where a child primary key is rejected
6467 Given I submit the flights file missing_flight_id.xml for processing
@@ -77,51 +80,47 @@ Feature: Pipeline tests using the flights dataset
7780 And there are no record rejections from the data_contract phase
7881 When I run the business rules phase
7982 Then there are errors with the following details and associated error_count from the business_rules phase
80- | ErrorType | ErrorCode | error_count |
81- | record | F1 | 1 |
82- | record | PG1 | 3 |
83+ | ErrorType | ErrorCode | error_count |
84+ | record | FlightIDMissing | 1 |
85+ | record | PassengerHasNoFlight | 3 |
8386 When I run the error report phase
8487 Then An error report is produced
85- #TODO - fix the stats calculations as they're currently incorrect for hiearchical datasets
86- # And The statistics entry for the submission shows the following information
87- # | parameter | value |
88- # | record_count | 1 |
89- # | number_file_rejections | 0 |
90- # | number_record_rejections | 1 |
88+ And The statistics entry for the submission shows the following information
89+ | parameter | value |
90+ | record_count | 1 |
91+ | number_submission_rejections | 0 |
92+ | number_record_rejections | 4 |
93+ | number_warnings | 0 |
9194
92- Scenario : A flights submission with a mixture of group and record rejections
93- Given I submit the flights file mixture_of_group_rej_and_bi_rej .xml for processing
95+ Scenario : A flights submission with no valid airports record on submission
96+ Given I submit the flights file only_country_id .xml for processing
9497 And A duckdb pipeline is configured with schema file 'flights.dischema.json'
9598 And I add initial audit entries for the submission
9699 Then the latest audit record for the submission is marked with processing status file_transformation
97100 When I run the file transformation phase
98101 Then the country entity is stored as a parquet after the file_transformation phase
99102 And the airport entity is stored as a parquet after the file_transformation phase
100103 And the flights entity is stored as a parquet after the file_transformation phase
101- And the staff entity is stored as a parquet after the file_transformation phase
102104 And the passengers entity is stored as a parquet after the file_transformation phase
103105 And the latest audit record for the submission is marked with processing status data_contract
104106 When I run the data contract phase
105107 Then there are no file rejections from the data_contract phase
106108 And there are no record rejections from the data_contract phase
107109 When I run the business rules phase
108110 Then there are errors with the following details and associated error_count from the business_rules phase
109- | ErrorType | ErrorCode | error_count |
110- | record | F1 | 1 |
111- | record | PG1 | 3 |
112- | record | P1 | 1 |
113- | record | S1 | 7 |
111+ | ErrorType | ErrorCode | error_count |
112+ | record | CountryHasNoAirport | 1 |
114113 When I run the error report phase
115114 Then An error report is produced
116- # TODO - fix the stats calculations as they're currently incorrect for hiearchical datasets
117- # And The statistics entry for the submission shows the following information
118- # | parameter | value |
119- # | record_count | 1 |
120- # | number_file_rejections | 0 |
121- # | number_record_rejections | 1 |
115+ And The statistics entry for the submission shows the following information
116+ | parameter | value |
117+ | record_count | 1 |
118+ | number_submission_rejections | 0 |
119+ | number_record_rejections | 1 |
120+ | number_warnings | 0 |
122121
123- Scenario : A flights submission with no valid airports record on submission
124- Given I submit the flights file only_country_id .xml for processing
122+ Scenario : A flights submission with a rejection on a node with one mandatory node
123+ Given I submit the flights file singular_node_rejections .xml for processing
125124 And A duckdb pipeline is configured with schema file 'flights.dischema.json'
126125 And I add initial audit entries for the submission
127126 Then the latest audit record for the submission is marked with processing status file_transformation
@@ -136,19 +135,22 @@ Feature: Pipeline tests using the flights dataset
136135 And there are no record rejections from the data_contract phase
137136 When I run the business rules phase
138137 Then there are errors with the following details and associated error_count from the business_rules phase
139- | ErrorType | ErrorCode | error_count |
140- | submission | C2 | 1 |
138+ | ErrorType | Status | ErrorCode | error_count |
139+ | record | error | InvalidFlightDestination | 2 |
140+ | record | error | PassengerHasNoFlight | 4 |
141+ | record | error | AirportHasNoStaff | 1 |
142+ | record | error | CountryHasNoAirport | 1 |
141143 When I run the error report phase
142144 Then An error report is produced
143- # TODO - fix the stats calculations as they're currently incorrect for hiearchical datasets
144- # And The statistics entry for the submission shows the following information
145- # | parameter | value |
146- # | record_count | 1 |
147- # | number_file_rejections | 0 |
148- # | number_record_rejections | 1 |
145+ And The statistics entry for the submission shows the following information
146+ | parameter | value |
147+ | record_count | 1 |
148+ | number_submission_rejections | 0 |
149+ | number_record_rejections | 8 |
150+ | number_warnings | 0 |
149151
150- Scenario : A flights submission with a mixture of group and orphan record rejections
151- Given I submit the flights file invalid_flight_destination .xml for processing
152+ Scenario : A flights submission with a rejection on a node with two mandatory nodes
153+ Given I submit the flights file multi_node_file_rejection .xml for processing
152154 And A duckdb pipeline is configured with schema file 'flights.dischema.json'
153155 And I add initial audit entries for the submission
154156 Then the latest audit record for the submission is marked with processing status file_transformation
@@ -157,21 +159,23 @@ Feature: Pipeline tests using the flights dataset
157159 And the airport entity is stored as a parquet after the file_transformation phase
158160 And the flights entity is stored as a parquet after the file_transformation phase
159161 And the passengers entity is stored as a parquet after the file_transformation phase
162+ And the passengers entity is stored as a parquet after the file_transformation phase
160163 And the latest audit record for the submission is marked with processing status data_contract
161164 When I run the data contract phase
162165 Then there are no file rejections from the data_contract phase
163166 And there are no record rejections from the data_contract phase
164167 When I run the business rules phase
165168 Then there are errors with the following details and associated error_count from the business_rules phase
166- | ErrorType | Status | ErrorCode | error_count |
167- | record | error | F2 | 2 |
168- | record | error | PG1 | 4 |
169- # | record | informational | A1 | 1 |
169+ | ErrorType | Status | ErrorCode | error_count |
170+ | record | error | StaffIDMissing | 6 |
171+ | record | error | AirportHasNoStaff | 1 |
172+ | record | error | FlightHasNoAirport | 1 |
173+ | record | error | PassengerHasNoFlight | 1 |
170174 When I run the error report phase
171175 Then An error report is produced
172- # TODO - fix the stats calculations as they're currently incorrect for hiearchical datasets
173- # And The statistics entry for the submission shows the following information
174- # | parameter | value |
175- # | record_count | 1 |
176- # | number_file_rejections | 0 |
177- # | number_record_rejections | 1 |
176+ And The statistics entry for the submission shows the following information
177+ | parameter | value |
178+ | record_count | 1 |
179+ | number_submission_rejections | 0 |
180+ | number_record_rejections | 9 |
181+ | number_warnings | 0 |
0 commit comments