Skip to content

Commit 4382fd5

Browse files
authored
Merge pull request #548 from DataIntegrationGroup/marissa
feat(tests): relax validation rules and expand enum coverage in well-inventory-csv feature
2 parents 0d51464 + 2c21ace commit 4382fd5

2 files changed

Lines changed: 109 additions & 97 deletions

File tree

tests/features/water-level-csv.feature

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,20 @@ Feature: Bulk upload water level entries from CSV via CLI
2727
| field_staff |
2828
| well_name_point_id |
2929
| field_event_date_time |
30-
| water_level_date_time |
3130
| measuring_person |
32-
| sample_method |
33-
| mp_height |
34-
| level_status |
35-
| depth_to_water_ft |
36-
| data_quality |
3731
And each "well_name_point_id" value matches an existing well
32+
And "field_event_date_time" values are valid ISO 8601 timezone-naive datetime strings (e.g. "2025-02-15T08:00:00")
3833
And "water_level_date_time" values are valid ISO 8601 timezone-naive datetime strings (e.g. "2025-02-15T10:30:00")
3934
And the CSV includes optional fields when available:
4035
| optional field name |
4136
| field_staff_2 |
4237
| field_staff_3 |
38+
| water_level_date_time |
39+
| sample_method |
40+
| mp_height |
41+
| level_status |
42+
| depth_to_water_ft |
43+
| data_quality |
4344
| water_level_notes |
4445
When I run the CLI command:
4546
"""
@@ -60,19 +61,15 @@ Feature: Bulk upload water level entries from CSV via CLI
6061
Given my water level CSV file contains all required headers but in a different column order
6162
And the CSV includes required fields:
6263
| required field name |
64+
| field_staff |
6365
| well_name_point_id |
64-
| water_level_date_time |
66+
| field_event_date_time |
6567
| measuring_person |
66-
| sample_method |
67-
| mp_height |
68-
| level_status |
69-
| depth_to_water_ft |
70-
| data_quality |
7168
When I run the CLI command:
7269
"""
7370
oco water-levels bulk-upload --file ./water_levels.csv
7471
"""
75-
# assumes users are entering datetimes as Mountain Time becuase well location is restricted to New Mexico
72+
# assumes users are entering datetimes as Mountain Time because well location is restricted to New Mexico
7673
Then all datetime objects are assigned the correct Mountain Time timezone offset based on the date value.
7774
And the command exits with code 0
7875
And all water level entries are imported
@@ -117,14 +114,10 @@ Feature: Bulk upload water level entries from CSV via CLI
117114

118115
Examples:
119116
| required_field |
117+
| field_staff |
120118
| well_name_point_id |
121-
| water_level_date_time |
119+
| field_event_date_time |
122120
| measuring_person |
123-
| sample_method |
124-
| mp_height |
125-
| level_status |
126-
| depth_to_water_ft |
127-
| data_quality |
128121

129122
@negative @validation @date_formats @BDMS-TBD
130123
Scenario: Upload fails due to invalid date formats
@@ -148,13 +141,13 @@ Feature: Bulk upload water level entries from CSV via CLI
148141
And stderr should contain validation errors identifying the invalid field and row
149142
And no water level entries are imported
150143

151-
@negative @validation @lexicon_values @BDMS-TBD
152-
Scenario: Upload fails due to invalid lexicon values
153-
Given my CSV file contains invalid lexicon values for "measuring_person", "sample_method", "level_status", or "data_quality"
144+
@negative @validation @string_fields @BDMS-TBD
145+
Scenario: Upload accepts free-text values for measuring person and water level descriptors
146+
Given my CSV file contains non-lexicon text values for "measuring_person", "sample_method", "level_status", and "data_quality"
154147
When I run the CLI command:
155148
"""
156149
oco water-levels bulk-upload --file ./water_levels.csv
157150
"""
158-
Then the command exits with a non-zero exit code
159-
And stderr should contain validation errors identifying the invalid field and row
160-
And no water level entries are imported
151+
Then the command exits with code 0
152+
And all water level entries are imported
153+
And stderr should be empty

0 commit comments

Comments
 (0)