Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests #26

Closed
gjoseph92 opened this issue Apr 20, 2021 · 3 comments
Closed

Tests #26

gjoseph92 opened this issue Apr 20, 2021 · 3 comments

Comments

@gjoseph92
Copy link
Owner

We need them. Very much so.

Jotting down some thoughts on what I'd like testing to look like for this project:

  • Lean on typechecking; only write tests for logic.
  • Use hypothesis as much as possible.
    • I'd like to work off of https://github.com/inspera/jsonschema-typed to make a utility for basically converting JSON schema to a .pyi file of TypedDicts for that schema. From that (and a bit more logic), we can basically have Hypothesis any valid STAC JSON for us (and be sure our typechecking is correct too).
  • Prefer real-world / e2e-ish tests over unit tests. If there's a clear unit to test, test it, but otherwise don't worry about passing through a lot of logic in a test.
  • Add some data fixtures, of both STAC metadata and actual assets that have tripped us up.
  • Run mindeps tests like dask. Unlike dask, it would be great to automate figuring out those versions. Poetry doesn't support this yet, but it's probably possible: Support lock dependencies with lowest solvable versions python-poetry/poetry#3527.
  • Continue using poetry, not conda. Conda is great for data science when you need system dependencies, but the ability to get deterministic environments from poetry makes it better for developing and testing packages.
  • shed for formatting (probably).
@scottyhq
Copy link
Contributor

thanks for writing this down @gjoseph92 lots of new resources to explore!

Continue using poetry, not conda. Conda is great for data science when you need system dependencies, but the ability to get deterministic environments from poetry makes it better for developing and testing packages.

Agreed that poetry is nice for having everything in pyproject.toml and also facilitating pypi publishing. For locking environments with conda I've been getting a lot of mileage out of conda-lock, worth keeping an eye on: https://github.com/conda-incubator/conda-lock

@gjoseph92
Copy link
Owner Author

Going to close this now that a few tests have been added, so hopefully the barrier to adding more will be lower!

Specific follow-up issues:

And then all of these need tests: https://github.com/gjoseph92/stackstac/issues?q=label%3Aneeds-future-test

@gjoseph92
Copy link
Owner Author

  • I'd like to work off of https://github.com/inspera/jsonschema-typed to make a utility for basically converting JSON schema to a .pyi file of TypedDicts for that schema. From that (and a bit more logic), we can basically have Hypothesis any valid STAC JSON for us (and be sure our typechecking is correct too).

Wanted to note I just noticed https://github.com/Zac-HD/hypothesis-jsonschema, which should let us generate random STAC data from the STAC json schema!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants