diff options
author | Katja Marttila <katja.marttila@qt.io> | 2020-11-09 16:21:48 +0200 |
---|---|---|
committer | Katja Marttila <katja.marttila@qt.io> | 2020-11-10 12:30:03 +0200 |
commit | 24ad54c694ebd93150efb6aab64ea0b63beba452 (patch) | |
tree | b537c4f53768292484d21056139452580f2405af /tests | |
parent | a5025ddb30b6ae6423a41ac2323e1b902ae0dd8f (diff) |
Repogen: Fix unite metadata when --repository switch used
United metadata 7z was missing the component which had no update
available.
Task-number: QTIFW-2018
Change-Id: I069fd852499f157075bf28e3ccfef3e42e5f30a9
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
Diffstat (limited to 'tests')
23 files changed, 67 insertions, 40 deletions
diff --git a/tests/auto/tools/repotest/repository_componentAndUnite/2020-10-13-0958_meta.7z b/tests/auto/tools/repotest/repository_componentAndUnite/2020-10-13-0958_meta.7z Binary files differdeleted file mode 100644 index b8e560fed..000000000 --- a/tests/auto/tools/repotest/repository_componentAndUnite/2020-10-13-0958_meta.7z +++ /dev/null diff --git a/tests/auto/tools/repotest/repository_componentAndUnite/2020-11-10-0816_meta.7z b/tests/auto/tools/repotest/repository_componentAndUnite/2020-11-10-0816_meta.7z Binary files differnew file mode 100644 index 000000000..6a17ac028 --- /dev/null +++ b/tests/auto/tools/repotest/repository_componentAndUnite/2020-11-10-0816_meta.7z diff --git a/tests/auto/tools/repotest/repository_componentAndUnite/A/2.0.0content.7z b/tests/auto/tools/repotest/repository_componentAndUnite/A/2.0.0content.7z Binary files differindex 46e2c9124..ef8741d32 100644 --- a/tests/auto/tools/repotest/repository_componentAndUnite/A/2.0.0content.7z +++ b/tests/auto/tools/repotest/repository_componentAndUnite/A/2.0.0content.7z diff --git a/tests/auto/tools/repotest/repository_componentAndUnite/A/2.0.0content.7z.sha1 b/tests/auto/tools/repotest/repository_componentAndUnite/A/2.0.0content.7z.sha1 index 53010cea2..d5e23fd53 100644 --- a/tests/auto/tools/repotest/repository_componentAndUnite/A/2.0.0content.7z.sha1 +++ b/tests/auto/tools/repotest/repository_componentAndUnite/A/2.0.0content.7z.sha1 @@ -1 +1 @@ -059e5ed8cd3a1fbca08cccfa4075265192603e3f
\ No newline at end of file +c7cca768ebfe60c4295a79762d4e19e63f2c21d2
\ No newline at end of file diff --git a/tests/auto/tools/repotest/repository_componentAndUnite/A/2.0.0meta.7z b/tests/auto/tools/repotest/repository_componentAndUnite/A/2.0.0meta.7z Binary files differindex 3cda3cdc4..c3cf7f7fa 100644 --- a/tests/auto/tools/repotest/repository_componentAndUnite/A/2.0.0meta.7z +++ b/tests/auto/tools/repotest/repository_componentAndUnite/A/2.0.0meta.7z diff --git a/tests/auto/tools/repotest/repository_componentAndUnite/B/1.0.0content.7z b/tests/auto/tools/repotest/repository_componentAndUnite/B/1.0.0content.7z Binary files differdeleted file mode 100644 index 46e2c9124..000000000 --- a/tests/auto/tools/repotest/repository_componentAndUnite/B/1.0.0content.7z +++ /dev/null diff --git a/tests/auto/tools/repotest/repository_componentAndUnite/B/1.0.0content.7z.sha1 b/tests/auto/tools/repotest/repository_componentAndUnite/B/1.0.0content.7z.sha1 deleted file mode 100644 index 53010cea2..000000000 --- a/tests/auto/tools/repotest/repository_componentAndUnite/B/1.0.0content.7z.sha1 +++ /dev/null @@ -1 +0,0 @@ -059e5ed8cd3a1fbca08cccfa4075265192603e3f
\ No newline at end of file diff --git a/tests/auto/tools/repotest/repository_componentAndUnite/B/1.0.0meta.7z b/tests/auto/tools/repotest/repository_componentAndUnite/B/1.0.0meta.7z Binary files differdeleted file mode 100644 index e2867c1ee..000000000 --- a/tests/auto/tools/repotest/repository_componentAndUnite/B/1.0.0meta.7z +++ /dev/null diff --git a/tests/auto/tools/repotest/repository_componentAndUnite/C/1.0.0content.7z b/tests/auto/tools/repotest/repository_componentAndUnite/C/1.0.0content.7z Binary files differnew file mode 100644 index 000000000..de70ee790 --- /dev/null +++ b/tests/auto/tools/repotest/repository_componentAndUnite/C/1.0.0content.7z diff --git a/tests/auto/tools/repotest/repository_componentAndUnite/C/1.0.0content.7z.sha1 b/tests/auto/tools/repotest/repository_componentAndUnite/C/1.0.0content.7z.sha1 new file mode 100644 index 000000000..c290ccf6c --- /dev/null +++ b/tests/auto/tools/repotest/repository_componentAndUnite/C/1.0.0content.7z.sha1 @@ -0,0 +1 @@ +0e995c11dc35bd2b4ac04d408eb7091f8322ea49
\ No newline at end of file diff --git a/tests/auto/tools/repotest/repository_componentAndUnite/C/1.0.0meta.7z b/tests/auto/tools/repotest/repository_componentAndUnite/C/1.0.0meta.7z Binary files differnew file mode 100644 index 000000000..8b389f955 --- /dev/null +++ b/tests/auto/tools/repotest/repository_componentAndUnite/C/1.0.0meta.7z diff --git a/tests/auto/tools/repotest/repository_componentAndUnite/Updates.xml b/tests/auto/tools/repotest/repository_componentAndUnite/Updates.xml index 653c0e91e..802f0a53e 100644 --- a/tests/auto/tools/repotest/repository_componentAndUnite/Updates.xml +++ b/tests/auto/tools/repotest/repository_componentAndUnite/Updates.xml @@ -1,9 +1,7 @@ <Updates> <ApplicationName>{AnyApplication}</ApplicationName> <ApplicationVersion>1.0.0</ApplicationVersion> - <Checksum>true</Checksum> - <SHA1>815dc9afb48774335e468956fa2e1208a239dc06</SHA1> - <MetadataName>2020-10-13-0958_meta.7z</MetadataName> + <Checksum>false</Checksum> <PackageUpdate> <Name>A</Name> <DisplayName>A</DisplayName> @@ -12,19 +10,21 @@ <ReleaseDate>2020-01-01</ReleaseDate> <Default>true</Default> <Script>script2.0.0.qs</Script> - <UpdateFile UncompressedSize="40" CompressedSize="72" OS="Any"/> + <UpdateFile OS="Any" CompressedSize="240" UncompressedSize="74"/> <DownloadableArchives>content.7z</DownloadableArchives> - <SHA1>f02d025098d76673f3a848e5d5f0421ffa5ee82d</SHA1> + <SHA1>11f74e8fbc7d6c155dd6503c460c2c1955340cc1</SHA1> </PackageUpdate> <PackageUpdate> - <Name>B</Name> - <DisplayName>B</DisplayName> - <Description>Example component B</Description> + <Name>C</Name> + <DisplayName>C</DisplayName> + <Description>Example component C</Description> <Version>1.0.0</Version> - <ReleaseDate>2020-01-01</ReleaseDate> + <ReleaseDate>2015-01-01</ReleaseDate> <Default>true</Default> - <UpdateFile UncompressedSize="40" CompressedSize="72" OS="Any"/> + <UpdateFile OS="Any" CompressedSize="239" UncompressedSize="89"/> <DownloadableArchives>content.7z</DownloadableArchives> - <SHA1>c520ba1bbde7eb1adf4b274c869a8df0a5efa5b8</SHA1> + <SHA1>4558f31428ef88eb23521b4f119465967945e2f7</SHA1> </PackageUpdate> + <SHA1>d674e6574895c02d3a02fb97a46b159d35f17c68</SHA1> + <MetadataName>2020-11-10-0816_meta.7z</MetadataName> </Updates> diff --git a/tests/auto/tools/repotest/repository_unite/2020-10-13-0958_meta.7z b/tests/auto/tools/repotest/repository_unite/2020-10-13-0958_meta.7z Binary files differdeleted file mode 100644 index 4ff34ad9f..000000000 --- a/tests/auto/tools/repotest/repository_unite/2020-10-13-0958_meta.7z +++ /dev/null diff --git a/tests/auto/tools/repotest/repository_unite/2020-11-10-0931_meta.7z b/tests/auto/tools/repotest/repository_unite/2020-11-10-0931_meta.7z Binary files differnew file mode 100644 index 000000000..4008dc656 --- /dev/null +++ b/tests/auto/tools/repotest/repository_unite/2020-11-10-0931_meta.7z diff --git a/tests/auto/tools/repotest/repository_unite/A/2.0.0content.7z b/tests/auto/tools/repotest/repository_unite/A/2.0.0content.7z Binary files differindex 46e2c9124..ef8741d32 100644 --- a/tests/auto/tools/repotest/repository_unite/A/2.0.0content.7z +++ b/tests/auto/tools/repotest/repository_unite/A/2.0.0content.7z diff --git a/tests/auto/tools/repotest/repository_unite/A/2.0.0content.7z.sha1 b/tests/auto/tools/repotest/repository_unite/A/2.0.0content.7z.sha1 index 53010cea2..d5e23fd53 100644 --- a/tests/auto/tools/repotest/repository_unite/A/2.0.0content.7z.sha1 +++ b/tests/auto/tools/repotest/repository_unite/A/2.0.0content.7z.sha1 @@ -1 +1 @@ -059e5ed8cd3a1fbca08cccfa4075265192603e3f
\ No newline at end of file +c7cca768ebfe60c4295a79762d4e19e63f2c21d2
\ No newline at end of file diff --git a/tests/auto/tools/repotest/repository_unite/B/1.0.0content.7z b/tests/auto/tools/repotest/repository_unite/B/1.0.0content.7z Binary files differdeleted file mode 100644 index 46e2c9124..000000000 --- a/tests/auto/tools/repotest/repository_unite/B/1.0.0content.7z +++ /dev/null diff --git a/tests/auto/tools/repotest/repository_unite/B/1.0.0content.7z.sha1 b/tests/auto/tools/repotest/repository_unite/B/1.0.0content.7z.sha1 deleted file mode 100644 index 53010cea2..000000000 --- a/tests/auto/tools/repotest/repository_unite/B/1.0.0content.7z.sha1 +++ /dev/null @@ -1 +0,0 @@ -059e5ed8cd3a1fbca08cccfa4075265192603e3f
\ No newline at end of file diff --git a/tests/auto/tools/repotest/repository_unite/C/1.0.0content.7z b/tests/auto/tools/repotest/repository_unite/C/1.0.0content.7z Binary files differnew file mode 100644 index 000000000..de70ee790 --- /dev/null +++ b/tests/auto/tools/repotest/repository_unite/C/1.0.0content.7z diff --git a/tests/auto/tools/repotest/repository_unite/C/1.0.0content.7z.sha1 b/tests/auto/tools/repotest/repository_unite/C/1.0.0content.7z.sha1 new file mode 100644 index 000000000..c290ccf6c --- /dev/null +++ b/tests/auto/tools/repotest/repository_unite/C/1.0.0content.7z.sha1 @@ -0,0 +1 @@ +0e995c11dc35bd2b4ac04d408eb7091f8322ea49
\ No newline at end of file diff --git a/tests/auto/tools/repotest/repository_unite/Updates.xml b/tests/auto/tools/repotest/repository_unite/Updates.xml index c9bcc93cd..0b0a8987b 100644 --- a/tests/auto/tools/repotest/repository_unite/Updates.xml +++ b/tests/auto/tools/repotest/repository_unite/Updates.xml @@ -1,9 +1,7 @@ <Updates> <ApplicationName>{AnyApplication}</ApplicationName> <ApplicationVersion>1.0.0</ApplicationVersion> - <Checksum>true</Checksum> - <SHA1>4a494d033d3092b392ba775b17a7e4776ccf4777</SHA1> - <MetadataName>2020-10-13-0958_meta.7z</MetadataName> + <Checksum>false</Checksum> <PackageUpdate> <Name>A</Name> <DisplayName>A</DisplayName> @@ -12,17 +10,19 @@ <ReleaseDate>2020-01-01</ReleaseDate> <Default>true</Default> <Script>script2.0.0.qs</Script> - <UpdateFile UncompressedSize="40" CompressedSize="72" OS="Any"/> + <UpdateFile CompressedSize="240" UncompressedSize="74" OS="Any"/> <DownloadableArchives>content.7z</DownloadableArchives> </PackageUpdate> <PackageUpdate> - <Name>B</Name> - <DisplayName>B</DisplayName> - <Description>Example component B</Description> + <Name>C</Name> + <DisplayName>C</DisplayName> + <Description>Example component C</Description> <Version>1.0.0</Version> - <ReleaseDate>2020-01-01</ReleaseDate> + <ReleaseDate>2015-01-01</ReleaseDate> <Default>true</Default> - <UpdateFile UncompressedSize="40" CompressedSize="72" OS="Any"/> + <UpdateFile CompressedSize="239" UncompressedSize="89" OS="Any"/> <DownloadableArchives>content.7z</DownloadableArchives> </PackageUpdate> + <SHA1>3b46ef65a751d9498205412fc22de43ce29e5d8a</SHA1> + <MetadataName>2020-11-10-0931_meta.7z</MetadataName> </Updates> diff --git a/tests/auto/tools/repotest/settings.qrc b/tests/auto/tools/repotest/settings.qrc index 77d250b20..e731af222 100644 --- a/tests/auto/tools/repotest/settings.qrc +++ b/tests/auto/tools/repotest/settings.qrc @@ -20,16 +20,16 @@ <file>repository_componentAndUnite/A/2.0.0content.7z</file> <file>repository_componentAndUnite/A/2.0.0content.7z.sha1</file> <file>repository_componentAndUnite/A/2.0.0meta.7z</file> - <file>repository_componentAndUnite/B/1.0.0content.7z</file> - <file>repository_componentAndUnite/B/1.0.0content.7z.sha1</file> - <file>repository_componentAndUnite/B/1.0.0meta.7z</file> - <file>repository_componentAndUnite/2020-10-13-0958_meta.7z</file> + <file>repository_componentAndUnite/C/1.0.0content.7z</file> + <file>repository_componentAndUnite/C/1.0.0content.7z.sha1</file> + <file>repository_componentAndUnite/C/1.0.0meta.7z</file> + <file>repository_componentAndUnite/2020-11-10-0816_meta.7z</file> <file>repository_componentAndUnite/Updates.xml</file> <file>repository_unite/A/2.0.0content.7z</file> <file>repository_unite/A/2.0.0content.7z.sha1</file> - <file>repository_unite/B/1.0.0content.7z</file> - <file>repository_unite/B/1.0.0content.7z.sha1</file> - <file>repository_unite/2020-10-13-0958_meta.7z</file> + <file>repository_unite/C/1.0.0content.7z</file> + <file>repository_unite/C/1.0.0content.7z.sha1</file> + <file>repository_unite/2020-11-10-0931_meta.7z</file> <file>repository_unite/Updates.xml</file> </qresource> </RCC> diff --git a/tests/auto/tools/repotest/tst_repotest.cpp b/tests/auto/tools/repotest/tst_repotest.cpp index 2f5ca2cbb..5aa614454 100644 --- a/tests/auto/tools/repotest/tst_repotest.cpp +++ b/tests/auto/tools/repotest/tst_repotest.cpp @@ -65,8 +65,13 @@ private: } if (updateNewComponents) { //Verify that component B exists as that is not updated - VerifyInstaller::verifyFileExistence(m_repositoryDir + "/B", QStringList() << "1.0.0content.7z" - << "1.0.0content.7z.sha1" << "1.0.0meta.7z"); + if (createSplitMetadata) { + VerifyInstaller::verifyFileExistence(m_repositoryDir + "/B", QStringList() << "1.0.0content.7z" + << "1.0.0content.7z.sha1" << "1.0.0meta.7z"); + } else { + VerifyInstaller::verifyFileExistence(m_repositoryDir + "/B", QStringList() << "1.0.0content.7z" + << "1.0.0content.7z.sha1"); + } } else { QDir dir(m_repositoryDir + "/B"); QVERIFY(!dir.exists()); @@ -88,7 +93,10 @@ private: QInstallerTools::copyComponentData(directories, m_repositoryDir, &m_packages); QInstallerTools::copyMetaData(m_tmpMetaDir, m_repositoryDir, m_packages, QLatin1String("{AnyApplication}"), QLatin1String("1.0.0"), unite7zFiles); - QInstallerTools::compressMetaDirectories(m_tmpMetaDir, m_tmpMetaDir, pathToVersionMapping, + QString existing7z = QInstallerTools::existingUniteMeta7z(m_repositoryDir); + if (!existing7z.isEmpty()) + existing7z = m_repositoryDir + QDir::separator() + existing7z; + QInstallerTools::compressMetaDirectories(m_tmpMetaDir, existing7z, pathToVersionMapping, createSplitMetadata, createUnifiedMetadata); QDirIterator it(m_repositoryDir, QStringList(QLatin1String("Updates*.xml")) << QLatin1String("*_meta.7z"), QDir::Files | QDir::CaseSensitive); @@ -135,7 +143,9 @@ private: + "Updates.xml"); QRegularExpression re("<MetadataName>(.*)<.MetadataName>"); QStringList matches = re.match(fileContent).capturedTexts(); + QString existingUniteMeta7z = QInstallerTools::existingUniteMeta7z(m_repositoryDir); QCOMPARE(2, matches.count()); + QCOMPARE(existingUniteMeta7z, matches.at(1)); QFile file(m_repositoryDir + QDir::separator() + matches.at(1)); QVERIFY(file.open(QIODevice::ReadOnly)); @@ -217,7 +227,6 @@ private: QTest::ignoreMessage(QtDebugMsg, qPrintable(message.arg(repository))); QTest::ignoreMessage(QtDebugMsg, "Collecting information about available packages..."); QTest::ignoreMessage(QtDebugMsg, "No available packages found at the specified location."); - QTest::ignoreMessage(QtDebugMsg, "- it provides the package \"B\" - \"1.0.0\""); QTest::ignoreMessage(QtDebugMsg, "- it provides the package \"A\" - \"2.0.0\""); } @@ -291,6 +300,14 @@ private: ignoreMessagesForCopyMetadata("B", false, true); } + void ignoreMessageForUpdateComponent() + { + QString message = "Update component \"A\" in \"%1\" ."; + QTest::ignoreMessage(QtDebugMsg, qPrintable(message.arg(m_repositoryDir))); + message = "Update component \"C\" in \"%1\" ."; + QTest::ignoreMessage(QtDebugMsg, qPrintable(message.arg(m_repositoryDir))); + } + private slots: void init() { @@ -413,6 +430,8 @@ private slots: initRepoUpdateFromRepository(":///repository_component"); ignoreMessageForCollectingRepository("repository_component"); + QTest::ignoreMessage(QtDebugMsg, "- it provides the package \"B\" - \"1.0.0\""); + ignoreMessagesForCopyRepository("B", "1.0.0", "repository_component"); ignoreMessagesForCopyRepository("A", "2.0.0", "repository_component"); ignoreMessagesForComponentSha(QStringList() << "A" << "B", true); @@ -430,12 +449,16 @@ private slots: initRepoUpdateFromRepository(":///repository_componentAndUnite"); ignoreMessageForCollectingRepository("repository_componentAndUnite"); + QTest::ignoreMessage(QtDebugMsg, "- it provides the package \"C\" - \"1.0.0\""); + ignoreMessageForUpdateComponent(); ignoreMessagesForCopyRepository("A", "2.0.0", "repository_componentAndUnite"); - ignoreMessagesForCopyRepository("B", "1.0.0", "repository_componentAndUnite"); + ignoreMessagesForCopyRepository("C", "1.0.0", "repository_componentAndUnite"); ignoreMessagesForUniteMeta(true); - ignoreMessagesForComponentSha(QStringList() << "A" << "B", true); - generateRepo(true, true, false); + ignoreMessagesForComponentSha(QStringList() << "A" << "C", true); + + generateRepo(true, true, true); verifyComponentRepository("2.0.0", true); + VerifyInstaller::verifyFileExistence(m_repositoryDir + "/C", QStringList() << "1.0.0content.7z" << "1.0.0content.7z.sha1" << "1.0.0meta.7z"); verifyUniteMetadata("2.0.0"); } @@ -447,11 +470,15 @@ private slots: initRepoUpdateFromRepository(":///repository_unite"); ignoreMessageForCollectingRepository("repository_unite"); + QTest::ignoreMessage(QtDebugMsg, "- it provides the package \"C\" - \"1.0.0\""); + ignoreMessageForUpdateComponent(); ignoreMessagesForCopyRepository("A", "2.0.0", "repository_unite"); - ignoreMessagesForCopyRepository("B", "1.0.0", "repository_unite"); + ignoreMessagesForCopyRepository("C", "1.0.0", "repository_unite"); ignoreMessagesForUniteMeta(true); - generateRepo(false, true, false); + + generateRepo(false, true, true); verifyComponentRepository("2.0.0", false); + VerifyInstaller::verifyFileExistence(m_repositoryDir + "/C", QStringList() << "1.0.0content.7z" << "1.0.0content.7z.sha1"); verifyUniteMetadata("2.0.0"); } |