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

Improve Developer Testing #521

Closed
omad opened this issue Nov 2, 2022 · 2 comments
Closed

Improve Developer Testing #521

omad opened this issue Nov 2, 2022 · 2 comments
Assignees

Comments

@omad
Copy link
Member

omad commented Nov 2, 2022

In ODC Tools we have a several automated tests written for some of the tools and libraries. However, having recently tried to do some work on the code here, I've run across a few hiccups.

Problems

  • Most tests required an available PostgreSQL database to be setup.
  • Interdependencies between tests, many tests have been written such that they depend on previous tests being run. This makes it impossible to run individual tests during development.

The tests have been setup with pytest-depends, but it's being used in a manner other than advised.

From the third paragraph documentation of pytest-depends:

This isn't a dependency in the sense of test A sets up stuff for test B, but more in the sense of if test A failed there's no reason to bother with test B either.

Two different options for development setups have been documented in README.md#Local Development, but this does nothing to solve the test interdependency problem to be able to run individual tests, and is awkward at best in automating a PostgreSQL setup.

@omad
Copy link
Member Author

omad commented Nov 7, 2022

Another Issue

Tests written for the AWS capable tools depend on S3 resources hosted by third parties, and some of those have recently become unavailable. Some of the STAC documents store in s3://sentinel-cogs/ are no longer publicly readable.

I tried replacing the reads of real S3 documents with moto, but failed due to the use of aiobotocore, see: #522 .

An alternate possible solution for this could be using a mock server after implementing a solution to #470 . But using moto would have been simpler.

@omad omad self-assigned this Nov 14, 2022
@omad
Copy link
Member Author

omad commented Dec 20, 2022

Done

@omad omad closed this as completed Dec 20, 2022
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

1 participant