usaspending-api
usaspending-api copied to clipboard
[DEV-8395] Travis CI based on our docker-compose.yaml services
Description
Make sure Travis CI workloads and our local dev env workloads (and tests in each) are all using the same config and setup so they pass and fail the same.
Technical Details Background
Travis CI allows “services” to be added to a linux box on which the build will take place. Postgres is one of those. While convenient, it is different than the environment used to develop and run unit tests locally, and the specifics of that postgres environment (like DB version) can drift form local env or from production.
Tech Approach
- Get the
usaspending-ci
container working and doing things that are done in Travis CI (see blocking PR: #3350) - Remove the postgres service from
.travis.yml
- Remove the elasticsearch service from
.travis.yml
- Run
usaspending-ci
in.travis.yml
- Backfill env vars for docker-compose run of services
- Run and see if test still pass
- Compare timing to see if things got much slower
Requirements for PR merge:
- [x] Unit & integration tests updated
- [NA] API documentation updated
- [ ] Necessary PR reviewers:
- [ ] Backend
- [NA] Frontend <OPTIONAL>
- [ ] Operations <OPTIONAL>
- [NA] Domain Expert <OPTIONAL>
- [NA] Matview impact assessment completed
- [NA] Frontend impact assessment completed
- [NA] Data validation completed
- [NA] Appropriate Operations ticket(s) created
- [x] Jira Ticket DEV-8395:
- [x] Link to this Pull-Request
- [x] Performance evaluation of affected (API | Script | Download)
- [x] Before / After data comparison
Area for explaining above N/A when needed:
This PR works, but is on-hold. Why: With the current Dockerfile, it adds 5-7min to the CI build. If we change it to be based on a python:3.7 base docker image, that 5-7m is reclaimed. But we need to make sure there are no issues for ops/CI/jobs for rebasing our image on a different one.
Closing as this is probably overcome by events and may not be worth it, given the way travis builds have been parallelized in #3920 . This branch mod/dev-8395-ci-use-docker-postgres
should be kept open as an example of how we could 100% dockerize our CI build if we want to in the future.