-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
B-21378: Need to fix RDD Calculation #14782
base: integrationTesting
Are you sure you want to change the base?
B-21378: Need to fix RDD Calculation #14782
Conversation
…DD-Transit-Calculation-fix2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you update a test to reflect this change?
…DD-Transit-Calculation-fix2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…DD-Transit-Calculation-fix2
@cameroncaci These lines are covered by a test I wrote to hit these lines in the same package. Screenshot below shows me running the mto_shipment_updater_test.go and is hitting the breakpoints on those lines when executed. |
@danieljordan-caci Test additions added |
Encountered the same, think I might've found the cause. My package test is failing, thus why the code coverage reporter wouldn't cover this. Looks like the package tests are timing out on my machine |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you have failing tests in mto_shipment_updater_test.go
I'd run each suite separately and make those fixes. You also have a nil pointer error failure in TestUpdateRequiredDeliveryDateUpdate
That's weird. These were not failing last PR and these changes did not change anything to make tests fail. Looking now. |
Hmm didn't mean to remove that. Im shelving this for a bit so i can focus on some other stuff. Making changes on this im not meaning to make jumping back and forth. |
…DD-Transit-Calculation-fix2
…DD-Transit-Calculation-fix2
…DD-Transit-Calculation-fix2
…DD-Transit-Calculation-fix2
@cameroncaci @danieljordan-caci Went through all failing tests in pkg mto_shipment and fixed all failing tests. Some were failing for reasons other than code in this PR but they are fixed now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was having the code coverage for pkg/services/mto_shipment timeout so I upped it to 60s with /Users/m.traskowsky_cn/.asdf/shims/go test -timeout 60s -coverprofile=/var/folders/m0/422d8n1951zgm770glhbjst80000gp/T/vscode-goDnb7mg/go-code-cover [github.com/transcom/mymove/pkg/services/mto_shipment](http://github.com/transcom/mymove/pkg/services/mto_shipment)
I see some fails, and I'm not sure if they're due to these changes or not, but mto_shipment_updater_test.go:2619
does have fetchedShipment.RequiredDeliveryDate.Format(time.RFC3339))
, as does mto_shipment_updater_test.go:2666
posting the logs here:
--- FAIL: TestMTOShipmentServiceSuite/TestUpdateMTOShipmentStatus (17.63s)
--- FAIL: TestMTOShipmentServiceSuite/TestUpdateMTOShipmentStatus/Test_that_we_are_properly_adding_days_to_Alaska_shipments (8.80s)
mto_shipment_updater_test.go:2619:
Error Trace: /Users/m.traskowsky_cn/repos/mymove/pkg/services/mto_shipment/mto_shipment_updater_test.go:2619
/Users/m.traskowsky_cn/.asdf/installs/golang/1.23.1/packages/pkg/mod/github.com/stretchr/[email protected]/suite/suite.go:115
Error: Not equal:
expected: "2018-06-07T00:00:00Z"
actual : "2018-05-28T00:00:00Z"
Diff:
--- Expected
+++ Actual
@@ -1 +1 @@
-2018-06-07T00:00:00Z
+2018-05-28T00:00:00Z
Test: TestMTOShipmentServiceSuite/TestUpdateMTOShipmentStatus/Test_that_we_are_properly_adding_days_to_Alaska_shipments
mto_shipment_updater_test.go:2619:
Error Trace: /Users/m.traskowsky_cn/repos/mymove/pkg/services/mto_shipment/mto_shipment_updater_test.go:2619
/Users/m.traskowsky_cn/.asdf/installs/golang/1.23.1/packages/pkg/mod/github.com/stretchr/[email protected]/suite/suite.go:115
Error: Not equal:
expected: "2018-06-07T00:00:00Z"
actual : "2018-05-28T00:00:00Z"
Diff:
--- Expected
+++ Actual
@@ -1 +1 @@
-2018-06-07T00:00:00Z
+2018-05-28T00:00:00Z
Test: TestMTOShipmentServiceSuite/TestUpdateMTOShipmentStatus/Test_that_we_are_properly_adding_days_to_Alaska_shipments
mto_shipment_updater_test.go:2619:
Error Trace: /Users/m.traskowsky_cn/repos/mymove/pkg/services/mto_shipment/mto_shipment_updater_test.go:2619
/Users/m.traskowsky_cn/.asdf/installs/golang/1.23.1/packages/pkg/mod/github.com/stretchr/[email protected]/suite/suite.go:115
Error: Not equal:
expected: "2018-06-07T00:00:00Z"
actual : "2018-05-28T00:00:00Z"
Diff:
--- Expected
+++ Actual
@@ -1 +1 @@
-2018-06-07T00:00:00Z
+2018-05-28T00:00:00Z
Test: TestMTOShipmentServiceSuite/TestUpdateMTOShipmentStatus/Test_that_we_are_properly_adding_days_to_Alaska_shipments
mto_shipment_updater_test.go:2619:
Error Trace: /Users/m.traskowsky_cn/repos/mymove/pkg/services/mto_shipment/mto_shipment_updater_test.go:2619
/Users/m.traskowsky_cn/.asdf/installs/golang/1.23.1/packages/pkg/mod/github.com/stretchr/[email protected]/suite/suite.go:115
Error: Not equal:
expected: "2018-06-07T00:00:00Z"
actual : "2018-05-28T00:00:00Z"
Diff:
--- Expected
+++ Actual
@@ -1 +1 @@
-2018-06-07T00:00:00Z
+2018-05-28T00:00:00Z
Test: TestMTOShipmentServiceSuite/TestUpdateMTOShipmentStatus/Test_that_we_are_properly_adding_days_to_Alaska_shipments
mto_shipment_updater_test.go:2666:
Error Trace: /Users/m.traskowsky_cn/repos/mymove/pkg/services/mto_shipment/mto_shipment_updater_test.go:2666
/Users/m.traskowsky_cn/.asdf/installs/golang/1.23.1/packages/pkg/mod/github.com/stretchr/[email protected]/suite/suite.go:115
Error: Not equal:
expected: "2018-06-17T00:00:00Z"
actual : "2018-05-28T00:00:00Z"
Diff:
--- Expected
+++ Actual
@@ -1 +1 @@
-2018-06-17T00:00:00Z
+2018-05-28T00:00:00Z
Test: TestMTOShipmentServiceSuite/TestUpdateMTOShipmentStatus/Test_that_we_are_properly_adding_days_to_Alaska_shipments
mto_shipment_updater_test.go:2666:
Error Trace: /Users/m.traskowsky_cn/repos/mymove/pkg/services/mto_shipment/mto_shipment_updater_test.go:2666
/Users/m.traskowsky_cn/.asdf/installs/golang/1.23.1/packages/pkg/mod/github.com/stretchr/[email protected]/suite/suite.go:115
Error: Not equal:
expected: "2018-06-17T00:00:00Z"
actual : "2018-05-28T00:00:00Z"
Diff:
--- Expected
+++ Actual
@@ -1 +1 @@
-2018-06-17T00:00:00Z
+2018-05-28T00:00:00Z
Test: TestMTOShipmentServiceSuite/TestUpdateMTOShipmentStatus/Test_that_we_are_properly_adding_days_to_Alaska_shipments
mto_shipment_updater_test.go:2666:
Error Trace: /Users/m.traskowsky_cn/repos/mymove/pkg/services/mto_shipment/mto_shipment_updater_test.go:2666
/Users/m.traskowsky_cn/.asdf/installs/golang/1.23.1/packages/pkg/mod/github.com/stretchr/[email protected]/suite/suite.go:115
Error: Not equal:
expected: "2018-06-17T00:00:00Z"
actual : "2018-05-28T00:00:00Z"
Diff:
--- Expected
+++ Actual
@@ -1 +1 @@
-2018-06-17T00:00:00Z
+2018-05-28T00:00:00Z
Test: TestMTOShipmentServiceSuite/TestUpdateMTOShipmentStatus/Test_that_we_are_properly_adding_days_to_Alaska_shipments
mto_shipment_updater_test.go:2666:
Error Trace: /Users/m.traskowsky_cn/repos/mymove/pkg/services/mto_shipment/mto_shipment_updater_test.go:2666
/Users/m.traskowsky_cn/.asdf/installs/golang/1.23.1/packages/pkg/mod/github.com/stretchr/[email protected]/suite/suite.go:115
Error: Not equal:
expected: "2018-06-17T00:00:00Z"
actual : "2018-05-28T00:00:00Z"
Diff:
--- Expected
+++ Actual
@@ -1 +1 @@
-2018-06-17T00:00:00Z
+2018-05-28T00:00:00Z
Test: TestMTOShipmentServiceSuite/TestUpdateMTOShipmentStatus/Test_that_we_are_properly_adding_days_to_Alaska_shipments
mto_shipment_updater_test.go:2705:
Error Trace: /Users/m.traskowsky_cn/repos/mymove/pkg/services/mto_shipment/mto_shipment_updater_test.go:2705
/Users/m.traskowsky_cn/.asdf/installs/golang/1.23.1/packages/pkg/mod/github.com/stretchr/[email protected]/suite/suite.go:115
Error: Received unexpected error:
no international transit time found for destination rate area ID: 3ec11db4-f821-409f-84ad-07fc8e64d60d
Test: TestMTOShipmentServiceSuite/TestUpdateMTOShipmentStatus/Test_that_we_are_properly_adding_days_to_Alaska_shipments
mto_shipment_updater_test.go:2710:
Error Trace: /Users/m.traskowsky_cn/repos/mymove/pkg/services/mto_shipment/mto_shipment_updater_test.go:2710
/Users/m.traskowsky_cn/.asdf/installs/golang/1.23.1/packages/pkg/mod/github.com/stretchr/[email protected]/suite/suite.go:115
Error: Expected value not to be nil.
Test: TestMTOShipmentServiceSuite/TestUpdateMTOShipmentStatus/Test_that_we_are_properly_adding_days_to_Alaska_shipments
panic.go:262: test panicked: runtime error: invalid memory address or nil pointer dereference
I should also mention the ld_classic errors that clutter up my server test output prevents me from seeing the ok here:
@traskowskycaci Not understanding this. I fixed all of these. They pass for me locally. Not sure why yours are failing. I just ran the branch locally and these are passing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verified I did have the latest changes. Talked on slack with Tevin and ran both go test ./pkg/services/mto_shipment
and go test ./pkg/services/mto_shipment -cover
and those look fine. Still get fails or timeouts when running the vscode coverage tool with 60s, upped from 30s but chalking that up to vscode weirdness.
Using the commands Tevin uses for code coverage, I do see those lines covered:
Agility ticket
Summary
Forgot to make RDD based off of scheduledPickupDate + 1 day + UbTransitTime.
This was throwing off the date calculation becaus ei had it as RDD = requiredDeliveryDate + UbTransitTime which is wrong. Obvious mistake.
Required delivery date for a UB shipment is made using the following formula:
rdd = (scheduledPickupDate + 1 day) + re_intl_transit_times.ub_transit_time
Then that rdd value is applied to the UB shipment
Is there anything you would like reviewers to give additional scrutiny?
this article explains more about the approach used.
Verification Steps for the Author
These are to be checked by the author.
Verification Steps for Reviewers
These are to be checked by a reviewer.
Setup to Run the Code
How to test
*Note: There may not be a re_intl_transit_times record with a origin_rate_area_id and a destination_rate_area_id that both exists in re_oconus_rate_areas.
In that case you will have to edit an intl_transit_time_record in the DB to have an origin and destination rate area id that does exist in the re_oconus_rate_areas table.
select *
from re_intl_transit_times
where origin_rate_area_id in (select rate_area_id from re_oconus_rate_areas)
and destination_rate_area_id in (select rate_area_id from re_oconus_rate_areas)
Frontend
officeApp
class or custommin-width
styling is used to hide any states the would not be visible to the user.Backend
Database
Any new migrations/schema changes:
Screenshots