The QA instances of some services can tend to be less than reliable. The problem is that we rely on these services for our integration tests to pass and are often left waiting for retry after retry for integration tests to pass due to the flaky nature of these services. Blame it on the rain?
This project is a super simple way to return mock responses for such services. The initial implementation includes some basic SETI and Nomic responses and these will grow over time.
In addition, milli-vanilli can act as a high-level mock for top-level services like Topper Harley.
To Set It Up
nvm usenpm installnode start
This will start milli-vanilli listening on port 3456. You know it's true.
Once it is running you can make requests in this form:
http://localhost:3456/nomic/v1/accounts/507017973001/policy_keys
http://localhost:3456/seti/v1/accounts/507017973001/settings/account/product_type
http://localhost:3456/topperharley/v2/accounts/507017973001/players/DOES-NOT-EXIST
SETI I'm gonna miss you.
Advanced Awesomeness
You can also globally link the package:
npm link
And then you can start a server in any shell:
milli-vanilli
When working with Topper Harley you can set the following to have milli-vanilli used instead of the specified services.
export FAKE_CATHY_URL=http://localhost:3456/cathyexport FAKE_CMS_URL=http://127.0.0.1:3456/cmsexport FAKE_NOMIC_URL=http://127.0.0.1:3456/nomicexport FAKE_SETI_URL=http://127.0.0.1:3456/seti
When working with projects using Topper Harley's internal access as a dependency make the following override:
export TOPPER_HARLEY_INTERNAL_BASE_URL=http://127.0.0.1:3456/topperharley
To Create a Tag, a Docker Image, and Deploy
cd milli-vanilli
npm version major|minor|patch
git push --tags origin master
docker build -t user/$USER/milli-vanilli:${git describe} .
aws --profile bc-deploys-ecr ecr get-login --registry-ids 286457800582 --no-include-email --region us-east-1
docker tag user/$USER/milli-vanilli:${git describe} 286457800582.dkr.ecr.us-east-1.amazonaws.com/players/milli-vanilli:${git describe}
docker push 286457800582.dkr.ecr.us-east-1.amazonaws.com/players/milli-vanilli:${git describe}
Then, make sure to modify all the services that utilize the module.