Merge lp:~tiagosh/checkbox/fix-auto-test-status into lp:checkbox

Proposed by Tiago Salem Herrmann
Status: Merged
Merged at revision: 1315
Proposed branch: lp:~tiagosh/checkbox/fix-auto-test-status
Merge into: lp:checkbox
Prerequisite: lp:~roadmr/checkbox/update-status
Diff against target: 154 lines (+39/-20)
3 files modified
checkbox_qt/qt_interface.py (+4/-0)
qt/frontend/qtfront.cpp (+34/-20)
qt/frontend/qtfront.h (+1/-0)
To merge this branch: bzr merge lp:~tiagosh/checkbox/fix-auto-test-status
Reviewer Review Type Date Requested Status
Daniel Manrique (community) Approve
Review via email: mp+96626@code.launchpad.net

Description of the change

update the status box also for automatic tests executed by the backend.

To post a comment you must log in.
Revision history for this message
Daniel Manrique (roadmr) wrote :

I tested it and it works as advertised. Thanks!

(btw, I just added the changelog entry prior to merging to trunk).

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'checkbox_qt/qt_interface.py'
2--- checkbox_qt/qt_interface.py 2012-02-29 18:49:58 +0000
3+++ checkbox_qt/qt_interface.py 2012-03-08 17:28:47 +0000
4@@ -218,6 +218,10 @@
5 def show_error(self, text):
6 self.qtiface.showError(text)
7
8+ def update_status(self, job):
9+ if 'type' in job and job["type"] == "test":
10+ self.qtiface.updateAutoTestStatus(job["status"], job["name"])
11+
12 def wait_on_signals(self, **signals):
13 for name, function in signals.iteritems():
14 self.bus.add_signal_receiver(function, name)
15
16=== modified file 'qt/frontend/qtfront.cpp'
17--- qt/frontend/qtfront.cpp 2012-03-02 15:20:29 +0000
18+++ qt/frontend/qtfront.cpp 2012-03-08 17:28:47 +0000
19@@ -16,6 +16,14 @@
20 Q_DECLARE_METATYPE(myQMap)
21 Q_DECLARE_METATYPE(QVariantMap)
22
23+#define STATUS_UNINITIATED "uninitiated"
24+#define STATUS_FAIL "fail"
25+#define STATUS_PASS "pass"
26+#define STATUS_UNSUPPORTED "unsupported"
27+#define STATUS_UNRESOLVED "unresolved"
28+#define STATUS_UNTESTED "untested"
29+#define STATUS_INPROGRESS "inprogress"
30+
31 class CustomQTabWidget : QTabWidget
32 {
33 public:
34@@ -84,13 +92,13 @@
35 m_titleTestTypes["__suspend__"] = "Suspend Test";
36 m_titleTestTypes["__usb__"] = "USB Test";
37
38- m_statusStrings["uninitiated"] = tr("Not Started");
39- m_statusStrings["pass"] = tr("Done");
40- m_statusStrings["fail"] = tr("Done");
41- m_statusStrings["unsupported"] = tr("Not Supported");
42- m_statusStrings["unresolved"] = tr("Not Resolved");
43- m_statusStrings["untested"] = tr("Not Tested");
44- m_statusStrings["inprogress"] = tr("In Progress");
45+ m_statusStrings[STATUS_UNINITIATED] = tr("Not Started");
46+ m_statusStrings[STATUS_PASS] = tr("Done");
47+ m_statusStrings[STATUS_FAIL] = tr("Done");
48+ m_statusStrings[STATUS_UNSUPPORTED] = tr("Not Supported");
49+ m_statusStrings[STATUS_UNRESOLVED] = tr("Not Resolved");
50+ m_statusStrings[STATUS_UNTESTED] = tr("Not Tested");
51+ m_statusStrings[STATUS_INPROGRESS] = tr("In Progress");
52
53 }
54
55@@ -115,18 +123,17 @@
56
57 void QtFront::onYesTestClicked() {
58 emit yesTestClicked();
59- updateTestStatus(m_statusStrings["pass"]);
60-
61+ updateTestStatus(STATUS_PASS);
62 }
63
64 void QtFront::onNoTestClicked() {
65 emit noTestClicked();
66- updateTestStatus(m_statusStrings["fail"]);
67+ updateTestStatus(STATUS_FAIL);
68 }
69
70 void QtFront::onPreviousTestClicked() {
71 emit previousTestClicked();
72- updateTestStatus(m_statusStrings["uninitiated"]);
73+ updateTestStatus(STATUS_UNINITIATED);
74 }
75
76 void QtFront::setInitialState()
77@@ -161,7 +168,7 @@
78 } else {
79 emit nextTestClicked();
80 }
81- updateTestStatus(m_statusStrings["untested"]);
82+ updateTestStatus(STATUS_UNTESTED);
83 }
84
85 void QtFront::onTabChanged(int index)
86@@ -273,7 +280,7 @@
87 {
88 currentState = TESTING;
89 m_currentTestName = testName;
90- updateTestStatus(m_statusStrings["inprogress"]);
91+ updateTestStatus(STATUS_INPROGRESS);
92 ui->radioTestTab->setVisible(true);
93 ui->nextPrevButtons->setVisible(true);
94 ui->testTestButton->setEnabled(enableTestButton);
95@@ -338,26 +345,26 @@
96 updateTestStatus(childItem, status);
97 }
98 if (childItem->data(Qt::UserRole).toString() == m_currentTestName && !status.isEmpty()) {
99- childItem->setText(status);
100+ childItem->setText(m_statusStrings[status]);
101 }
102- if (childItem->text() == m_statusStrings["pass"]) {
103+ if (childItem->text() == m_statusStrings[STATUS_PASS]) {
104 childItem->setData(QVariant(Qt::Checked), Qt::CheckStateRole);
105 done++;
106- } else if (childItem->text() == m_statusStrings["inprogress"]) {
107+ } else if (childItem->text() == m_statusStrings[STATUS_INPROGRESS]) {
108 childItem->setData(QVariant(Qt::Unchecked), Qt::CheckStateRole);
109 inprogress++;
110- } else if (childItem->text() == m_statusStrings["uninitiated"]) {
111+ } else if (childItem->text() == m_statusStrings[STATUS_UNINITIATED]) {
112 childItem->setData(QVariant(Qt::Unchecked), Qt::CheckStateRole);
113 }
114 }
115 if (done == item->rowCount() && done != 0) {
116- item->setText(m_statusStrings["pass"]);
117+ item->setText(m_statusStrings[STATUS_PASS]);
118 item->setData(QVariant(Qt::Checked), Qt::CheckStateRole);
119 } else if (inprogress != 0 || done != 0) {
120- item->setText(m_statusStrings["inprogress"]);
121+ item->setText(m_statusStrings[STATUS_INPROGRESS]);
122 item->setData(QVariant(Qt::PartiallyChecked), Qt::CheckStateRole);
123 } else {
124- item->setText(m_statusStrings["uninitiated"]);
125+ item->setText(m_statusStrings[STATUS_UNINITIATED]);
126 item->setData(QVariant(Qt::Unchecked), Qt::CheckStateRole);
127 }
128 }
129@@ -368,6 +375,13 @@
130 }
131 }
132
133+void QtFront::updateAutoTestStatus(QString status, QString currentTest) {
134+ if (!currentTest.isEmpty()) {
135+ m_currentTestName = currentTest;
136+ }
137+ updateTestStatus(status);
138+}
139+
140 void QtFront::buildTree(QVariantMap options, QString baseIndex, QStandardItem *parentItem, QStandardItem *parentStatusItem)
141 {
142 int internalIndex = 1;
143
144=== modified file 'qt/frontend/qtfront.h'
145--- qt/frontend/qtfront.h 2012-03-02 15:20:29 +0000
146+++ qt/frontend/qtfront.h 2012-03-08 17:28:47 +0000
147@@ -51,6 +51,7 @@
148 QString getEmailAddress();
149 void showTest(QString purpose, QString steps, QString verification, QString info, QString testType, QString testName, bool enableTestButton);
150 QString showInfo(QString text, QStringList options, QString defaultoption);
151+ void updateAutoTestStatus(QString status, QString testName);
152
153 private slots:
154 void onFullTestsClicked();

Subscribers

People subscribed via source and target branches