Skip to content

[26.0] Use mock test server when tests don't target external galaxy server#22103

Merged
jmchilton merged 3 commits intogalaxyproject:release_26.0from
mvdbeek:use-mock-test-server
Mar 13, 2026
Merged

[26.0] Use mock test server when tests don't target external galaxy server#22103
jmchilton merged 3 commits intogalaxyproject:release_26.0from
mvdbeek:use-mock-test-server

Conversation

@mvdbeek
Copy link
Copy Markdown
Member

@mvdbeek mvdbeek commented Mar 13, 2026

I think this gives us a lot of flexibility, we can target local and remote Galaxy instances with the same test syntax,
and CI tests don't get rate limited by github or make requests against usegalaxy.org or fail on httpstat.us.

How to test the changes?

(Select all options that apply)

  • I've included appropriate automated tests.
  • This is a refactoring of components with existing test coverage.
  • Instructions for manual testing are as follows:
    1. [add testing steps and prerequisites here if you didn't write automated tests covering all your changes]

License

  • I agree to license these and all my past contributions to the core galaxy codebase under the MIT license.

mvdbeek added 2 commits March 13, 2026 12:18
…tests

Replace external service dependencies in test_tools_upload.py with a local
mock HTTP server. The MockHttpServer fixture provides a get_url() factory
that registers routes on a local stdlib HTTP server for local Galaxy testing,
and falls back to the real external URLs (with skip-if-down) when targeting
a remote Galaxy server via GALAXY_TEST_EXTERNAL.
Remove skip_if_github_down decorators from 20 tests across 9 files by
serving test data from the local mock HTTP server. Enhances the mock
server with file_path support, HEAD requests, and HTTP range requests
(206 Partial Content). For unit tests that run data_fetch.main()
directly, writes a file_sources.json with 127.0.0.0/24 in the
fetch_url_allowlist so the local server passes URI validation.
@mvdbeek mvdbeek force-pushed the use-mock-test-server branch from e5424b1 to fddbd36 Compare March 13, 2026 13:06
@mvdbeek mvdbeek requested a review from a team March 13, 2026 15:52
@jmchilton jmchilton merged commit 8335fdf into galaxyproject:release_26.0 Mar 13, 2026
51 of 56 checks passed
@github-project-automation github-project-automation Bot moved this from Needs Review to Done in Galaxy Dev - weeklies Mar 13, 2026
@github-actions
Copy link
Copy Markdown

This PR was merged without a "kind/" label, please correct.

@nsoranzo nsoranzo deleted the use-mock-test-server branch March 14, 2026 02:19
@ahmedhamidawan ahmedhamidawan modified the milestones: 26.1, 26.0 Mar 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

4 participants