How to use the packit.config.JobConfig function in packit

To help you get started, we’ve selected a few packit examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github packit-service / packit / tests / unit / test_config.py View on Github external
def get_job_config_full(**kwargs):
    """ pass kwargs to JobConfig constructor """
    return JobConfig(
        type=JobType.propose_downstream,
        trigger=JobConfigTriggerType.pull_request,
        metadata=JobMetadataConfig(dist_git_branches=["master"]),
        **kwargs
    )
github packit-service / packit / tests / integration / test_get_api.py View on Github external
            JobConfig(
                type=JobType.build,
                trigger=JobConfigTriggerType.pull_request,
                upstream_project_url="https://github.com/packit-service/ogr",
            ),
            True,
        ),
    ],
)
def test_get_api(tmp_path, remotes, package_config, is_upstream):
    repo = tmp_path / "project_repo"
    repo.mkdir(parents=True, exist_ok=True)
    initiate_git_repo(repo, remotes=remotes)

    flexmock(utils).should_receive("get_local_package_config").and_return(
        package_config
    )
github packit-service / packit / tests / unit / test_package_config.py View on Github external
                    JobConfig(
                        type=JobType.build,
                        trigger=JobConfigTriggerType.release,
                        specfile_path="somewhere/package.spec",
                        synced_files=SyncFilesConfig(
                            [SyncFilesItem(x, x) for x in ("a", "b", "c")]
                        ),
                        actions={ActionName.create_archive: "ls"},
                        spec_source_id="Source1",
                    )
                ],
            ),
            id="override-alot",
        ),
    ],
)
def test_package_config_overrides(raw, expected):
github packit-service / packit / tests / unit / test_package_config.py View on Github external
                    JobConfig(
                        type=JobType.copr_build,
                        trigger=JobConfigTriggerType.pull_request,
                        metadata=JobMetadataConfig(project="example"),
                    )
                ],
            ),
            "example",
        ),
        (
            PackageConfig(
                specfile_path="xxx",
                jobs=[
                    JobConfig(
                        type=JobType.copr_build,
                        trigger=JobConfigTriggerType.release,
                        metadata=JobMetadataConfig(project="example1"),
github packit-service / packit / tests / unit / test_config.py View on Github external
def get_job_config_simple(**kwargs):
    """ pass kwargs to JobConfig constructor """
    return JobConfig(type=JobType.build, trigger=JobConfigTriggerType.release, **kwargs)
github packit-service / packit / tests / unit / test_config.py View on Github external
def get_default_job_config(**kwargs):
    """ pass kwargs to JobConfig constructor """
    return [
        JobConfig(
            type=JobType.tests,
            trigger=JobConfigTriggerType.pull_request,
            metadata=JobMetadataConfig(targets=["fedora-stable"]),
            **kwargs
        ),
        JobConfig(
            type=JobType.propose_downstream,
            trigger=JobConfigTriggerType.release,
            metadata=JobMetadataConfig(dist_git_branches=["fedora-all"]),
            **kwargs
        ),
github packit-service / packit / tests / unit / test_config.py View on Github external
def get_job_config_build_for_branch(**kwargs):
    """ pass kwargs to JobConfig constructor """
    return JobConfig(
        type=JobType.copr_build,
        trigger=JobConfigTriggerType.commit,
        metadata=JobMetadataConfig(branch="build-branch", scratch=True),
        **kwargs
    )