diff options
author | Robert Löhning <robert.loehning@qt.io> | 2023-01-25 16:49:57 +0100 |
---|---|---|
committer | Robert Löhning <robert.loehning@qt.io> | 2023-03-13 22:22:05 +0000 |
commit | ad97925b4671ad8d0c518c308c0000fa261e72e5 (patch) | |
tree | edcd6ea37c08bdbb96a86eccd24193f3b55f4441 | |
parent | 4584edaef01d5a4fbd008541be8031aa1081a960 (diff) |
Squish: Read expected version from version.log as fallback
Change-Id: If5838639bbb37ea8286c5c315289d961ad0ef56a
Reviewed-by: Miguel Costa <miguel.costa@qt.io>
-rw-r--r-- | Tests/system/suite_installation/shared/scripts/install_utils.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/Tests/system/suite_installation/shared/scripts/install_utils.py b/Tests/system/suite_installation/shared/scripts/install_utils.py index 93b8e670..afcaa3a8 100644 --- a/Tests/system/suite_installation/shared/scripts/install_utils.py +++ b/Tests/system/suite_installation/shared/scripts/install_utils.py @@ -5,8 +5,6 @@ # -*- coding: utf-8 -*- -from xml.dom import minidom - import globalnames @@ -42,6 +40,11 @@ def changesScheduledLabelExists(): return object.exists(names.changes_scheduled_Label) +def readFile(filename): + with open(filename, "r") as f: + return f.read() + + def readExpectedVsToolsVersion(): expectedVersion = os.getenv("SQUISH_VSTOOLS_VERSION") if expectedVersion: @@ -50,8 +53,7 @@ def readExpectedVsToolsVersion(): "The environment variable SQUISH_VSTOOLS_VERSION is not set. Falling back to " "reading the expected version from version.targets") try: - versionXml = minidom.parse("../../../../version.targets") - return versionXml.getElementsByTagName("QtVSToolsVersion")[0].firstChild.data + return readFile("../../../../version.log") except: test.fatal("Can't read expected VS Tools version from sources.") return "" @@ -60,5 +62,6 @@ def readExpectedVsToolsVersion(): def verifyVsToolsVersion(): displayedVersion = waitForObjectExists(names.manage_Extensions_Version_Label).text expectedVersion = readExpectedVsToolsVersion() - test.compare(displayedVersion, expectedVersion, - "Expected version of VS Tools is displayed?") + if expectedVersion: + test.compare(displayedVersion, expectedVersion, + "Expected version of VS Tools is displayed?") |