From 12554ebf18e6c2db26e592e52cdcaf97902c1cbf Mon Sep 17 00:00:00 2001 From: InsanePrawn Date: Sat, 5 Nov 2022 04:02:37 +0100 Subject: [PATCH] integration_tests: ensure that failing branch doesn't exist using `git ls-remote` --- integration_tests.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/integration_tests.py b/integration_tests.py index e4b57f4..2549883 100644 --- a/integration_tests.py +++ b/integration_tests.py @@ -3,9 +3,11 @@ import os import pytest from glob import glob +from subprocess import CompletedProcess from config.state import config, CONFIG_DEFAULTS from constants import SRCINFO_METADATA_FILE +from exec.cmd import run_cmd from exec.file import get_temp_dir from logger import setup_logging from packages.cli import cmd_build, cmd_clean, cmd_update @@ -44,6 +46,10 @@ def test_packages_update(ctx: click.Context): print(f'may_fail: {may_fail}; Exception: {ex}') if not may_fail: raise ex + # check branch really doesn't exist + res = run_cmd(f"git ls-remote {CONFIG_DEFAULTS.pkgbuilds.git_repo} 'refs/heads/*' | grep 'refs/heads/{branch}'") + assert isinstance(res, CompletedProcess) + assert res.returncode != 0 continue assert git_get_branch(pkgbuilds_path) == branch