[sdk/kde-builder] /: fix: Debug order ranking by failed phase now works correctly
Andrew Shark <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit 72a50e58ddd1aef3961088e9c8a16b1d01824082 by Andrew Shark.
Committed on 01/08/2026 at 15:42.
Pushed by ashark into branch 'master'.
fix: Debug order ranking by failed phase now works correctly
The extra_debug_info["failCount"] key was unused.
The extra_debug_info["phases"] key was trying to recreate
the ctx.errors (which again was made incorrectly - the placed
keys for that dict were of Module type, but expected to be
of str type).
But instead of using ctx.errors, we will mark failed
phase in Module itself and access that in DebugOrderHints.
M +1 -13 kde_builder_lib/application.py
M +1 -0 kde_builder_lib/build_context.py
M +4 -6 kde_builder_lib/debug_order_hints.py
M +2 -0 kde_builder_lib/module/module.py
M +83 -97 tests/unit/debug-hints/test_compare-debug-order.py
https://invent.kde.org/sdk/kde-builder/-/commit/72a50e58ddd1aef3961088e9c8a16b1d01824082
diff --git a/kde_builder_lib/application.py b/kde_builder_lib/application.py
index 71edc6da..2a9900c7 100644
--- a/kde_builder_lib/application.py
+++ b/kde_builder_lib/application.py
@@ -589,8 +589,6 @@ class Application:
if ctx.get_option("purge-old-logs"):
LogDir.delete_unreferenced_log_directories(ctx)
- ctx = self.context
-
self._print_failed_modules_in_each_phase(ctx)
# Record all failed modules. Unlike the "resume-list" option this doesn't
@@ -998,10 +996,6 @@ class Application:
ctx: Build context
"""
module_graph = self.dependency_resolver.dependency_graph
- extra_debug_info = {
- "phases": {},
- "failCount": {}
- }
actual_failures: list[Module] = []
# This list should correspond to the possible phase names (although
@@ -1009,12 +1003,6 @@ class Application:
for phase in ctx.phases.phaselist:
failures: list[Module] = ctx.failed_modules_in_phase(phase)
for failure in failures:
- # we already tagged the failure before, should not happen but
- # make sure to check to avoid spurious duplicate output
- if extra_debug_info["phases"].get(failure, None):
- continue
-
- extra_debug_info["phases"][failure] = phase
actual_failures.append(failure)
if not failures:
@@ -1055,7 +1043,7 @@ class Application:
# this feature is meant for 5 out of 65
if num_suggested_modules > top:
- sorted_for_debug = DebugOrderHints(module_graph, extra_debug_info).sort_failures_in_debug_order(actual_failures)
+ sorted_for_debug = DebugOrderHints(module_graph).sort_failures_in_debug_order(actual_failures)
logger_app.info(f"\nThe following top {top} may be the most important to fix to " +
"get the build to work, listed in order of 'probably most " +
diff --git a/kde_builder_lib/build_context.py b/kde_builder_lib/build_context.py
index fbbc9502..3f3908d4 100644
--- a/kde_builder_lib/build_context.py
+++ b/kde_builder_lib/build_context.py
@@ -546,6 +546,7 @@ class BuildContext(PathResolvingOptions):
def mark_module_phase_failed(self, phase: str, module: Module) -> None:
self.errors[module.name] = phase
+ module.failed_phase = phase
def failed_modules_in_phase(self, phase: str) -> list[Module]:
"""
diff --git a/kde_builder_lib/debug_order_hints.py b/kde_builder_lib/debug_order_hints.py
index 2052954a..d713e5bf 100644
--- a/kde_builder_lib/debug_order_hints.py
+++ b/kde_builder_lib/debug_order_hints.py
@@ -25,9 +25,8 @@ class DebugOrderHints:
missing dependency).
"""
- def __init__(self, module_graph: dict, extra_debug_info: dict):
+ def __init__(self, module_graph: dict):
self.module_graph = module_graph
- self.extra_debug_info = extra_debug_info
@staticmethod
def _get_phase_score(phase: str) -> int:
@@ -56,9 +55,8 @@ class DebugOrderHints:
return 1
return 0
- def _compare_debug_order(self, a, b):
+ def _compare_debug_order(self, a: Module, b: Module):
module_graph = self.module_graph
- extra_debug_info = self.extra_debug_info
# comparison results uses:
# -1 if a < b
@@ -124,8 +122,8 @@ class DebugOrderHints:
# Try and see if there is something "interesting" that might e.g. indicate
# issues with the system itself, preventing a successful build.
- phase_a = DebugOrderHints._get_phase_score(extra_debug_info["phases"].get(name_a, ""))
- phase_b = DebugOrderHints._get_phase_score(extra_debug_info["phases"].get(name_b, ""))
+ phase_a = DebugOrderHints._get_phase_score(a.failed_phase or "")
+ phase_b = DebugOrderHints._get_phase_score(b.failed_phase or "")
phase = (phase_b > phase_a) - (phase_b < phase_a)
if phase:
diff --git a/kde_builder_lib/module/module.py b/kde_builder_lib/module/module.py
index 2fb875f1..97d9e300 100644
--- a/kde_builder_lib/module/module.py
+++ b/kde_builder_lib/module/module.py
@@ -88,6 +88,8 @@ class Module(PathResolvingOptions):
self.current_phase: str | None = None
"""For customizing behavior depending on the phase."""
+ self.failed_phase = ""
+
# Record current values of what would be last source/build dir, if present,
# before they are potentially reset during the module build.
self.set_option("#last-source-dir", self.get_persistent_option("source-dir") or "")
diff --git a/tests/unit/debug-hints/test_compare-debug-order.py b/tests/unit/debug-hints/test_compare-debug-order.py
index 61d6784d..8799ee40 100644
--- a/tests/unit/debug-hints/test_compare-debug-order.py
+++ b/tests/unit/debug-hints/test_compare-debug-order.py
@@ -11,9 +11,10 @@ from kde_builder_lib.module.module import Module
@pytest.fixture
def mock_module(monkeypatch):
- def mock__init__(self, name, count):
+ def mock__init__(self, name, count, failed_phase):
self.count = count
self.name = name
+ self.failed_phase = failed_phase
# Redefine `Module` to stub get_persistent_option() results
def mock_get_persistent_option(self, option):
@@ -28,11 +29,11 @@ def test_debug_order(mock_module):
"""
Test comparison operation for sorting modules into debug order.
"""
- a1 = Module("A:i-d2-v0-c0", 0)
- b1 = Module("B:i-d1-v1-c0", 0)
- c1 = Module("C:i-d0-v0-c0", 0)
- d1 = Module("D:i-d0-v0-c1", 1)
- e1 = Module("E:i-d0-v1-c0", 0)
+ a1 = Module("A:i-d2-v0-c0", 0, failed_phase="install")
+ b1 = Module("B:i-d1-v1-c0", 0, failed_phase="install")
+ c1 = Module("C:i-d0-v0-c0", 0, failed_phase="install")
+ d1 = Module("D:i-d0-v0-c1", 1, failed_phase="install")
+ e1 = Module("E:i-d0-v1-c0", 0, failed_phase="install")
# test: ordering of modules that fail in the same phase based on dependency info
graph1 = {
@@ -71,52 +72,45 @@ def test_debug_order(mock_module):
}
extra_debug_info1 = {
- "phases": {
- a1.name: "install",
- b1.name: "install",
- c1.name: "install",
- d1.name: "install",
- e1.name: "install"
- }
}
- assert DebugOrderHints(graph1, extra_debug_info1)._compare_debug_order(c1, c1) == 0, "Comparing the same modules should always yield the same relative position"
- assert DebugOrderHints(graph1, extra_debug_info1)._compare_debug_order(c1, d1) == -1, "No dependency relation ship, root causes, same popularity: the \"newest\" failure (lower count) should be sorted first"
- assert DebugOrderHints(graph1, extra_debug_info1)._compare_debug_order(c1, e1) == 1, "No dependency relation ship, root causes: the higher popularity should be sorted first"
- assert DebugOrderHints(graph1, extra_debug_info1)._compare_debug_order(c1, b1) == -1, "No dependency relation ship: the root cause should be sorted first"
- assert DebugOrderHints(graph1, extra_debug_info1)._compare_debug_order(c1, a1) == -1, "No dependency relation ship: the root cause should be sorted first"
-
- assert DebugOrderHints(graph1, extra_debug_info1)._compare_debug_order(d1, c1) == 1, "No dependency relation ship, root causes, same popularity: the \"newest\" failure (lower count) should be sorted first"
- assert DebugOrderHints(graph1, extra_debug_info1)._compare_debug_order(d1, d1) == 0, "Comparing the same modules should always yield the same relative position"
- assert DebugOrderHints(graph1, extra_debug_info1)._compare_debug_order(d1, e1) == 1, "No dependency relation ship, root causes: the higher popularity should be sorted first"
- assert DebugOrderHints(graph1, extra_debug_info1)._compare_debug_order(d1, b1) == -1, "No dependency relation ship: the root cause should be sorted first"
- assert DebugOrderHints(graph1, extra_debug_info1)._compare_debug_order(d1, a1) == -1, "No dependency relation ship: the root cause should be sorted first"
-
- assert DebugOrderHints(graph1, extra_debug_info1)._compare_debug_order(e1, c1) == -1, "No dependency relation ship, root causes: the higher popularity should be sorted first"
- assert DebugOrderHints(graph1, extra_debug_info1)._compare_debug_order(e1, d1) == -1, "No dependency relation ship, root causes: the higher popularity should be sorted first"
- assert DebugOrderHints(graph1, extra_debug_info1)._compare_debug_order(e1, e1) == 0, "Comparing the same modules should always yield the same relative position"
- assert DebugOrderHints(graph1, extra_debug_info1)._compare_debug_order(e1, b1) == -1, "No dependency relation ship: the root cause should be sorted first"
- assert DebugOrderHints(graph1, extra_debug_info1)._compare_debug_order(e1, a1) == -1, "Dependencies should be sorted before dependent modules"
-
- assert DebugOrderHints(graph1, extra_debug_info1)._compare_debug_order(b1, c1) == 1, "No dependency relation ship: the root cause should be sorted first"
- assert DebugOrderHints(graph1, extra_debug_info1)._compare_debug_order(b1, d1) == 1, "No dependency relation ship: the root cause should be sorted first"
- assert DebugOrderHints(graph1, extra_debug_info1)._compare_debug_order(b1, e1) == 1, "No dependency relation ship: the root cause should be sorted first"
- assert DebugOrderHints(graph1, extra_debug_info1)._compare_debug_order(b1, b1) == 0, "Comparing the same modules should always yield the same relative position"
- assert DebugOrderHints(graph1, extra_debug_info1)._compare_debug_order(b1, a1) == -1, "Dependencies should be sorted before dependent modules"
-
- assert DebugOrderHints(graph1, extra_debug_info1)._compare_debug_order(a1, c1) == 1, "No dependency relation ship: the root cause should be sorted first"
- assert DebugOrderHints(graph1, extra_debug_info1)._compare_debug_order(a1, d1) == 1, "No dependency relation ship: the root cause should be sorted first"
- assert DebugOrderHints(graph1, extra_debug_info1)._compare_debug_order(a1, e1) == 1, "Dependencies should be sorted before dependent modules"
- assert DebugOrderHints(graph1, extra_debug_info1)._compare_debug_order(a1, b1) == 1, "Dependencies should be sorted before dependent modules"
- assert DebugOrderHints(graph1, extra_debug_info1)._compare_debug_order(a1, a1) == 0, "Comparing the same modules should always yield the same relative position"
+ assert DebugOrderHints(graph1)._compare_debug_order(c1, c1) == 0, "Comparing the same modules should always yield the same relative position"
+ assert DebugOrderHints(graph1)._compare_debug_order(c1, d1) == -1, "No dependency relation ship, root causes, same popularity: the \"newest\" failure (lower count) should be sorted first"
+ assert DebugOrderHints(graph1)._compare_debug_order(c1, e1) == 1, "No dependency relation ship, root causes: the higher popularity should be sorted first"
+ assert DebugOrderHints(graph1)._compare_debug_order(c1, b1) == -1, "No dependency relation ship: the root cause should be sorted first"
+ assert DebugOrderHints(graph1)._compare_debug_order(c1, a1) == -1, "No dependency relation ship: the root cause should be sorted first"
+
+ assert DebugOrderHints(graph1)._compare_debug_order(d1, c1) == 1, "No dependency relation ship, root causes, same popularity: the \"newest\" failure (lower count) should be sorted first"
+ assert DebugOrderHints(graph1)._compare_debug_order(d1, d1) == 0, "Comparing the same modules should always yield the same relative position"
+ assert DebugOrderHints(graph1)._compare_debug_order(d1, e1) == 1, "No dependency relation ship, root causes: the higher popularity should be sorted first"
+ assert DebugOrderHints(graph1)._compare_debug_order(d1, b1) == -1, "No dependency relation ship: the root cause should be sorted first"
+ assert DebugOrderHints(graph1)._compare_debug_order(d1, a1) == -1, "No dependency relation ship: the root cause should be sorted first"
+
+ assert DebugOrderHints(graph1)._compare_debug_order(e1, c1) == -1, "No dependency relation ship, root causes: the higher popularity should be sorted first"
+ assert DebugOrderHints(graph1)._compare_debug_order(e1, d1) == -1, "No dependency relation ship, root causes: the higher popularity should be sorted first"
+ assert DebugOrderHints(graph1)._compare_debug_order(e1, e1) == 0, "Comparing the same modules should always yield the same relative position"
+ assert DebugOrderHints(graph1)._compare_debug_order(e1, b1) == -1, "No dependency relation ship: the root cause should be sorted first"
+ assert DebugOrderHints(graph1)._compare_debug_order(e1, a1) == -1, "Dependencies should be sorted before dependent modules"
+
+ assert DebugOrderHints(graph1)._compare_debug_order(b1, c1) == 1, "No dependency relation ship: the root cause should be sorted first"
+ assert DebugOrderHints(graph1)._compare_debug_order(b1, d1) == 1, "No dependency relation ship: the root cause should be sorted first"
+ assert DebugOrderHints(graph1)._compare_debug_order(b1, e1) == 1, "No dependency relation ship: the root cause should be sorted first"
+ assert DebugOrderHints(graph1)._compare_debug_order(b1, b1) == 0, "Comparing the same modules should always yield the same relative position"
+ assert DebugOrderHints(graph1)._compare_debug_order(b1, a1) == -1, "Dependencies should be sorted before dependent modules"
+
+ assert DebugOrderHints(graph1)._compare_debug_order(a1, c1) == 1, "No dependency relation ship: the root cause should be sorted first"
+ assert DebugOrderHints(graph1)._compare_debug_order(a1, d1) == 1, "No dependency relation ship: the root cause should be sorted first"
+ assert DebugOrderHints(graph1)._compare_debug_order(a1, e1) == 1, "Dependencies should be sorted before dependent modules"
+ assert DebugOrderHints(graph1)._compare_debug_order(a1, b1) == 1, "Dependencies should be sorted before dependent modules"
+ assert DebugOrderHints(graph1)._compare_debug_order(a1, a1) == 0, "Comparing the same modules should always yield the same relative position"
# test: ordering of modules that fail in different phases
- p_b1 = Module("build1", 0)
- p_b2 = Module("build2", 0)
- p_i = Module("install", 0)
- p_t = Module("test", 0)
- p_u = Module("update", 0)
- p_x = Module("unknown", 0)
+ p_b1 = Module("build1", 0, failed_phase="build")
+ p_b2 = Module("build2", 0, failed_phase="build")
+ p_i = Module("install", 0, failed_phase="install")
+ p_t = Module("test", 0, failed_phase="test")
+ p_u = Module("update", 0, failed_phase="update")
+ p_x = Module("unknown", 0, failed_phase="unknown")
graph2 = {
p_b1.name: {
@@ -152,54 +146,46 @@ def test_debug_order(mock_module):
}
extra_debug_info2 = {
- "phases": {
- p_b1.name: "build",
- p_b2.name: "build",
- p_i.name: "install",
- p_t.name: "test",
- p_u.name: "update",
- p_x.name: "unknown"
- }
}
- assert DebugOrderHints(graph2, extra_debug_info2)._compare_debug_order(p_b1, p_b1) == 0, "Comparing the same modules should always yield the same relative position"
- assert DebugOrderHints(graph2, extra_debug_info2)._compare_debug_order(p_b1, p_b2) == -1, "Same phase: sort by name for reproducibility"
- assert DebugOrderHints(graph2, extra_debug_info2)._compare_debug_order(p_b1, p_i) == 1, "Phase ordering: \"build\" should be sorted after \"install\""
- assert DebugOrderHints(graph2, extra_debug_info2)._compare_debug_order(p_b1, p_t) == 1, "Phase ordering: \"build\" should be sorted after \"test\""
- assert DebugOrderHints(graph2, extra_debug_info2)._compare_debug_order(p_b1, p_u) == -1, "Phase ordering: \"build\" should be sorted before \"update\""
- assert DebugOrderHints(graph2, extra_debug_info2)._compare_debug_order(p_b1, p_x) == -1, "Phase ordering: \"build\" should be sorted before unsupported phases"
-
- assert DebugOrderHints(graph2, extra_debug_info2)._compare_debug_order(p_b2, p_b1) == 1, "Same phase: sort by name for reproducibility"
- assert DebugOrderHints(graph2, extra_debug_info2)._compare_debug_order(p_b2, p_b2) == 0, "Comparing the same modules should always yield the same relative position"
- assert DebugOrderHints(graph2, extra_debug_info2)._compare_debug_order(p_b2, p_i) == 1, "Phase ordering: \"build\" should be sorted after \"install\""
- assert DebugOrderHints(graph2, extra_debug_info2)._compare_debug_order(p_b2, p_t) == 1, "Phase ordering: \"build\" should be sorted after \"test\""
- assert DebugOrderHints(graph2, extra_debug_info2)._compare_debug_order(p_b2, p_u) == -1, "Phase ordering: \"build\" should be sorted before \"update\""
- assert DebugOrderHints(graph2, extra_debug_info2)._compare_debug_order(p_b2, p_x) == -1, "Phase ordering: \"build\" should be sorted before unsupported phases"
-
- assert DebugOrderHints(graph2, extra_debug_info2)._compare_debug_order(p_i, p_b1) == -1, "Phase ordering: \"install\" should be sorted before \"build\""
- assert DebugOrderHints(graph2, extra_debug_info2)._compare_debug_order(p_i, p_b2) == -1, "Phase ordering: \"install\" should be sorted before \"build\""
- assert DebugOrderHints(graph2, extra_debug_info2)._compare_debug_order(p_i, p_i) == 0, "Comparing the same modules should always yield the same relative position"
- assert DebugOrderHints(graph2, extra_debug_info2)._compare_debug_order(p_i, p_t) == -1, "Phase ordering: \"install\" should be sorted before \"test\""
- assert DebugOrderHints(graph2, extra_debug_info2)._compare_debug_order(p_i, p_u) == -1, "Phase ordering: \"install\" should be sorted before \"update\""
- assert DebugOrderHints(graph2, extra_debug_info2)._compare_debug_order(p_i, p_x) == -1, "Phase ordering: \"install\" should be sorted before unsupported phases"
-
- assert DebugOrderHints(graph2, extra_debug_info2)._compare_debug_order(p_t, p_b1) == -1, "Phase ordering: \"test\" should be sorted before \"build\""
- assert DebugOrderHints(graph2, extra_debug_info2)._compare_debug_order(p_t, p_b2) == -1, "Phase ordering: \"test\" should be sorted before \"build\""
- assert DebugOrderHints(graph2, extra_debug_info2)._compare_debug_order(p_t, p_i) == 1, "Phase ordering: \"test\" should be sorted after \"install\""
- assert DebugOrderHints(graph2, extra_debug_info2)._compare_debug_order(p_t, p_t) == 0, "Comparing the same modules should always yield the same relative position"
- assert DebugOrderHints(graph2, extra_debug_info2)._compare_debug_order(p_t, p_u) == -1, "Phase ordering: \"test\" should be sorted before \"update\""
- assert DebugOrderHints(graph2, extra_debug_info2)._compare_debug_order(p_t, p_x) == -1, "Phase ordering: \"test\" should be sorted before unsupported phases"
-
- assert DebugOrderHints(graph2, extra_debug_info2)._compare_debug_order(p_u, p_b1) == 1, "Phase ordering: \"update\" should be sorted after \"build\""
- assert DebugOrderHints(graph2, extra_debug_info2)._compare_debug_order(p_u, p_b2) == 1, "Phase ordering: \"update\" should be sorted after \"build\""
- assert DebugOrderHints(graph2, extra_debug_info2)._compare_debug_order(p_u, p_i) == 1, "Phase ordering: \"update\" should be sorted after \"install\""
- assert DebugOrderHints(graph2, extra_debug_info2)._compare_debug_order(p_u, p_t) == 1, "Phase ordering: \"update\" should be sorted after \"test\""
- assert DebugOrderHints(graph2, extra_debug_info2)._compare_debug_order(p_u, p_u) == 0, "Comparing the same modules should always yield the same relative position"
- assert DebugOrderHints(graph2, extra_debug_info2)._compare_debug_order(p_u, p_x) == -1, "Phase ordering: \"update\" should be sorted before unsupported phases"
-
- assert DebugOrderHints(graph2, extra_debug_info2)._compare_debug_order(p_x, p_b1) == 1, "Phase ordering: unknown phases should be sorted after \"build\""
- assert DebugOrderHints(graph2, extra_debug_info2)._compare_debug_order(p_x, p_b2) == 1, "Phase ordering: unknown phases should be sorted after \"build\""
- assert DebugOrderHints(graph2, extra_debug_info2)._compare_debug_order(p_x, p_i) == 1, "Phase ordering: unknown phases should be sorted after \"install\""
- assert DebugOrderHints(graph2, extra_debug_info2)._compare_debug_order(p_x, p_t) == 1, "Phase ordering: unknown phases should be sorted after \"test\""
- assert DebugOrderHints(graph2, extra_debug_info2)._compare_debug_order(p_x, p_u) == 1, "Phase ordering: unknown phases should be sorted after \"update\""
- assert DebugOrderHints(graph2, extra_debug_info2)._compare_debug_order(p_x, p_x) == 0, "Comparing the same modules should always yield the same relative position"
+ assert DebugOrderHints(graph2)._compare_debug_order(p_b1, p_b1) == 0, "Comparing the same modules should always yield the same relative position"
+ assert DebugOrderHints(graph2)._compare_debug_order(p_b1, p_b2) == -1, "Same phase: sort by name for reproducibility"
+ assert DebugOrderHints(graph2)._compare_debug_order(p_b1, p_i) == 1, "Phase ordering: \"build\" should be sorted after \"install\""
+ assert DebugOrderHints(graph2)._compare_debug_order(p_b1, p_t) == 1, "Phase ordering: \"build\" should be sorted after \"test\""
+ assert DebugOrderHints(graph2)._compare_debug_order(p_b1, p_u) == -1, "Phase ordering: \"build\" should be sorted before \"update\""
+ assert DebugOrderHints(graph2)._compare_debug_order(p_b1, p_x) == -1, "Phase ordering: \"build\" should be sorted before unsupported phases"
+
+ assert DebugOrderHints(graph2)._compare_debug_order(p_b2, p_b1) == 1, "Same phase: sort by name for reproducibility"
+ assert DebugOrderHints(graph2)._compare_debug_order(p_b2, p_b2) == 0, "Comparing the same modules should always yield the same relative position"
+ assert DebugOrderHints(graph2)._compare_debug_order(p_b2, p_i) == 1, "Phase ordering: \"build\" should be sorted after \"install\""
+ assert DebugOrderHints(graph2)._compare_debug_order(p_b2, p_t) == 1, "Phase ordering: \"build\" should be sorted after \"test\""
+ assert DebugOrderHints(graph2)._compare_debug_order(p_b2, p_u) == -1, "Phase ordering: \"build\" should be sorted before \"update\""
+ assert DebugOrderHints(graph2)._compare_debug_order(p_b2, p_x) == -1, "Phase ordering: \"build\" should be sorted before unsupported phases"
+
+ assert DebugOrderHints(graph2)._compare_debug_order(p_i, p_b1) == -1, "Phase ordering: \"install\" should be sorted before \"build\""
+ assert DebugOrderHints(graph2)._compare_debug_order(p_i, p_b2) == -1, "Phase ordering: \"install\" should be sorted before \"build\""
+ assert DebugOrderHints(graph2)._compare_debug_order(p_i, p_i) == 0, "Comparing the same modules should always yield the same relative position"
+ assert DebugOrderHints(graph2)._compare_debug_order(p_i, p_t) == -1, "Phase ordering: \"install\" should be sorted before \"test\""
+ assert DebugOrderHints(graph2)._compare_debug_order(p_i, p_u) == -1, "Phase ordering: \"install\" should be sorted before \"update\""
+ assert DebugOrderHints(graph2)._compare_debug_order(p_i, p_x) == -1, "Phase ordering: \"install\" should be sorted before unsupported phases"
+
+ assert DebugOrderHints(graph2)._compare_debug_order(p_t, p_b1) == -1, "Phase ordering: \"test\" should be sorted before \"build\""
+ assert DebugOrderHints(graph2)._compare_debug_order(p_t, p_b2) == -1, "Phase ordering: \"test\" should be sorted before \"build\""
+ assert DebugOrderHints(graph2)._compare_debug_order(p_t, p_i) == 1, "Phase ordering: \"test\" should be sorted after \"install\""
+ assert DebugOrderHints(graph2)._compare_debug_order(p_t, p_t) == 0, "Comparing the same modules should always yield the same relative position"
+ assert DebugOrderHints(graph2)._compare_debug_order(p_t, p_u) == -1, "Phase ordering: \"test\" should be sorted before \"update\""
+ assert DebugOrderHints(graph2)._compare_debug_order(p_t, p_x) == -1, "Phase ordering: \"test\" should be sorted before unsupported phases"
+
+ assert DebugOrderHints(graph2)._compare_debug_order(p_u, p_b1) == 1, "Phase ordering: \"update\" should be sorted after \"build\""
+ assert DebugOrderHints(graph2)._compare_debug_order(p_u, p_b2) == 1, "Phase ordering: \"update\" should be sorted after \"build\""
+ assert DebugOrderHints(graph2)._compare_debug_order(p_u, p_i) == 1, "Phase ordering: \"update\" should be sorted after \"install\""
+ assert DebugOrderHints(graph2)._compare_debug_order(p_u, p_t) == 1, "Phase ordering: \"update\" should be sorted after \"test\""
+ assert DebugOrderHints(graph2)._compare_debug_order(p_u, p_u) == 0, "Comparing the same modules should always yield the same relative position"
+ assert DebugOrderHints(graph2)._compare_debug_order(p_u, p_x) == -1, "Phase ordering: \"update\" should be sorted before unsupported phases"
+
+ assert DebugOrderHints(graph2)._compare_debug_order(p_x, p_b1) == 1, "Phase ordering: unknown phases should be sorted after \"build\""
+ assert DebugOrderHints(graph2)._compare_debug_order(p_x, p_b2) == 1, "Phase ordering: unknown phases should be sorted after \"build\""
+ assert DebugOrderHints(graph2)._compare_debug_order(p_x, p_i) == 1, "Phase ordering: unknown phases should be sorted after \"install\""
+ assert DebugOrderHints(graph2)._compare_debug_order(p_x, p_t) == 1, "Phase ordering: unknown phases should be sorted after \"test\""
+ assert DebugOrderHints(graph2)._compare_debug_order(p_x, p_u) == 1, "Phase ordering: unknown phases should be sorted after \"update\""
+ assert DebugOrderHints(graph2)._compare_debug_order(p_x, p_x) == 0, "Comparing the same modules should always yield the same relative position"