duckdb / community-extensions

https://community-extensions.duckdb.org
111 stars 19 forks source link

Running Tests with External Dependencies #69

Closed hafenkran closed 1 month ago

hafenkran commented 1 month ago

I’m working on integrating the BQ extension into this repo and I just noticed that the current workflow runs all tests by default. This is a bit tricky since all of my tests require connections to external infrastructure, which needs specific credentials.

I wanted to start a discussion to see if there’s already a targeted solution for this testing setup. The easiest way would probably be to have an option to skip these tests during the standard workflow run. Another option that works for me - while not being optimal - would be to somehow define a service container as part of the gh workflow. Last but not least, sharing credentials, which isn’t an option for me ;)

Do you already have a preferred approach for this, or is there something planned for the near future?

samansmink commented 1 month ago

Hey @hafenkran! Yea this is no problem! see the require-env clause in the SQLogicTests tests. For example in the azure extension

So basically the main distribution only tests extensions without any extra runtime dependencies or infrastructure. Then you can define your own CI jobs with a custom environment and set the variables that will let the tests run

hafenkran commented 1 month ago

@samansmink Thanks a ton! No idea why I didn't think of that in the first place. Still, I think it would be really nice if we could somehow define service containers. However, it's rather a nice-to-have than a must-have.