Closed twrichards closed 4 years ago
This looks great. It's nice to see how slim the scaffolding for the Docker work is.
I'll wait for others to comment on the domain-specific aspects, and for your todo re: testing in CODE, before approving.
Turns out there is an issue with something in this PR such that boxes cycle in CODE
, after SSHing onto one of the boxes this is the errors in /var/log/syslog
...
...it would be strange if the addition of two test dependencies and the removal of two others would affect this here, but not locally
Ugg. That's not a helpful error. Initialisation is slightly different in the local dev and test modes, particularly in older versions of Play. I'd strongly suggest switching to compile time DI and bumping to at least Play 2.5 which I think kills off the global object. I'd then expect this kind of issue to blow up locally.
I guess that biting the bullet and bumping Play etc is probably something we'd want to do anyway.
Ugg. That's not a helpful error. Initialisation is slightly different in the local dev and test modes, particularly in older versions of Play. I'd strongly suggest switching to compile time DI and bumping to at least Play 2.5 which I think kills off the global object. I'd then expect this kind of issue to blow up locally.
I guess that biting the bullet and bumping Play etc is probably something we'd want to do anyway.
I decided to go for a mega upgrade of everything to (more/less) latest - https://github.com/guardian/path-manager/pull/32 - and whilst it needs a bit more effort its working in a basic form and having rebased this branch onto that one, this is now deploying and working in CODE 🎉
https://trello.com/c/dGQVgKRl/293-introduce-an-integration-test-harness-for-path-manager-endpoints-prior-to-refactoring
What does this change?
This PR introduces https://github.com/whisklabs/docker-it-scala into this repo and implemented reusable trait (
DockerDynamoTestBase
) so we can write tests against a local DynamoDB instance.Using the newly added
DockerDynamoTestBase
added tests for...PathStore.registerNew
PathStore.updateCanonical
PathStore.deleteRecord
In order for these tests to work in TeamCity the DynamoDB client instantiation had to be updated because it distinguished between connecting to local DynamoDB or a AWS hosted DynamoDB based on whether it was running on an EC2 instance, which since TeamCity agents are EC2 instances the new tests were exploding in CI, so now it checks whether the
Stage
tag is notDEVINFRA
which means the new tests now run in TeamCity...How to test
sbt test
How can we measure success?
With these tests in place we have greater confidence going into refactoring these functions to make use of DynamoDB 'transactions'.
Have we considered potential risks?
These changes just affect local and CI, rather than the running application, so minimal/no increased risk.
Images
N/A