From 599fbb2a4d73dc275f907de16e82383619a2d9ab Mon Sep 17 00:00:00 2001 From: jacob-a-brown Date: Mon, 5 Jan 2026 11:02:40 -0700 Subject: [PATCH 1/5] fix: remove measuring_person from lexicon tests measuring_person is the field staff that took the measurement, not a lexicon value --- tests/features/water-level-csv.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/features/water-level-csv.feature b/tests/features/water-level-csv.feature index 5974bdd21..b8c965874 100644 --- a/tests/features/water-level-csv.feature +++ b/tests/features/water-level-csv.feature @@ -150,7 +150,7 @@ Feature: Bulk upload water level entries from CSV via CLI @negative @validation @lexicon_values @BDMS-TBD Scenario: Upload fails due to invalid lexicon values - Given my CSV file contains invalid lexicon values for "measuring_person", "sample_method", "level_status", or "data_quality" + Given my CSV file contains invalid lexicon values for "sample_method", "level_status", or "data_quality" When I run the CLI command: """ oco water-levels bulk-upload --file ./water_levels.csv From b634696ec1f2e269b35ee91a7f8c679f6c260804 Mon Sep 17 00:00:00 2001 From: jacob-a-brown Date: Mon, 5 Jan 2026 11:08:57 -0700 Subject: [PATCH 2/5] feat: add validation for measuring_person field in water level CSV upload This scenario tests that measuring_person in the CSV must match one of the field_staff entries. --- tests/features/water-level-csv.feature | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/features/water-level-csv.feature b/tests/features/water-level-csv.feature index b8c965874..a7aec51d0 100644 --- a/tests/features/water-level-csv.feature +++ b/tests/features/water-level-csv.feature @@ -158,3 +158,14 @@ Feature: Bulk upload water level entries from CSV via CLI Then the command exits with a non-zero exit code And stderr should contain validation errors identifying the invalid field and row And no water level entries are imported + + @negative @validation @well_references @BDMS-TBD + Scenario: Upload fails when "measuring_person" does not match "field_staff," "field_staff_2," or "field_staff_3" + Given my CSV file contains a "measuring_person" value that does not match any of the provided "field_staff" values + When I run the CLI command: + """ + oco water-levels bulk-upload --file ./water_levels.csv + """ + Then the command exits with a non-zero exit code + And stderr should contain a validation error for the "measuring_person" field + And no water level entries are imported \ No newline at end of file From ed65e34b11b570119773ab1e7084ceca7702baba Mon Sep 17 00:00:00 2001 From: jacob-a-brown Date: Mon, 5 Jan 2026 14:25:03 -0700 Subject: [PATCH 3/5] fix: remove erroneous well_references tag --- tests/features/water-level-csv.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/features/water-level-csv.feature b/tests/features/water-level-csv.feature index a7aec51d0..88aa11ab5 100644 --- a/tests/features/water-level-csv.feature +++ b/tests/features/water-level-csv.feature @@ -159,7 +159,7 @@ Feature: Bulk upload water level entries from CSV via CLI And stderr should contain validation errors identifying the invalid field and row And no water level entries are imported - @negative @validation @well_references @BDMS-TBD + @negative @validation @BDMS-TBD Scenario: Upload fails when "measuring_person" does not match "field_staff," "field_staff_2," or "field_staff_3" Given my CSV file contains a "measuring_person" value that does not match any of the provided "field_staff" values When I run the CLI command: From 260799e6a115f4ac1b20815a21bbf3ae0591a12b Mon Sep 17 00:00:00 2001 From: jacob-a-brown Date: Mon, 5 Jan 2026 16:30:04 -0700 Subject: [PATCH 4/5] refactor: use the word 'total' for all summaries --- tests/features/water-level-csv.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/features/water-level-csv.feature b/tests/features/water-level-csv.feature index 88aa11ab5..9629e024f 100644 --- a/tests/features/water-level-csv.feature +++ b/tests/features/water-level-csv.feature @@ -51,7 +51,7 @@ Feature: Bulk upload water level entries from CSV via CLI | summary_field | value | | total_rows_processed | 2 | | total_rows_imported | 2 | - | validation_errors_or_warnings | 0 | + | total_validation_errors_or_warnings | 0 | And stdout includes an array of created water level entry objects And stderr should be empty From 9c2668fcec8cfd23908da2f50181b8ca6c4b013f Mon Sep 17 00:00:00 2001 From: jacob-a-brown Date: Tue, 6 Jan 2026 08:58:25 -0700 Subject: [PATCH 5/5] fix: add requisite steps for valid scenarios --- tests/features/water-level-csv.feature | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/features/water-level-csv.feature b/tests/features/water-level-csv.feature index 9629e024f..71f46f3ed 100644 --- a/tests/features/water-level-csv.feature +++ b/tests/features/water-level-csv.feature @@ -45,7 +45,9 @@ Feature: Bulk upload water level entries from CSV via CLI """ oco water-levels bulk-upload --file ./water_levels.csv --output json """ - Then the command exits with code 0 + # assumes users are entering datetimes as Mountain Time becuase well location is restricted to New Mexico + Then all datetime objects are assigned the correct Mountain Time timezone offset based on the date value. + And the command exits with code 0 And stdout should be valid JSON And stdout includes a summary containing: | summary_field | value | @@ -60,7 +62,9 @@ Feature: Bulk upload water level entries from CSV via CLI Given my CSV file contains all required headers but in a different column order And the CSV includes required fields: | required field name | + | field_staff | | well_name_point_id | + | field_event_date_time | | water_level_date_time | | measuring_person | | sample_method | @@ -85,7 +89,9 @@ Feature: Bulk upload water level entries from CSV via CLI """ oco water-levels bulk-upload --file ./water_levels.csv """ - Then the command exits with code 0 + # assumes users are entering datetimes as Mountain Time becuase well location is restricted to New Mexico + Then all datetime objects are assigned the correct Mountain Time timezone offset based on the date value. + And the command exits with code 0 And all water level entries are imported And stderr should be empty