aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/tests/dependency_resolver
AgeCommit message (Collapse)Author
2026-06-28refactor: add linternsfisis
2026-06-27test: serialize env-var-dependent testsnsfisis
Several tests read process-global env vars and set/clear them via TearDown but were not #[serial], so parallel execution could race. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-27refactor: fix compiler warnings and clippy warningsnsfisis
2026-06-26test: un-ignore 14 tests that pass against current implementationsnsfisis
Discovered via a full --include-ignored run: these tests have real (non-stub) bodies and pass now, either because their blocker was since implemented (e.g. config_command's stream_set_blocking via libc) or the ignore was stale. Covers composer, config, forgejo_url, config_command, default_policy, transaction, installed_repository, github_driver, version_bumper. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26feat(dependency-resolver): wire operation get_package and unblock solver testsnsfisis
Override OperationInterface::get_package for Install/Uninstall/MarkAlias* operations so trait-object dispatch no longer hits the default todo!(), and implement Rule::is_caused_by_lock's locked-repository lookup via Request::get_locked_repository (LockArrayRepository::get_packages is infallible). Change PackageInterface::get_type to return String (matching PHP getType(): string) so AliasPackage can delegate live to its aliasOf handle across the RefCell instead of an impossible &str borrow. Un-ignores 25 SolverTest cases; 2 alias cases stay ignored pending a real solver alias-resolution discrepancy. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26test: un-ignore advisory pool filter tests unblocked by version_parser fixnsfisis
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25test: un-ignore init/solver tests that now passnsfisis
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25test: un-ignore tests that now passnsfisis
Remove #[ignore] from 18 tests across array_loader, package_sorter, svn, pool_optimizer, and html_output_formatter that pass now that their implementations are in place. Verified under parallel execution. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25test: un-ignore tests that already passnsfisis
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24test: port more unimplemented testsnsfisis
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-22feat(solver): surface SolverProblemsException via two-layer Resultnsfisis
solve() previously dropped the SolverProblemsException and returned a placeholder anyhow error, because its Rc<RefCell<Rule>> payload is not Send+Sync and cannot ride anyhow::Error. Return anyhow::Result<Result<LockTransaction, SolverProblemsException>> instead, keeping fatal errors on the outer Result and the recoverable exception on the inner one. This lets the three Installer callsites port their PHP catch handlers faithfully (pretty-string output, GithubActionError emit, getCode-based exit codes) and lets solver_test.rs assert getProblems/getCode/ getPrettyString. The four ported assertion tests stay ignored: their pretty-string path still reaches unimplemented todo!()s downstream. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-22test: port previously-ignored Composer tests via __ test hatchesnsfisis
Re-evaluate the reason'd #[ignore] tests under the Phase D criterion: a test is unportable ONLY if the APIs/types needed to WRITE it do not exist. A test that compiles but panics at runtime (todo!() body, a regex the regex crate cannot compile) or fails at runtime (incomplete or incorrect impl behavior) is portable -- it is written in full and marked with a reason-less #[ignore]. About 120 test functions move from reason'd #[ignore] to reason-less #[ignore] (the ported-but-not-yet-passing signal). Impl crates gain only additive __ test hatches (init_command, pool, file_downloader, package handle link setters, artifact/path repository, repository manager, svn); no existing logic changes. Tests whose required APIs genuinely do not exist (mock/reflection harness, ApplicationTester, solve() discarding SolverProblemsException, a script::Event that cannot be passed as an originating event) keep their reason'd #[ignore]. cargo check -p shirabe --tests passes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-22test: un-ignore tests that now passnsfisis
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-22test: port more test casesnsfisis
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-22test(php-shim): un-ignore tests now unblocked by implemented shimsnsfisis
Remove #[ignore] from tests gated solely on a shim function that is now implemented, where the test passes: - metapackage_installer::test_update (version_compare) - platform_requirement_filter_factory::test_from_bool_throws... (get_debug_type) - runtime::test_parse_extension_info (html_entity_decode/strip_tags) - package_sorter::test_sorting_does_nothing... (strnatcasecmp) - no_proxy_pattern::test_host_name/test_port (unpack/substr_count) - version_parser::test_is_upgrade (version_compare) - pool::test_what_provides_package_with_constraint - proxy_item::test_throws_on_malformed_url Update the ignore reason where the cited shim is now implemented but the test still cannot pass for a different reason: - no_proxy_pattern::test_ip_address/test_ip_range (IPv4-mapped IPv6 gap) - package_sorter::test_sorting_orders... (look-around regex) - proxy_item::test_url_formatting (parse_url host discrepancy) - json_manipulator/json_config_source/filesystem_repository stubs (test bodies are still todo!(), not yet ported) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21test(tests): expand stub macros into plain test functionsnsfisis
The per-file stub!/encode_stub!/etc. macros generated #[ignore]d test functions but obscured the individual test bodies. Expanding them inline removes the macro indirection so future ports can fill in each function directly. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21test(tests): port setUp/tearDown as set_up/tear_down with TearDownnsfisis
Port PHP setUp/tearDown across the ported integration tests using same-named set_up()/tear_down() functions and a TearDown struct whose Drop runs tear_down(). Fixture-init setUp returns its fixtures; tmpdir-style setUp/tearDown carry state in TearDown fields. Parts that depend on unported infrastructure (PHPUnit mocks, Config::merge, the PHP error handler) stay todo!() and are only wired into ignored stubs to avoid breaking live tests. Also fix shirabe-php-shim putenv to handle the no-'=' form (PHP unsets the variable), which Platform::clear_env relies on for the env-clearing tearDowns. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-21test: port remaining repository and util tests as stubsnsfisis
All ignored: Composer/Filesystem/Platform/Vcs repositories and the AuthHelper/Bitbucket/Git/Perforce/RemoteFilesystem/Svn utils mock IO/Config/HttpDownloader(curl)/ProcessExecutor or use reflection; Filesystem/ProcessExecutor/StreamContextFactory/ProxyManager need on-disk fixtures or proxy env. setUp/tearDown not ported. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21test(dependency-resolver): port ↵nsfisis
DefaultPolicy/PoolBuilder/PoolOptimizer/Solver as stubs All ignored: they build Pools/run the Solver over packages whose constraint parsing uses a look-around regex the regex crate cannot compile, with fixture-heavy setup. setUp/tearDown not ported. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21test: port SecurityAdvisoryPoolFilter, downloader/command/app stubsnsfisis
All ignored/todo!(): the advisory filter parses affectedVersions via a look-around regex; the Hg/Fossil/Perforce/Archive downloaders and RepositoryManager need mocked process/HttpDownloader (curl); the Validate/ Archive commands, ApplicationTest and CompletionFunctionalTest need the ApplicationTester/console harness. setUp/tearDown not ported. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21test(dependency-resolver): port RuleSetTestnsfisis
addWhenTypeIsNotRecognized passes (the type check precedes the hash). All other cases call RuleSet::add, which computes get_hash -> hash_raw (todo!()), and prettyString also mocks RepositorySet/Request; those are ignored. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21test: port TransactionTest and StrictConfirmationQuestionTest as stubsnsfisis
TransactionTest needs Transaction::new (uasort_map todo!()) and non-root link setters; StrictConfirmationQuestionTest needs Symfony QuestionHelper. Both stubbed. Wires up the question test target. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21test(dependency-resolver): port RuleTestnsfisis
equals/type/enable/disable/isAssertion pass; getHash reaches hash_raw (todo!()) and prettyString needs mocked RepositorySet/Request, so both are stubbed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21style: apply rustfmt to ported test filesnsfisis
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21test(dependency-resolver): port PoolTest with shared TestCase helpersnsfisis
Add tests/common/test_case.rs (get_package, get_version_constraint) ported from the PHP TestCase, included into the dependency_resolver binary via #[path]. PoolTest's testPool/testPackageById/testWhatProvidesWhenPackageCannotBeFound pass; testWhatProvidesPackageWithConstraint is #[ignore] (constraint matching reaches a todo!() in the php-shim). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21test(dependency-resolver): port RuleSetIteratorTestnsfisis
Both testForeach and testKeys pass. The PHP foreach over the Iterator is reproduced with the ported valid()/current()/key()/next() methods; the original assertEquals on rule objects is checked via Rc::ptr_eq since the iterator yields the same Rc instances. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21test(dependency-resolver): port RequestTestnsfisis
Both cases pass. AnyConstraint has no PartialEq (foreign crate), so the assertEquals on the requires map is reproduced via Debug-representation comparison. The unused ArrayRepository setup from the original is omitted. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21test: add empty test filesnsfisis