Allow test server to be provided externally#1847
Conversation
This adds support for an optional `DANDI_TESTS_API_URL` environment variable, which if set, will cause the integration test suite to connect to that external server and not boot up a Docker Compose stack. If `DANDI_TESTS_API_URL` is set, then `DANDI_TESTS_DJANGO_API_KEY` must also be set. This makes it possible to run the CLI integration tests more without having to build a Docker image of the API server, allowing simpler validation of any existing running server against the CLI.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1847 +/- ##
==========================================
- Coverage 76.26% 76.24% -0.03%
==========================================
Files 87 87
Lines 12486 12493 +7
==========================================
+ Hits 9523 9525 +2
- Misses 2963 2968 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| api_key = os.environ.get("DANDI_TESTS_DJANGO_API_KEY") | ||
| if not api_key: |
There was a problem hiding this comment.
we are in the bright future already ;) could be
| api_key = os.environ.get("DANDI_TESTS_DJANGO_API_KEY") | |
| if not api_key: | |
| if not (api_key := os.environ.get("DANDI_TESTS_DJANGO_API_KEY")): |
but just to expedite -- let's proceed
yarikoptic
left a comment
There was a problem hiding this comment.
actually -- we would need to list them in https://github.com/dandi/dandi-cli/blob/master/DEVELOPMENT.md#environment-variables so human and silicon beasts could discover this feature more easily
|
@claude if you are enabled here -- add minimalistic description of added here env vars into DEVELOPMENT.md |
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
…vars Briefly describe the two env vars introduced in e84b8ba alongside the other DANDI_TESTS_* entries in DEVELOPMENT.md. Co-Authored-By: Claude Code 2.1.123 / Claude Opus 4.7 (1M context) <noreply@anthropic.com>
yarikoptic
left a comment
There was a problem hiding this comment.
Added docs, we should be all set now if no surprises from CI
|
🚀 PR was released in |
|
Thanks for the quick review and for fixing the deficiencies yourself! I appreciate it. |
This adds support for an optional
DANDI_TESTS_API_URLenvironment variable, which if set, will cause the integration test suite to connect to that external server and not boot up a Docker Compose stack. IfDANDI_TESTS_API_URLis set, thenDANDI_TESTS_DJANGO_API_KEYmust also be set.This makes it possible to run the CLI integration tests more without having to build a Docker image of the API server, allowing simpler validation of any existing running server against the CLI.