Developer-Dashboard

 view release on metacpan or  search on metacpan

t/45-skills-progress-platform.t  view on Meta::CPAN

    my @task_ids = map { $_->{id} } @{ $manager->dependency_progress_tasks_for_skill_path($skill_root) || [] };
    is_deeply( \@task_ids, ['install_dnfile'], 'skills install progress on Fedora-like hosts keeps only dnfile-backed package manager work' );
}

{
    local $ENV{DD_TEST_OS} = 'solaris';
    local $ENV{DD_TEST_DEBIAN_LIKE} = 0;
    local $ENV{DD_TEST_ALPINE} = 0;
    local $ENV{DD_TEST_FEDORA} = 0;
    my $skill_root = tempdir( CLEANUP => 1 );
    my $manager = Developer::Dashboard::SkillManager->new();
    _write_file( File::Spec->catfile( $skill_root, 'aptfile' ), "jq\n" );
    _write_file( File::Spec->catfile( $skill_root, 'brewfile' ), "jq\n" );
    _write_file( File::Spec->catfile( $skill_root, 'cpanfile' ), "requires 'JSON::XS';\n" );
    my @task_ids = map { $_->{id} } @{ $manager->dependency_progress_tasks_for_skill_path($skill_root) || [] };
    is_deeply(
        \@task_ids,
        ['install_cpanfile'],
        'skills install progress on unknown hosts still hides OS-specific manifests and keeps only present cross-platform tasks',
    );
}

done_testing();

sub _write_file {
    my ( $path, $content ) = @_;
    my ( undef, $dir ) = File::Spec->splitpath($path);
    make_path($dir) if defined $dir && $dir ne '' && !-d $dir;
    open my $fh, '>', $path or die "Unable to write $path: $!";
    print {$fh} $content;
    close $fh;
    return 1;
}

__END__

=pod

=head1 NAME

t/45-skills-progress-platform.t - skill install progress host filtering regression

=head1 PURPOSE

This test keeps the skill-install progress board aligned with the current host.
It verifies that dependency detail output is capped to ten lines and that only
platform-relevant package-manager tasks stay visible in the progress board.

=head1 WHY IT EXISTS

The skills install progress board became noisy and misleading because it showed
every package-manager step regardless of the current operating system. This
test exists to stop regressions where Linux users see irrelevant Brew or
Winget progress rows, macOS users see Apt rows, or dependency output floods
the whole terminal instead of staying capped.

=head1 WHEN TO USE

Use this test when changing the skills install progress task list, the
platform-detection logic behind package-manager filtering, or the detail-line
limit used while streaming dependency installation progress.

=head1 HOW TO USE

Run this file directly with C<prove -lv t/45-skills-progress-platform.t> when
iterating on the progress board behaviour, or let it run through the full test
suite to confirm the regression stays covered across the release gates. The
test forces synthetic Linux and macOS host markers through environment
variables and inspects the captured progress object produced by the skills
helper.

=head1 WHAT USES IT

This file is used by the repository release metadata gate, the full Perl test
suite, and contributors changing C<Developer::Dashboard::CLI::Skills> or the
shared progress rendering behaviour.

=head1 EXAMPLES

  prove -lv t/45-skills-progress-platform.t
  prove -lr t

=cut



( run in 1.572 second using v1.01-cache-2.11-cpan-6aa56a78535 )