Materials-Data-Science-and-Informatics / somesy

A CLI tool for synchronizing software project metadata
https://materials-data-science-and-informatics.github.io/somesy/main/
MIT License
12 stars 2 forks source link

Cleaning up and refactoring tests #34

Closed apirogov closed 1 year ago

apirogov commented 1 year ago

Currently, there is a large amount of copies of example input files that are not shared across test cases.

This means that when one field is changed, half a dozen test case files must be fixed to make the tests pass again. Crucially, most of the files are the same or almost the same.

The test input files should be streamlined and shared between tests whenever possible. Furthermore, it might be better if they would live in some common directory instead of being colocated with the test cases. Test cases instead should get the test files using a fixture and not rely on relative paths.

If number of test input files are minimized and they are colocated, then changing the schemas will be much less painful in the future.

apirogov commented 1 year ago

@mustafasoylu

pre-commit supports a try-repo command, I think we also should have a sanity-check with a temp folder with a somesy toml and run the pre-commit at least with default config. One could do it with pre-commit try-repo . using subprocess (or using Python if pre-commit has an API)