def test_schedule_load_simple(self, testdir): node1 = MockNode() node2 = MockNode() config = testdir.parseconfig("--tx=2*popen") sched = EachScheduling(config) sched.add_node(node1) sched.add_node(node2) collection = [ "a.py::test_1", ] assert not sched.collection_is_completed sched.add_node_collection(node1, collection) assert not sched.collection_is_completed sched.add_node_collection(node2, collection) assert sched.collection_is_completed assert sched.node2collection[node1] == collection assert sched.node2collection[node2] == collection sched.schedule() assert sched.tests_finished assert node1.sent == ['ALL'] assert node2.sent == ['ALL'] sched.mark_test_complete(node1, 0) assert sched.tests_finished sched.mark_test_complete(node2, 0) assert sched.tests_finished
def test_schedule_remove_node(self, testdir): node1 = MockNode() config = testdir.parseconfig("--tx=popen") sched = EachScheduling(config) sched.add_node(node1) collection = [ "a.py::test_1", ] assert not sched.collection_is_completed sched.add_node_collection(node1, collection) assert sched.collection_is_completed assert sched.node2collection[node1] == collection sched.schedule() assert sched.tests_finished crashitem = sched.remove_node(node1) assert crashitem assert sched.tests_finished assert not sched.nodes