diff options
author | Dmitrii Akshintsev <dmitrii.akshintsev@qt.io> | 2024-04-22 16:49:00 +0200 |
---|---|---|
committer | Dmitrii Akshintsev <dmitrii.akshintsev@qt.io> | 2024-04-23 20:33:38 +0200 |
commit | cb43a85ba74cbc6a34c819262cc6b0196f0e6fe3 (patch) | |
tree | 30e19f3e6b257475c1829be58340bc161cf56425 /tests/auto/qml/qmlformat | |
parent | c2a65fbe04bbcac066a8bf1527d064d4866efbfe (diff) |
qmlformat: "Move" testExample e2e tests to /manual
testExample, normalizeExample and actually most of the tests in
tst_qmlformat are e2e tests and in general QmlFormat lacks
unit test coverage, compensating it with e2e.
The biggest problem atm that some of those tests (namely testExample)
take too much time to execute because it runs QmlFormat over almost
all files in examples and tests directories.
Unfortunately atm our QA&QE infra can't provide tools for an easy
automated setup of potentially time-consuming tests.
As a workaround this commit:
1. "Moves" testExample and normalizeExample to the /manual tests
2. Preserves a very small fraction of testData for automated testing
"just in case"
Steps to repro:
1. configure with the flag `-make manual-tests`
2. `ninja e2e_qmlformat`
3. run ;)
Fixes: QTBUG-122990
Change-Id: Id41baee15e8826f4def5787f62790ed46f00e5dc
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'tests/auto/qml/qmlformat')
-rw-r--r-- | tests/auto/qml/qmlformat/tst_qmlformat.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/tests/auto/qml/qmlformat/tst_qmlformat.cpp b/tests/auto/qml/qmlformat/tst_qmlformat.cpp index 0bf19bbe9f..da3ebc69a2 100644 --- a/tests/auto/qml/qmlformat/tst_qmlformat.cpp +++ b/tests/auto/qml/qmlformat/tst_qmlformat.cpp @@ -509,9 +509,23 @@ void TestQmlformat::testExample_data() QString examples = QLatin1String(SRCDIR) + "/../../../../examples/"; QString tests = QLatin1String(SRCDIR) + "/../../../../tests/"; + QStringList exampleFiles; + QStringList testFiles; QStringList files; - files << findFiles(QDir(examples)); - files << findFiles(QDir(tests)); + exampleFiles << findFiles(QDir(examples)); + testFiles << findFiles(QDir(tests)); + + // Actually this test is an e2e test and not the unit test. + // At the moment of writing, CI lacks providing instruments for the automated tests + // which might be time-consuming, as for example this one. + // Therefore as part of QTBUG-122990 this test was copied to the /manual/e2e/qml/qmlformat + // however very small fraction of the test data is still preserved here for the sake of + // testing automatically at least a small part of the examples + const int nBatch = 10; + files << exampleFiles.mid(0, nBatch) << exampleFiles.mid(exampleFiles.size() / 2, nBatch) + << exampleFiles.mid(exampleFiles.size() - nBatch, nBatch); + files << testFiles.mid(0, nBatch) << testFiles.mid(exampleFiles.size() / 2, nBatch) + << testFiles.mid(exampleFiles.size() - nBatch, nBatch); for (const QString &file : files) QTest::newRow(qPrintable(file)) << file; |