Skip to content

Commit 68257d4

Browse files
authored
Skip integration test that compares remote and local version on release branch (#3561)
## Changes Skip integration test that compares remote and local version on release branch. The `databricks.labs.ucx.__about__.__version__` is bumped on the release branch BEFORE the git tag is bumped. The git tag is bumped during release AFTER merging the release branch. Therefore, there this test is expected to fail on a release branch that introduces a major or minor version bump. ### Linked issues Resolves #3533 ### Tests - [x] modified integration tests `test_compare_remote_local_install_versions`
1 parent 0220c42 commit 68257d4

File tree

1 file changed

+23
-6
lines changed

1 file changed

+23
-6
lines changed

tests/integration/install/test_installation.py

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import dataclasses
22
import json
33
import logging
4+
import subprocess
5+
import sys
46
from datetime import timedelta
57
from typing import NoReturn
68

@@ -392,14 +394,29 @@ def test_check_inventory_database_exists(ws, installation_ctx):
392394
installation_ctx.workspace_installer.configure()
393395

394396

395-
def test_compare_remote_local_install_versions(installation_ctx) -> None:
396-
installation_ctx.workspace_installation.run()
397+
def is_on_release_branch(checkout_root: str) -> bool:
398+
"""Check if running on a release branch"""
399+
release_branches = {"prepare/"}
400+
try:
401+
current_branch = subprocess.check_output(
402+
["git", "rev-parse", "--abbrev-ref", "HEAD"], cwd=checkout_root, encoding=sys.getdefaultencoding()
403+
)
404+
return any(current_branch.startswith(release_branch) for release_branch in release_branches)
405+
except subprocess.CalledProcessError:
406+
return False
397407

398-
@retried(on=[NotFound], timeout=timedelta(minutes=2))
399-
def wait_for_installation_to_finish():
400-
installation_ctx.installation.load(WorkspaceConfig)
401408

402-
wait_for_installation_to_finish()
409+
def test_compare_remote_local_install_versions(installation_ctx) -> None:
410+
"""This test is known to fail on a branch with a major or minor version bump.
411+
412+
The databricks.labs.ucx.__about__.__version__ is bumped on the release branch BEFORE the git tag is created. (The
413+
git tag is created during release AFTER merging the release branch.) Therefore, this test is expected to fail on a
414+
release branch that introduces a major or minor version bump, because the local `__version__` has been updated in
415+
anticipation of the tag that will shortly be created.
416+
"""
417+
if is_on_release_branch(installation_ctx.product_info.checkout_root()):
418+
pytest.skip("Version compare is never equal on a release branch.")
419+
installation_ctx.workspace_installation.run()
403420

404421
error_message = "UCX workspace remote and local install versions are same and no override is requested. Exiting..."
405422
with pytest.raises(RuntimeWarning, match=error_message):

0 commit comments

Comments
 (0)