mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Add docs section on using base64 URLs to avoid external test dependencies
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
772bcd0dbf
commit
8f6e005021
@@ -1602,6 +1602,30 @@ ping the Galaxy committers on the pull request and request a re-run. The
|
||||
GitHub actions workflow definition for these tests is located in
|
||||
``.github/workflows/integration_selenium.yaml`` below Galaxy's root.
|
||||
|
||||
{#avoiding_external_dependencies}
|
||||
## Avoiding External Dependencies in Tests
|
||||
|
||||
Tests fetching from external services (GitHub, etc.) fail transiently due to
|
||||
network issues or rate limiting. Use ``DatasetPopulator``'s base64 URL helpers
|
||||
to encode local test data as ``base64://`` URLs instead — Galaxy's fetch API
|
||||
handles these identically to remote URLs.
|
||||
|
||||
| Helper | Use Case |
|
||||
|--------|----------|
|
||||
| ``base64_url_for_test_file(filename)`` | Encode a file from ``test-data/`` |
|
||||
| ``base64_url_for_string(content)`` | Encode a string literal |
|
||||
| ``base64_url_for_bytes(content)`` | Encode raw bytes |
|
||||
|
||||
```python
|
||||
# Instead of: "location": "https://github.com/.../1.fasta.gz?raw=true"
|
||||
base64_url = self.dataset_populator.base64_url_for_test_file("1.fasta.gz")
|
||||
job = {"input1": {"class": "File", "format": "fasta", "location": base64_url, "decompress": True}}
|
||||
```
|
||||
|
||||
These work anywhere a URL is accepted: ``stage_inputs`` jobs, fetch API targets,
|
||||
deferred datasets, and workflow inputs. Only use real external URLs when the test
|
||||
specifically validates remote-fetch behavior.
|
||||
|
||||
{#transient_failures}
|
||||
## Handling Flaky Tests
|
||||
|
||||
|
||||
Reference in New Issue
Block a user