Skip to content

test: keep system.check_version's tests off the network - #1624

Merged
rumblefrog merged 1 commit into
sbpp:mainfrom
ChrisTX:test-offline-release-check
Nov 8, 2026
Merged

rumblefrog merged 1 commit into
sbpp:mainfrom
ChrisTX:test-offline-release-check

Conversation

@ChrisTX

@ChrisTX ChrisTX commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Description

SB_RELEASE_LATEST_URL is now defined in web/tests/bootstrap.php, as the refused port http://127.0.0.1:1/ that SystemTest already used, instead of by the two SystemTest tests themselves. Their define() calls go, and the comments in SystemTest and DispatcherTest say where the URL comes from now.

Motivation and Context

The constant only existed once one of SystemTest's failure tests had run. Tests that run before it and call system.check_version without a cached release, like DispatcherTest and PermissionMatrixTest, fetched the real https://api.github.com/repos/sbpp/sourcebans-pp/releases/latest. So the suite made requests to GitHub, and without network access, as in a sandboxed package build, each of those calls waited up to the 5-second timeout. DispatcherTest's own comment notes that "External fetch may fail in CI".

How Has This Been Tested?

  • tests/api passes against a local MariaDB.
  • strace -e trace=connect on phpunit tests/api/DispatcherTest.php with an empty cache: before, 2 connections to port 443; after, none, and 2 refused connections to 127.0.0.1:1.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.

🤖 Generated with Claude Code

SB_RELEASE_LATEST_URL was only defined by SystemTest's two upstream
failure tests, so every test that ran before them and called
system.check_version without a cached release (DispatcherTest,
PermissionMatrixTest) fetched api.github.com, with a 5 second timeout
where there's no network. Define it in the bootstrap, as a port nothing
listens on, so no test reaches the network and an uncached fetch fails
at once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ChrisTX
ChrisTX requested a review from a team November 7, 2026 07:12
ChrisTX added a commit to ChrisTX/aur-packages that referenced this pull request Nov 7, 2026
Backport sbpp/sourcebans-pp#1624: the tests
point system.check_version at a refused port rather than
api.github.com, which check() can't reach. Only the tests change, which
the package leaves out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
archlinux-github pushed a commit to archlinux/aur that referenced this pull request Nov 7, 2026
Backport sbpp/sourcebans-pp#1624: the tests
point system.check_version at a refused port rather than
api.github.com, which check() can't reach. Only the tests change, which
the package leaves out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rumblefrog
rumblefrog added this pull request to the merge queue Nov 8, 2026
Merged via the queue into sbpp:main with commit 0bfd04b Nov 8, 2026
5 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants