From 0c70d6ec59016081acc5dbac23b4ef62568410d0 Mon Sep 17 00:00:00 2001 From: InsanePrawn Date: Thu, 22 Sep 2022 07:10:53 +0200 Subject: [PATCH] integration_tests.test_packages_update(): use switch_branch=True and check if branch successfully switched --- integration_tests.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/integration_tests.py b/integration_tests.py index 435c24b..79f83ff 100644 --- a/integration_tests.py +++ b/integration_tests.py @@ -23,21 +23,23 @@ def ctx() -> click.Context: if not tempdir: tempdir = get_temp_dir() config.file.paths.update(CONFIG_DEFAULTS.paths | {'cache_dir': tempdir}) - print(f'cache_dir: {config.file.paths.cache_dir}') + print(f'cache_dir: {config.file.paths.cache_dir}') return click.Context(click.Command('integration_tests')) def test_packages_update(ctx: click.Context): kbs_branch = git_get_branch(config.runtime.script_source_dir) + pkgbuilds_path = config.get_path('pkgbuilds') for branch, may_fail in {'main': False, 'dev': False, kbs_branch: True}.items(): config.file.pkgbuilds.git_branch = branch try: - ctx.invoke(cmd_update, non_interactive=True) - print("WOULD CTX INVOKE UPDATE HERE") + ctx.invoke(cmd_update, non_interactive=True, switch_branch=True) except Exception as ex: + print(f'may_fail: {may_fail}; Exception: {ex}') if not may_fail: - print(f'Exception: {ex}') - assert may_fail + raise ex + continue + assert git_get_branch(pkgbuilds_path) == branch def test_packages_clean(ctx: click.Context):