Run the download tests against a local HTTP server - #152
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #152 +/- ##
==========================================
+ Coverage 86.56% 86.79% +0.22%
==========================================
Files 22 22
Lines 1005 1022 +17
==========================================
+ Hits 870 887 +17
Misses 135 135
🚀 New features to boost your workflow:
|
Member
Author
|
The CI failure should be fixed by PR #153. |
Several tests depended on third-party web servers being reachable, which made them fail spuriously: * The tests for the two failure paths of GetPackageURLs pointed PKGMAN_PackageInfoURLList at https://www.gap-system.org, purely to get back some content that is not a valid package URLs list. Whenever that single self-hosted server was unreachable, the test took the "Could not contact server" branch instead and failed. This was the cause of every recent spurious "packagemanager" failure in the PackageDistro CI. It was fragile in a second way too, since the expected output contained the first 71 bytes of that page's HTML. * The test for updating a package whose directory name does not contain a version number installed transgrp 3.6.4 from a personal university web page and then updated it to 3.6.5 -- 118MB downloaded from a third-party server on every single test run. Instead start a small local HTTP server for these tests, cribbed from the utils package, serving a document root prepared from the new tst/data directory. Files that need to refer back to the server contain an "@server@" placeholder, since the port is only known at runtime. The bad package URLs list is now simply a file there. For the update test, tst/data holds the sources of two versions of a minimal dummy package "pmdummy", which are packed into tarballs when the tests run, so that nothing binary needs to be checked in and their contents stay reviewable; both unpack into a directory without a version number, which is the situation under test. For "Could not contact server" we use an unused loopback port rather than an unresponsive server, since wget retries the latter many times. Also report the underlying error of a failed download at info level 2, so that transient network problems can be diagnosed after the fact. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
fingolfin
force-pushed
the
mh/local-test-server
branch
from
August 7, 2026 22:44
d7f83ff to
780e98c
Compare
Collaborator
|
Thanks for making this work! I was having trouble testing it, but now it's all green and merged it all looks good for me. And I really like those runtimes! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Several tests depended on third-party web servers being reachable, which
made them fail spuriously:
The tests for the two failure paths of GetPackageURLs pointed
PKGMAN_PackageInfoURLList at https://www.gap-system.org, purely to get
back some content that is not a valid package URLs list. Whenever that
single self-hosted server was unreachable, the test took the "Could not
contact server" branch instead and failed. This was the cause of every
recent spurious "packagemanager" failure in the PackageDistro CI. It
was fragile in a second way too, since the expected output contained
the first 71 bytes of that page's HTML.
The test for updating a package whose directory name does not contain
a version number installed transgrp 3.6.4 from a personal university
web page and then updated it to 3.6.5 -- 118MB downloaded from a
third-party server on every single test run.
Instead start a small local HTTP server for these tests, cribbed from the
utils package, serving a document root prepared from the new tst/data
directory. Files that need to refer back to the server contain an
"@server@" placeholder, since the port is only known at runtime.
The bad package URLs list is now simply a file there. For the update
test, tst/data holds the sources of two versions of a minimal dummy
package "pmdummy", which are packed into tarballs when the tests run, so
that nothing binary needs to be checked in and their contents stay
reviewable; both unpack into a directory without a version number, which
is the situation under test. For "Could not contact server" we use an
unused loopback port rather than an unresponsive server, since wget
retries the latter many times.
Also report the underlying error of a failed download at info level 2,
so that transient network problems can be diagnosed after the fact.
Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com