diff --git a/regressionFinder.py b/regressionFinder.py index ce85af0117466feb077d7517b926f7fad519bc91..05559725d1c0ebfd3fc63f85bbe4835c98429ea2 100644 --- a/regressionFinder.py +++ b/regressionFinder.py @@ -12,6 +12,7 @@ import thriftpy import re from time import sleep import atexit +import packaging args = [] basedir = os.getcwd() @@ -84,8 +85,8 @@ def initRepository(repo): print(repo, branch) def cloneRepo(): - proc = subprocess.run(["git", "clone", "-b", branch, f'https://code.qt.io/{repo}.git'], stderr=subprocess.PIPE, universal_newlines=True, cwd=builddir) - print(proc.stderr) + subprocess.run(["git", "clone", "-b", branch, f'https://code.qt.io/{repo}.git'], stderr=subprocess.PIPE, universal_newlines=True, cwd=builddir) + # clone modules if necessary, otherwise just pull latest. if not os.path.exists(os.path.join(builddir, module)): @@ -96,6 +97,13 @@ def initRepository(repo): subprocess.run(["git", "pull", "origin", args.branch, "--quiet"], stderr=subprocess.PIPE, universal_newlines=True, cwd=os.path.join(builddir, module)) subprocess.run(["git", "checkout", branch], stderr=subprocess.PIPE, universal_newlines=True, cwd=os.path.join(builddir, module)) + if repo == "qt/qt5": + # Run the reset and pull again. Sometimes the previous pull leads to merge conflicts. + # We don't care, just needed the first pull to get the lastest submodule list + # and then reset and pull again to get the latest changes. + subprocess.run(["git", "reset", "--hard", f"origin/{args.branch}", "--quiet"], stderr=subprocess.PIPE, universal_newlines=True, cwd=os.path.join(builddir, module)) + subprocess.run(["git", "pull", "origin", args.branch, "--quiet"], stderr=subprocess.PIPE, universal_newlines=True, cwd=os.path.join(builddir, module)) + subprocess.run(["git", "submodule", "update", "--init"], stderr=subprocess.PIPE, universal_newlines=True, cwd=builddir) def validateTest(): # Verify the selected test exists @@ -355,7 +363,15 @@ def findRevToBuild(refRevision, module, branch="", returnParent=False): elif branch in commit["branch"] and module == args.module: # This logic branch will return immediately because it's the module we're testing a specific commit. # We'll check it out directly and just wanted to verify it exists. - return True + # But if the module to test is qtquick3d, verify that the commit date is after the first + # known integration and the branch to test is new enough. + if module == "qtquick3d": + if subprocess.run(["git", "show", "-s", "--format=%ct", refRevision], cwd=os.path.join(builddir, "qt5", args.module), stdout=subprocess.PIPE).stdout < 1566565560: + return False + if (packaging.version.parse(args.branch) if not args.branch == "dev" else False) < packaging.version.parse(5.14): + return False + else: + return True changeID = commit["change_id"] print(f"Found Change ID: {changeID} based on commit {refRevision}") @@ -456,6 +472,7 @@ def findRevToBuild(refRevision, module, branch="", returnParent=False): print(f'Found {module} sha1: {sha}') return sha except Exception: + # Couldn't find the qt5 product sha from the module to build. print(f"ERROR: Couldn't find COIN product sha {workitem.product.sha1} for module {module} in qt5.") saveResult(refRevision, "BadCOINData") return False @@ -867,8 +884,10 @@ def buildChanges(revision, bisecting=False, branch="", buildOnHead=False, noRebu if bisecting: if not determineBuildEligibility(revision, args.module, branch): # Make sure that the revision we're going to test is valid and can be built, so we don't waste time. return False - - for module in ["qtbase", "qtdeclarative", "qtquickcontrols", "qtquickcontrols2", "qtgraphicaleffects", "qtquick3d"]: # Qtbase must be built first. + modulesToBuild = ["qtbase", "qtdeclarative", "qtquickcontrols", "qtquickcontrols2", "qtgraphicaleffects"] + if args.module == "qtquick3d": + modulesToBuild.append("qtquick3d") + for module in modulesToBuild: # Qtbase must be built first. if not checkout(revision, module, branch, buildOnHead=buildOnHead): return False buildModule(module)