Commit fb4ad128 authored by Daniel Smith's avatar Daniel Smith

Update regressionFinder.py to validate shas in qtqtuick3d

Qtquick3d is only available since 5.14, so we should check two things:
1) That the time of the qtquick3d sha is newer than the first
successful integration to qt5
2) And that the branch is either dev or greater than 5.13
Both conditions must be true in order to correctly determine qt5
dependency shas.
parent 118a2df9
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment