<<

NAME

Koha::Devel::CI::IncrementalRuns - A module for managing incremental CI runs in Koha development.

SYNOPSIS

    use Koha::Devel::CI::IncrementalRuns;

    my $ci = Koha::Devel::CI::IncrementalRuns->new({
        context      => 'tidy',
    });

    my @files_to_test = $ci->get_files_to_test('pl');
    $ci->report_results($results);

DESCRIPTION

Koha::Devel::CI::IncrementalRuns is a module designed to manage incremental CI runs in the Koha development environment. It provides functionality to determine which files need to be tested based on previous CI runs and to report the results of those tests.

METHODS

new

    my $ci = Koha::Devel::CI::IncrementalRuns->new({
        incremental_run => 1,
        git_repo_dir    => '/path/to/repo',
        repo_url        => 'https://gitlab.com/koha-community/koha-ci-results.git',
        report          => 1,
        token           => 'your_token',
        test_name       => 'test_name',
        context         => 'tidy',
    });

Creates a new instance of Koha::Devel::CI::IncrementalRuns. The constructor accepts a hash reference with the following keys: - `incremental_run`: A flag indicating whether to run incrementally the tests [default env KOHA_CI_INCREMENTAL_RUNS] - `git_repo_dir`: The directory where the Git repository is stored [default /tmp/koha-ci-results] - `repo_url`: The URL of the Git repository [default env KOHA_CI_INCREMENTAL_RUN_REPO_URL] - `report`: A flag indicating whether to report the results [default env KOHA_CI_INCREMENTAL_RUNS_REPORT] - `token`: The token for authenticating with the Git repository [default env KOHA_CI_INCREMENTAL_RUNS_TOKEN] - `test_name`: The name of the test [default name of the test] - `context`: The context for file exclusions

get_files_to_test

    my @files_to_test = $ci->get_files_to_test('pl');

Determines the list of files to be tested based on the incremental run settings. If incremental runs are enabled, it retrieves the list of files that have been modified since the last build. Otherwise, it retrieves all relevant files.

report_results

    $ci->report_results($results);

Reports the results of the tests by committing the list of failures to the Git repository. This method is called only if the `report` flag is set.

<<