alphagov / trade-tariff-backend

Enabling the population and distribution via API of UK Customs tariffs and duties
MIT License
7 stars 6 forks source link

Move import handlers under Commodity as we have proper casting now. #41

Closed saulius closed 11 years ago

saulius commented 11 years ago

We are missing fair amount of national measures on various commodities. This fixes initial CHIEF seed loading: candidate measure's validity end date should have been part of the key. And it used to be, but there was an issue raised about duplicate national measures. Unfortunately, I couldn't find the issue in question, so I can't double check that now. I added a test case so validity end date won't be removed any more. If there will be duplicate measures somewhere we will need to sort that in different way.

And again I'm sorry but the only way to fix this is to reload the database. I uploaded a snapshot snapshot_for-12-12-2012.sql.bz2 do Dropbox. I think we a viable solution based on Event Sourcing to prevent these reloads (at least for the daily updates), that hopefully will be implemented.

I also been digging our previous issues and fixes and come up with a list of things to check for:

1. 4017 should be declarable heading
2. 0810301000 at 5th of June should have measure for Montenegro, Albania
3. 0803109000 at 5th of June should have measure for Eastern and Southern Africa States
4. 7616999091 at 5th of June should not have measure "Autonomous suspension under end use"
5. 3901109090 at 5th of June should have BERR Import Licensing Firearms and Ammunition national measure for Iran.
6. 9619005100 at 5th of June should not have "VAT reduced rate 5%" measure
7. 9619004900 at 5th of June should not have VAT zero rate.
8. 0810100000 at 2nd of Oct should have "HMI Conformity Certificate" measure.
9. 4401310000 at 12th of Dec should have VAT Standard rate
10. 8401100000 at 12th of Dec should have  VAT Standard rate
11. 4601211000 at 12th of Dec should have  VAT Standard rate
12. 8401400000 at 12th of Dec should have VAT Standard rate
13. 8423811000 at 12h of Dec should have  VAT Standard rate
14. 8516101100 at 12th of Dec should have  VAT Standard rate
15. 8418211000 at 12th of Dec should have  VAT Standard rate
16. 8452101100 at 12th of Dec should have  VAT Standard rate
17. 8452300000 at 12th of Dec should have VAT Standard rate

Do these qualify as smokey tests? The problem I see is that both Taric and CHIEF may remove any measure at any time, so test will result in error even though nothing bad may have happened.

This list could of course serve as way to check if release was successful.

matthewford commented 11 years ago

@james this quite urgent can we book a deploy slot and reload the db

jabley commented 11 years ago

@matthewford Wrong James I think :smiley:

jystewart commented 11 years ago

@matthewford @jabley I'm confused now. Do you need me to do anything here?

james commented 11 years ago

Hello!

matthewford commented 11 years ago

Sorry about the confusion, I'm blaming the Github mobile app.

jabley commented 11 years ago

I think the tests you've mentioned are valuable. They probably don't belong in smokey - the intention of smokey is a quick 'ping'-like test to confirm that a service is up and serving requests. What we have here is more along the lines of regression / characterisation tests. I think we'll probably create a new repo to put those in. We definitely want to decouple between building / deploying the service versus running regression tests against the service.