diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-02 16:53:41 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-02 16:53:41 +0900 |
| commit | c1733d88510b7afb88f7a17849de514365e42c84 (patch) | |
| tree | 57f9eb854cb226059df90d190626e090ae07d639 /crates/mozart/tests | |
| parent | 82501a36a0fa6725d656742da42c860e75a89b89 (diff) | |
| download | php-mozart-c1733d88510b7afb88f7a17849de514365e42c84.tar.gz php-mozart-c1733d88510b7afb88f7a17849de514365e42c84.tar.zst php-mozart-c1733d88510b7afb88f7a17849de514365e42c84.zip | |
refactor(registry): introduce Repository and InstallerExecutor traits
Sets up DI scaffolding for in-process installer E2E tests, mirroring how
Composer's PHPUnit suite swaps Packagist (FactoryMock) and the install
manager (InstallationManagerMock) without touching the network or filesystem.
Additions:
- Repository trait + RepositorySet (Composer's RepositoryInterface analog),
with PackagistRepository, InlinePackageRepository, VcsRepository impls.
- InstallerExecutor trait (Composer's InstallationManager analog) with
FilesystemExecutor extracted from install_from_lock.
install_from_lock now delegates per-package install/uninstall verbs to
FilesystemExecutor; console output orchestration stays in the caller so
existing --EXPECT-OUTPUT-shape assertions remain comparable. No behavior
change - all 136 enabled installer fixtures still pass.
Also tightens the installer_fixture\! ignore form to a single token
(installer_fixture\!(name, ignore)) for readability.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/mozart/tests')
| -rw-r--r-- | crates/mozart/tests/installer.rs | 226 |
1 files changed, 53 insertions, 173 deletions
diff --git a/crates/mozart/tests/installer.rs b/crates/mozart/tests/installer.rs index e1bc7a5..719a721 100644 --- a/crates/mozart/tests/installer.rs +++ b/crates/mozart/tests/installer.rs @@ -57,9 +57,9 @@ macro_rules! installer_fixture { run_installer_fixture(stringify!($name)); } }; - ($name:ident, ignore = $reason:literal) => { + ($name:ident, ignore) => { #[test] - #[ignore = $reason] + #[ignore = "not implemented yet"] fn $name() { run_installer_fixture(stringify!($name)); } @@ -67,77 +67,38 @@ macro_rules! installer_fixture { } installer_fixture!(abandoned_listed); -installer_fixture!( - alias_in_complex_constraints, - ignore = "mozart binary cannot yet run this fixture" -); -installer_fixture!( - alias_in_lock, - ignore = "mozart binary cannot yet run this fixture" -); +installer_fixture!(alias_in_complex_constraints, ignore); +installer_fixture!(alias_in_lock, ignore); installer_fixture!(alias_in_lock2); -installer_fixture!( - alias_on_unloadable_package, - ignore = "mozart binary cannot yet run this fixture" -); -installer_fixture!( - alias_solver_problems, - ignore = "mozart binary cannot yet run this fixture" -); -installer_fixture!( - alias_solver_problems2, - ignore = "mozart binary cannot yet run this fixture" -); -installer_fixture!( - alias_with_reference, - ignore = "mozart binary cannot yet run this fixture" -); +installer_fixture!(alias_on_unloadable_package, ignore); +installer_fixture!(alias_solver_problems, ignore); +installer_fixture!(alias_solver_problems2, ignore); +installer_fixture!(alias_with_reference, ignore); installer_fixture!(aliased_priority); installer_fixture!(aliased_priority_conflicting); -installer_fixture!( - aliases_with_require_dev, - ignore = "mozart binary cannot yet run this fixture" -); -installer_fixture!( - broken_deps_do_not_replace, - ignore = "mozart binary cannot yet run this fixture" -); -installer_fixture!( - circular_dependency, - ignore = "mozart binary cannot yet run this fixture" -); -installer_fixture!( - circular_dependency2, - ignore = "mozart binary cannot yet run this fixture" -); +installer_fixture!(aliases_with_require_dev, ignore); +installer_fixture!(broken_deps_do_not_replace, ignore); +installer_fixture!(circular_dependency, ignore); +installer_fixture!(circular_dependency2, ignore); installer_fixture!(circular_dependency_errors); installer_fixture!(conflict_against_provided_by_dep_package_works); installer_fixture!(conflict_against_provided_package_works); installer_fixture!(conflict_against_replaced_by_dep_package_problem); -installer_fixture!( - conflict_against_replaced_package_problem, - ignore = "mozart binary cannot yet run this fixture" -); +installer_fixture!(conflict_against_replaced_package_problem, ignore); installer_fixture!(conflict_between_dependents); installer_fixture!(conflict_between_root_and_dependent); installer_fixture!(conflict_downgrade); installer_fixture!(conflict_downgrade_nested); installer_fixture!( conflict_on_root_with_alias_prevents_update_if_not_required, - ignore = "mozart binary cannot yet run this fixture" -); -installer_fixture!( - conflict_with_alias_in_lock_does_prevents_install, - ignore = "mozart binary cannot yet run this fixture" + ignore ); +installer_fixture!(conflict_with_alias_in_lock_does_prevents_install, ignore); installer_fixture!(conflict_with_alias_prevents_update); -installer_fixture!( - conflict_with_alias_prevents_update_if_not_required, - ignore = "mozart binary cannot yet run this fixture" -); +installer_fixture!(conflict_with_alias_prevents_update_if_not_required, ignore); installer_fixture!( conflict_with_all_dependencies_option_dont_recommend_to_use_it, - ignore = "mozart binary cannot yet run this fixture" + ignore ); installer_fixture!(deduplicate_solver_problems); installer_fixture!(disjunctive_multi_constraints); @@ -145,40 +106,19 @@ installer_fixture!(full_update_minimal_changes); installer_fixture!(github_issues_4319); installer_fixture!(github_issues_4795); installer_fixture!(github_issues_4795_2); -installer_fixture!( - github_issues_7051, - ignore = "mozart binary cannot yet run this fixture" -); +installer_fixture!(github_issues_7051, ignore); installer_fixture!(github_issues_8902); -installer_fixture!( - github_issues_8903, - ignore = "mozart binary cannot yet run this fixture" -); -installer_fixture!( - github_issues_9012, - ignore = "mozart binary cannot yet run this fixture" -); -installer_fixture!( - github_issues_9290, - ignore = "mozart binary cannot yet run this fixture" -); -installer_fixture!( - hint_main_rename, - ignore = "mozart binary cannot yet run this fixture" -); +installer_fixture!(github_issues_8903, ignore); +installer_fixture!(github_issues_9012, ignore); +installer_fixture!(github_issues_9290, ignore); +installer_fixture!(hint_main_rename, ignore); installer_fixture!(install_aliased_alias); -installer_fixture!( - install_branch_alias_composer_repo, - ignore = "mozart binary cannot yet run this fixture" -); +installer_fixture!(install_branch_alias_composer_repo, ignore); installer_fixture!(install_dev); installer_fixture!(install_dev_using_dist); installer_fixture!(install_forces_reinstall_if_abandon_changes); installer_fixture!(install_from_incomplete_lock); -installer_fixture!( - install_from_incomplete_lock_with_ignore, - ignore = "mozart binary cannot yet run this fixture" -); +installer_fixture!(install_from_incomplete_lock_with_ignore, ignore); installer_fixture!(install_from_lock_removes_package); installer_fixture!(install_funding_notice); installer_fixture!(install_funding_notice_env); @@ -186,59 +126,35 @@ installer_fixture!(install_funding_notice_not_displayed_env); installer_fixture!(install_ignore_platform_package_requirement_list); installer_fixture!(install_ignore_platform_package_requirement_wildcard); installer_fixture!(install_ignore_platform_package_requirements); -installer_fixture!( - install_missing_alias_from_lock, - ignore = "mozart binary cannot yet run this fixture" -); -installer_fixture!( - install_overridden_platform_packages, - ignore = "mozart binary cannot yet run this fixture" -); +installer_fixture!(install_missing_alias_from_lock, ignore); +installer_fixture!(install_overridden_platform_packages, ignore); installer_fixture!(install_package_and_its_provider_skips_original); installer_fixture!(install_prefers_repos_over_package_versions); installer_fixture!(install_reference); -installer_fixture!( - install_security_advisory_matching_dependency, - ignore = "mozart binary cannot yet run this fixture" -); +installer_fixture!(install_security_advisory_matching_dependency, ignore); installer_fixture!(install_self_from_root); installer_fixture!(install_simple); installer_fixture!(install_without_lock); installer_fixture!(load_replaced_package_if_replacer_dropped); installer_fixture!(outdated_lock_file_fails_install); installer_fixture!(outdated_lock_file_with_new_platform_reqs_fails); -installer_fixture!( - partial_update_always_updates_symlinked_path_repos, - ignore = "mozart binary cannot yet run this fixture" -); -installer_fixture!( - partial_update_downgrades_non_allow_listed_unstable, - ignore = "mozart binary cannot yet run this fixture" -); +installer_fixture!(partial_update_always_updates_symlinked_path_repos, ignore); +installer_fixture!(partial_update_downgrades_non_allow_listed_unstable, ignore); installer_fixture!(partial_update_forces_dev_reference_from_lock_for_non_updated_packages); installer_fixture!(partial_update_from_lock); installer_fixture!(partial_update_from_lock_with_root_alias); installer_fixture!(partial_update_installs_from_lock_even_missing); installer_fixture!(partial_update_keeps_older_dep_if_still_required); installer_fixture!(partial_update_keeps_older_dep_if_still_required_with_provide); -installer_fixture!( - partial_update_loads_root_aliases_for_path_repos, - ignore = "mozart binary cannot yet run this fixture" -); -installer_fixture!( - partial_update_security_advisory_matching_locked_dep, - ignore = "mozart binary cannot yet run this fixture" -); +installer_fixture!(partial_update_loads_root_aliases_for_path_repos, ignore); +installer_fixture!(partial_update_security_advisory_matching_locked_dep, ignore); installer_fixture!( partial_update_security_advisory_matching_locked_dep_with_dependencies, - ignore = "mozart binary cannot yet run this fixture" + ignore ); installer_fixture!(partial_update_with_dependencies_provide); installer_fixture!(partial_update_with_dependencies_replace); -installer_fixture!( - partial_update_with_deps_warns_root, - ignore = "mozart binary cannot yet run this fixture" -); +installer_fixture!(partial_update_with_deps_warns_root, ignore); installer_fixture!(partial_update_with_symlinked_path_repos); installer_fixture!(partial_update_without_lock); installer_fixture!(platform_ext_solver_problems); @@ -246,71 +162,47 @@ installer_fixture!(plugins_are_installed_first); installer_fixture!(prefer_lowest_branches); installer_fixture!(problems_reduce_versions); installer_fixture!(provider_can_coexist_with_other_version_of_provided); -installer_fixture!( - provider_conflicts, - ignore = "mozart binary cannot yet run this fixture" -); +installer_fixture!(provider_conflicts, ignore); installer_fixture!(provider_conflicts2); installer_fixture!(provider_conflicts3); -installer_fixture!( - provider_dev_require_can_satisfy_require, - ignore = "mozart binary cannot yet run this fixture" -); +installer_fixture!(provider_dev_require_can_satisfy_require, ignore); installer_fixture!(provider_gets_picked_together_with_other_version_of_provided); installer_fixture!( provider_gets_picked_together_with_other_version_of_provided_conflict, - ignore = "mozart binary cannot yet run this fixture" + ignore ); installer_fixture!(provider_gets_picked_together_with_other_version_of_provided_indirect); installer_fixture!(provider_packages_can_be_installed_if_selected); installer_fixture!( provider_packages_can_be_installed_together_with_provided_if_both_installable, - ignore = "mozart binary cannot yet run this fixture" + ignore ); installer_fixture!( provider_packages_can_not_be_installed_unless_selected, - ignore = "mozart binary cannot yet run this fixture" + ignore ); installer_fixture!(provider_satisfies_its_own_requirement); installer_fixture!(remove_deletes_unused_deps); installer_fixture!(remove_does_nothing_if_removal_requires_update_of_dep); -installer_fixture!( - replace_alias, - ignore = "mozart binary cannot yet run this fixture" -); +installer_fixture!(replace_alias, ignore); installer_fixture!(replace_priorities); installer_fixture!(replace_range_require_single_version); installer_fixture!(replace_root_require); installer_fixture!(replaced_packages_should_not_be_installed); installer_fixture!( replaced_packages_should_not_be_installed_when_installing_from_lock, - ignore = "mozart binary cannot yet run this fixture" + ignore ); installer_fixture!(replacer_satisfies_its_own_requirement); -installer_fixture!( - repositories_priorities, - ignore = "mozart binary cannot yet run this fixture" -); +installer_fixture!(repositories_priorities, ignore); installer_fixture!(repositories_priorities2); installer_fixture!(repositories_priorities3); -installer_fixture!( - repositories_priorities4, - ignore = "mozart binary cannot yet run this fixture" -); -installer_fixture!( - repositories_priorities5, - ignore = "mozart binary cannot yet run this fixture" -); -installer_fixture!( - root_alias_change_with_circular_dep, - ignore = "mozart binary cannot yet run this fixture" -); +installer_fixture!(repositories_priorities4, ignore); +installer_fixture!(repositories_priorities5, ignore); +installer_fixture!(root_alias_change_with_circular_dep, ignore); installer_fixture!(root_alias_gets_loaded_for_locked_pkgs); installer_fixture!(root_requirements_do_not_affect_locked_versions); -installer_fixture!( - solver_problem_with_hash_in_branch, - ignore = "mozart binary cannot yet run this fixture" -); +installer_fixture!(solver_problem_with_hash_in_branch, ignore); installer_fixture!(solver_problems); installer_fixture!(solver_problems_with_disabled_platform); installer_fixture!(suggest_installed); @@ -320,16 +212,13 @@ installer_fixture!(suggest_replaced); installer_fixture!(suggest_uninstalled); installer_fixture!( unbounded_conflict_does_not_match_default_branch_with_branch_alias, - ignore = "mozart binary cannot yet run this fixture" + ignore ); installer_fixture!(unbounded_conflict_does_not_match_default_branch_with_numeric_branch); -installer_fixture!( - unbounded_conflict_matches_default_branch, - ignore = "mozart binary cannot yet run this fixture" -); +installer_fixture!(unbounded_conflict_matches_default_branch, ignore); installer_fixture!( update_abandoned_package_required_but_blocked_via_audit_config, - ignore = "mozart binary cannot yet run this fixture" + ignore ); installer_fixture!(update_alias); installer_fixture!(update_alias_lock); @@ -349,10 +238,7 @@ installer_fixture!(update_allow_list_removes_unused); installer_fixture!(update_allow_list_require_new_replace); installer_fixture!(update_allow_list_warns_non_existing_patterns); installer_fixture!(update_allow_list_with_dependencies); -installer_fixture!( - update_allow_list_with_dependencies_alias, - ignore = "mozart binary cannot yet run this fixture" -); +installer_fixture!(update_allow_list_with_dependencies_alias, ignore); installer_fixture!(update_allow_list_with_dependencies_new_requirement); installer_fixture!(update_allow_list_with_dependencies_require_new); installer_fixture!(update_allow_list_with_dependencies_require_new_replace); @@ -362,10 +248,7 @@ installer_fixture!(update_changes_url); installer_fixture!(update_dev_ignores_providers); installer_fixture!(update_dev_packages_updates_repo_url); installer_fixture!(update_dev_to_new_ref_picks_up_changes); -installer_fixture!( - update_downgrades_unstable_packages, - ignore = "mozart binary cannot yet run this fixture" -); +installer_fixture!(update_downgrades_unstable_packages, ignore); installer_fixture!(update_ignore_platform_package_requirement_list); installer_fixture!(update_ignore_platform_package_requirement_list_upper_bounds); installer_fixture!(update_ignore_platform_package_requirement_wildcard); @@ -383,7 +266,7 @@ installer_fixture!(update_package_present_in_lock_but_not_in_remote); installer_fixture!(update_package_present_in_lock_but_not_in_remote_due_to_min_stability); installer_fixture!( update_package_present_in_lower_repo_prio_but_not_main_due_to_min_stability, - ignore = "mozart binary cannot yet run this fixture" + ignore ); installer_fixture!(update_picks_up_change_of_vcs_type); installer_fixture!(update_prefer_lowest_stable); @@ -391,13 +274,10 @@ installer_fixture!(update_reference); installer_fixture!(update_reference_picks_latest); installer_fixture!(update_removes_unused_locked_dep); installer_fixture!(update_requiring_decision_reverts_and_learning_positive_literals); -installer_fixture!( - update_security_advisory_matching_direct_dependency, - ignore = "mozart binary cannot yet run this fixture" -); +installer_fixture!(update_security_advisory_matching_direct_dependency, ignore); installer_fixture!( update_security_advisory_matching_indirect_dependency, - ignore = "mozart binary cannot yet run this fixture" + ignore ); installer_fixture!(update_syncs_outdated); installer_fixture!(update_to_empty_from_blank); |
