BaselineProtocol: add FinalizeTesting command
Also adds a helper function QBaselineTest::finalizeAndDisconnect() that calls the finalize command, prints the optional report URL and disconnects to the server. Pick-to: 6.8 Change-Id: Iabdba77f9eebad3e3f3fa67ab8977d1e49c49fb4 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
This commit is contained in:
parent
69315d6627
commit
62b349c5cf
@ -384,6 +384,11 @@ bool BaselineProtocol::submitMismatch(const ImageItem &item, QByteArray *serverM
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool BaselineProtocol::finalizeTesting(QByteArray *serverMsg)
|
||||||
|
{
|
||||||
|
Command cmd;
|
||||||
|
return sendBlock(Command::FinalizeTesting, {}) && receiveBlock(&cmd, serverMsg) && cmd == Ack;
|
||||||
|
}
|
||||||
|
|
||||||
bool BaselineProtocol::sendItem(Command cmd, const ImageItem &item)
|
bool BaselineProtocol::sendItem(Command cmd, const ImageItem &item)
|
||||||
{
|
{
|
||||||
|
@ -105,6 +105,7 @@ public:
|
|||||||
AcceptMatch = 3,
|
AcceptMatch = 3,
|
||||||
AcceptNewBaseline = 4,
|
AcceptNewBaseline = 4,
|
||||||
AcceptMismatch = 5,
|
AcceptMismatch = 5,
|
||||||
|
FinalizeTesting = 6,
|
||||||
// Responses
|
// Responses
|
||||||
Ack = 128,
|
Ack = 128,
|
||||||
Abort = 129,
|
Abort = 129,
|
||||||
@ -122,6 +123,7 @@ public:
|
|||||||
bool submitMatch(const ImageItem &item, QByteArray *serverMsg);
|
bool submitMatch(const ImageItem &item, QByteArray *serverMsg);
|
||||||
bool submitNewBaseline(const ImageItem &item, QByteArray *serverMsg);
|
bool submitNewBaseline(const ImageItem &item, QByteArray *serverMsg);
|
||||||
bool submitMismatch(const ImageItem &item, QByteArray *serverMsg, bool *fuzzyMatch = nullptr);
|
bool submitMismatch(const ImageItem &item, QByteArray *serverMsg, bool *fuzzyMatch = nullptr);
|
||||||
|
bool finalizeTesting(QByteArray *serverMsg);
|
||||||
|
|
||||||
// For server:
|
// For server:
|
||||||
bool acceptConnection(PlatformInfo *pi);
|
bool acceptConnection(PlatformInfo *pi);
|
||||||
|
@ -228,6 +228,23 @@ bool connectToBaselineServer(QByteArray *msg)
|
|||||||
return connect(msg ? msg : &dummyMsg, &dummy);
|
return connect(msg ? msg : &dummyMsg, &dummy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool finalizeTesting(QByteArray *msg) {
|
||||||
|
QByteArray dummyMsg;
|
||||||
|
return proto.finalizeTesting(msg ? msg : &dummyMsg);
|
||||||
|
}
|
||||||
|
|
||||||
|
void finalizeAndDisconnect()
|
||||||
|
{
|
||||||
|
if (QByteArray msg; finalizeTesting(&msg)) {
|
||||||
|
if (msg.isEmpty())
|
||||||
|
qInfo() << "No baseline server report produced.";
|
||||||
|
else
|
||||||
|
qInfo() << "Baseline server report:" << msg.data();
|
||||||
|
}
|
||||||
|
|
||||||
|
disconnectFromBaselineServer();
|
||||||
|
}
|
||||||
|
|
||||||
void setAutoMode(bool mode)
|
void setAutoMode(bool mode)
|
||||||
{
|
{
|
||||||
customInfo.setAdHocRun(!mode);
|
customInfo.setAdHocRun(!mode);
|
||||||
|
@ -15,12 +15,14 @@ void setProject(const QString &projectName); // Selects server config settings a
|
|||||||
void setProjectImageKeys(const QStringList &keys); // Overrides the ItemPathKeys config setting
|
void setProjectImageKeys(const QStringList &keys); // Overrides the ItemPathKeys config setting
|
||||||
void addClientProperty(const QString& key, const QString& value);
|
void addClientProperty(const QString& key, const QString& value);
|
||||||
bool connectToBaselineServer(QByteArray *msg = nullptr);
|
bool connectToBaselineServer(QByteArray *msg = nullptr);
|
||||||
|
bool finalizeTesting(QByteArray *msg = nullptr);
|
||||||
bool checkImage(const QImage& img, const char *name, quint16 checksum, QByteArray *msg, bool *error, int manualdatatag = 0);
|
bool checkImage(const QImage& img, const char *name, quint16 checksum, QByteArray *msg, bool *error, int manualdatatag = 0);
|
||||||
bool testImage(const QImage& img, QByteArray *msg, bool *error);
|
bool testImage(const QImage& img, QByteArray *msg, bool *error);
|
||||||
QTestData &newRow(const char *dataTag, quint16 checksum = 0);
|
QTestData &newRow(const char *dataTag, quint16 checksum = 0);
|
||||||
bool isCurrentItemBlacklisted();
|
bool isCurrentItemBlacklisted();
|
||||||
bool disconnectFromBaselineServer();
|
bool disconnectFromBaselineServer();
|
||||||
bool shouldAbortIfUnstable();
|
bool shouldAbortIfUnstable();
|
||||||
|
void finalizeAndDisconnect();
|
||||||
}
|
}
|
||||||
|
|
||||||
#define QBASELINE_CHECK_SUM(image, name, checksum)\
|
#define QBASELINE_CHECK_SUM(image, name, checksum)\
|
||||||
|
Loading…
x
Reference in New Issue
Block a user