usds / justice40-tool

A tool to identify disadvantaged communities due to environmental, socioeconomic and health burdens
https://screeningtool.geoplatform.gov/
Creative Commons Zero v1.0 Universal
125 stars 42 forks source link

As a backend developer, I want to standardize our test directory format. #1076

Open lucasmbrown-usds opened 2 years ago

lucasmbrown-usds commented 2 years ago

Description For the tests on the scoring code, these live in data/data-pipeline/data_pipeline/etl/score/tests, next to the code that they're testing.

However, for the national risk index ETL tests, these live in data/data-pipeline/data_pipeline/tests/sources/national_risk_index in a directory separated from the code.

We should choose one approach and standardize it by fixing the non-conforming test directory/directories.

esfoobar-usds commented 2 years ago

It is more or less an accepted pattern to have all tests and test configuration files on a root tests folder instead of next to each sub-section, so I vote to move all to data_pipeline/tests

lucasmbrown-usds commented 2 years ago

Yeah I have no strong preference. At my last org we kept tests next to code which made it easy to find the tests when you needed them, but (as usual) all I really care about is consistency and parallelism :), so moving them all to a separate root tests folder is fine for me.

I assume the separate tests folder would mirror the directory structure of the application code?

saran-ahluwalia commented 2 years ago

@esfoobar-usds Here are some suggestions from a couple references:

  1. Python Testing Reference structure
  2. Pytest Suggestions and conventions used for modules
sverchdotgov commented 2 years ago

This is what I think the steps are here: