fecgov / fecfile-web-api

Back-end API for FECfile application
Other
8 stars 2 forks source link

Create FECFILE_TEST_ENV environment variable #928

Closed mjtravers closed 2 weeks ago

mjtravers commented 3 months ago

As a developer I need to be able to easily switch between a test and production setup of a feature/app level.

For the Cloud.gov fecfile-web-api space, we have code that changes behavior depending on if it is a test site. Currently, the code checks environment variables like MOCK_OPENFEC_REDIS_URL or FEC_FILING_API to determine whether to mock committee data or submit to webprint.

This ticket is to consolidate the decision to a single FECFILE_TEST_ENV variable that can have a value of 0 or 1.

The affected code areas are:

  1. If a mock committee should be used: https://github.com/fecgov/fecfile-web-api/blob/release/sprint-42/django-backend/fecfiler/openfec/views.py#L33
  2. Webprint should submit to TEST EFO when in test mode and not pass back a seal.svg image when in TEST mode: https://github.com/fecgov/fecfile-web-api/blob/release/sprint-42/django-backend/fecfiler/web_services/dot_fec/web_print_submitter.py#L26

QA NOTES

Turning on the FECFILE_TEST_ENV variable in Cloud.gov should use mock committee data and use TEST EFO for web print and web submit. Otherwise, real committee data from OpenFEC and submitting to production EFO web services should occur. Work with a dev to set up conditions on Cloud.gov for testing each scenario.

QA Notes

null

DEV Notes

null

Design

null

See full ticket and images here: FECFILE-1435

exalate-issue-sync[bot] commented 2 weeks ago

Todd Lees commented: Not how we're handling the configuration anymore