Skip to content

test: cover release selection, archives, config generation and commands - #57

Merged
roxblnfk merged 1 commit into
2.xfrom
coverage
Oct 9, 2026
Merged

roxblnfk merged 1 commit into
2.xfrom
coverage

Conversation

@roxblnfk

@roxblnfk roxblnfk commented Oct 9, 2026

Copy link
Copy Markdown
Member

What was changed

Adds a Testo suite for the package; no changes in src.

  • Line coverage of src goes from 14/870 statements (only Stability) to 743/870 (85%); Testo reports 8 → 203 tests, 4 of them skipped as known bugs.
  • Covered: collections and release filtering/sorting, GitHub release/asset/repository parsing and pagination, archive detection and extraction, .rr.yaml generation (every section, presets, required sections), all command options, and the get-binary, versions and make-config commands end to end.
  • No network: GitHub is replaced by MockHttpClient and in-memory repositories, archives are built with PharData in a temp directory.
  • Not covered: download-protoc-binary execution (the command is final and always builds a real GitHub client), the unreadable-file branch of Archive, and OS/architecture detection branches other than the current machine.

Why?

The package had no tests beyond a smoke test.

Bugs found (skipped tests, not fixed here)

  • ReleasesCollection::sortByVersion() puts -beta/-alpha (and upper-case -RC) pre-releases above their final release: v2024.1.0-beta.1 sorts before v2024.1.0, so get-binary --stability=beta picks the beta over the stable release.
  • PharAwareArchive::extract() reopens $this->archive, whose pathname is the first archive entry rather than the archive itself: a binary in the archive root is never extracted (current RoadRunner archives work only because they wrap everything in one top-level directory).
  • RepositoriesCollection::getReleases() keeps generator keys, so releases of a second repository overwrite the first one's.
  • Release::simplifyReleaseName() turns the dev-<tag> fallback name into d-<tag>.

Checklist

  • Tested
    • Testo, Psalm and php-cs-fixer run locally (PHP 8.4, Windows)
    • Unit tests added

@roxblnfk
roxblnfk requested a review from a team October 9, 2026 20:21
@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 28 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8e3950c5-6b92-4299-b318-6a3353cfff9a

📥 Commits

Reviewing files that changed from the base of the PR and between 54d58f1 and cd6d00b.


📒 Files selected for processing (28)
  • tests/Unit/Archive/FactoryTest.php
  • tests/Unit/Archive/PharAwareArchiveTest.php
  • tests/Unit/Command/EnvironmentOptionsTest.php
  • tests/Unit/Command/InstallationLocationOptionTest.php
  • tests/Unit/Command/VersionFilterOptionTest.php
  • tests/Unit/CommandTest.php
  • tests/Unit/Configuration/GeneratorTest.php
  • tests/Unit/Configuration/PluginsTest.php
  • tests/Unit/DownloadProtocBinaryCommandTest.php
  • tests/Unit/Environment/ArchitectureTest.php
  • tests/Unit/Environment/EnumTest.php
  • tests/Unit/Environment/EnvironmentTest.php
  • tests/Unit/Environment/OperatingSystemTest.php
  • tests/Unit/GetBinaryCommandTest.php
  • tests/Unit/MakeConfigCommandTest.php
  • tests/Unit/Repository/AssetsCollectionTest.php
  • tests/Unit/Repository/CollectionTest.php
  • tests/Unit/Repository/GitHub/GitHubAssetTest.php
  • tests/Unit/Repository/GitHub/GitHubReleaseTest.php
  • tests/Unit/Repository/GitHub/GitHubRepositoryTest.php
  • tests/Unit/Repository/ReleasesCollectionTest.php
  • tests/Unit/Repository/RepositoriesCollectionTest.php
  • tests/Unit/Repository/Version1/StaticRepositoryTest.php
  • tests/Unit/Stub/InMemoryRepository.php
  • tests/Unit/Stub/OptionHost.php
  • tests/Unit/Stub/Releases.php
  • tests/Unit/Stub/TempDirectory.php
  • tests/Unit/VersionsCommandTest.php


  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Network access is replaced by Symfony's MockHttpClient and in-memory repositories; archives are built on the fly with PharData. Four tests that expose bugs are skipped with the reason instead of fixing src here.

Assisted-By: Claude Opus 5.5
@roxblnfk
roxblnfk merged commit 8052c99 into 2.x Oct 9, 2026
9 checks passed
@roxblnfk
roxblnfk deleted the coverage branch October 9, 2026 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant