integration_tests.test_packages_update(): use switch_branch=True and check if branch successfully switched
This commit is contained in:
parent
4fc45bf098
commit
0c70d6ec59
1 changed files with 7 additions and 5 deletions
|
@ -23,21 +23,23 @@ def ctx() -> click.Context:
|
||||||
if not tempdir:
|
if not tempdir:
|
||||||
tempdir = get_temp_dir()
|
tempdir = get_temp_dir()
|
||||||
config.file.paths.update(CONFIG_DEFAULTS.paths | {'cache_dir': tempdir})
|
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'))
|
return click.Context(click.Command('integration_tests'))
|
||||||
|
|
||||||
|
|
||||||
def test_packages_update(ctx: click.Context):
|
def test_packages_update(ctx: click.Context):
|
||||||
kbs_branch = git_get_branch(config.runtime.script_source_dir)
|
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():
|
for branch, may_fail in {'main': False, 'dev': False, kbs_branch: True}.items():
|
||||||
config.file.pkgbuilds.git_branch = branch
|
config.file.pkgbuilds.git_branch = branch
|
||||||
try:
|
try:
|
||||||
ctx.invoke(cmd_update, non_interactive=True)
|
ctx.invoke(cmd_update, non_interactive=True, switch_branch=True)
|
||||||
print("WOULD CTX INVOKE UPDATE HERE")
|
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
|
print(f'may_fail: {may_fail}; Exception: {ex}')
|
||||||
if not may_fail:
|
if not may_fail:
|
||||||
print(f'Exception: {ex}')
|
raise ex
|
||||||
assert may_fail
|
continue
|
||||||
|
assert git_get_branch(pkgbuilds_path) == branch
|
||||||
|
|
||||||
|
|
||||||
def test_packages_clean(ctx: click.Context):
|
def test_packages_clean(ctx: click.Context):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue