• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mendersoftware / mender / 1998092492

22 Aug 2025 08:45AM UTC coverage: 75.933% (-0.01%) from 75.947%
1998092492

push

gitlab-ci

web-flow
Merge pull request #1815 from danielskinstad/aborted-deployments

 fix: add explicit check and handling for aborted deployments

9 of 10 new or added lines in 3 files covered. (90.0%)

2 existing lines in 1 file now uncovered.

7383 of 9723 relevant lines covered (75.93%)

13941.19 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/mender-update/daemon/state_events.hpp
1
// Copyright 2023 Northern.tech AS
2
//
3
//    Licensed under the Apache License, Version 2.0 (the "License");
4
//    you may not use this file except in compliance with the License.
5
//    You may obtain a copy of the License at
6
//
7
//        http://www.apache.org/licenses/LICENSE-2.0
8
//
9
//    Unless required by applicable law or agreed to in writing, software
10
//    distributed under the License is distributed on an "AS IS" BASIS,
11
//    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
//    See the License for the specific language governing permissions and
13
//    limitations under the License.
14

15
#ifndef MENDER_UPDATE_DAEMON_STATE_EVENTS_HPP
16
#define MENDER_UPDATE_DAEMON_STATE_EVENTS_HPP
17

18
namespace mender {
19
namespace update {
20
namespace daemon {
21

22
enum class StateEvent {
23
        Started,
24
        AlwaysSuccess,
25
        Success,
26
        Failure,
27
        NothingToDo,
28
        Retry,
29
        DeploymentAborted,
30
        InventoryPollingTriggered,
31
        DeploymentPollingTriggered,
32
        StateLoopDetected,
33
        DeploymentStarted,
34
        DeploymentEnded,
35
        RollbackStarted,
36
};
37

38
inline std::string StateEventToString(const StateEvent &event) {
×
39
        switch (event) {
×
40
        case StateEvent::Started:
41
                return "Started";
×
42
        case StateEvent::AlwaysSuccess:
43
                return "AlwaysSuccess";
×
44
        case StateEvent::Success:
45
                return "Success";
×
46
        case StateEvent::Failure:
47
                return "Failure";
×
48
        case StateEvent::NothingToDo:
49
                return "NothingToDo";
×
50
        case StateEvent::Retry:
51
                return "Retry";
×
52
        case StateEvent::DeploymentAborted:
NEW
53
                return "DeploymentAborted";
×
54
        case StateEvent::InventoryPollingTriggered:
55
                return "InventoryPollingTriggered";
×
56
        case StateEvent::DeploymentPollingTriggered:
57
                return "DeploymentPollingTriggered";
×
58
        case StateEvent::StateLoopDetected:
59
                return "StateLoopDetected";
×
60
        case StateEvent::DeploymentStarted:
61
                return "DeploymentStarted";
×
62
        case StateEvent::DeploymentEnded:
63
                return "DeploymentEnded";
×
64
        case StateEvent::RollbackStarted:
65
                return "RollbackStarted";
×
66
        }
67
        assert(false);
68
        return "MissingStateInSwitchStatement";
×
69
}
70

71
} // namespace daemon
72
} // namespace update
73
} // namespace mender
74

75
#endif // MENDER_UPDATE_DAEMON_STATE_EVENTS_HPP
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc