Merge lp:~sylvain-pineau/checkbox/fix-1406719 into lp:checkbox

Proposed by Sylvain Pineau
Status: Merged
Approved by: Sylvain Pineau
Approved revision: 3522
Merged at revision: 3526
Proposed branch: lp:~sylvain-pineau/checkbox/fix-1406719
Merge into: lp:checkbox
Diff against target: 43 lines (+9/-0)
2 files modified
checkbox-gui/gui-engine/gui-engine.cpp (+6/-0)
checkbox-gui/gui-engine/gui-engine.h (+3/-0)
To merge this branch: bzr merge lp:~sylvain-pineau/checkbox/fix-1406719
Reviewer Review Type Date Requested Status
Sylvain Pineau (community) Approve
Review via email: mp+245588@code.launchpad.net

Description of the change

Fixes the linked bug.

The current job index is incremented (+1) when the tested decides to force the previous test outcome.

To post a comment you must log in.
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

18:04 <@zyga> spineau: hey, I read the checkbox-gui fix, I have no idea how that works
18:04 <@zyga> spineau: it would help if you would describe how those flags are set
18:04 <@zyga> spineau: and how they operate
18:05 <@zyga> spineau: right now I feel we're playing whack-a-mole
18:05 <@zyga> spineau: and the moles never end

Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

I proposed (see https://bugs.launchpad.net/bugs/1362449) to use the current_job metadata that plainbox provides instead of guessing it with the broken NextRunJobIndex() call when resuming a session. But NextRunJobIndex() works for a normal start so the first boolean (m_resuming) just provides the context (are we resuming a session or not).

But resuming a session can be done in several ways, continue, rerun the last test or mark it as failed/passed.
The last option was not part of the initial fix hence the creation of m_resuming_force_result to store which option the tester selected. If the tester decided to force the previous test status, we basically increment the m_current_job_index to match the right job when resuming a session.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'checkbox-gui/gui-engine/gui-engine.cpp'
2--- checkbox-gui/gui-engine/gui-engine.cpp 2014-12-16 14:19:16 +0000
3+++ checkbox-gui/gui-engine/gui-engine.cpp 2015-01-05 16:40:40 +0000
4@@ -61,6 +61,7 @@
5 m_current_job_index(-1), // -1 ensures correct NextRunJobIndex from clean
6 m_running(true),
7 m_resuming(false),
8+ m_resuming_force_result(false),
9 m_waiting_result(false),
10 m_running_manual_job(false),
11 m_submitted(false),
12@@ -501,6 +502,10 @@
13 break;
14 }
15 }
16+ if (m_resuming_force_result) {
17+ m_current_job_index++;
18+ m_resuming_force_result = false;
19+ }
20 } else {
21 m_current_job_index = NextRunJobIndex(-1);
22 }
23@@ -643,6 +648,7 @@
24 SetJobOutcome(m_current_job_path, continue_pass ? JobResult_OUTCOME_PASS:JobResult_OUTCOME_FAIL, empty);
25 // Lets skip this one
26 m_rerun_list.removeOne(m_current_job_path);
27+ m_resuming_force_result = true;
28 }
29 qDebug() << "GuiEngine::GuiResumeSession() - Done";
30 }
31
32=== modified file 'checkbox-gui/gui-engine/gui-engine.h'
33--- checkbox-gui/gui-engine/gui-engine.h 2014-12-16 14:19:16 +0000
34+++ checkbox-gui/gui-engine/gui-engine.h 2015-01-05 16:40:40 +0000
35@@ -427,6 +427,9 @@
36 // Are we resuming a session?
37 bool m_resuming;
38
39+ // Are we resuming a session and forcing the previous test result?
40+ bool m_resuming_force_result;
41+
42 // Used to preserve interim data from Manual Interaction event
43 QDBusObjectPath m_runner;
44

Subscribers

People subscribed via source and target branches