feat(FN-1229): add node mesh CLI commands for node and mesh management
- Add fn node list command to list all registered nodes with status and URL - Add fn node show command to display detailed node information including system metrics - Add fn node health-check command to trigger and verify node health status - Add fn node remove command to unregister nodes from the mesh - Add fn mesh status command to show mesh topology with peer connections - Add comprehensive tests for all node and mesh CLI commands - Update bin.ts to wire up new node and mesh subcommands - Update memory with CLI mock pattern for testing
This commit is contained in:
@@ -61,10 +61,14 @@ const commandMocks = vi.hoisted(() => ({
|
||||
runProjectDetect: vi.fn(),
|
||||
|
||||
runNodeList: vi.fn(),
|
||||
runNodeAdd: vi.fn(),
|
||||
runNodeRemove: vi.fn(),
|
||||
runNodeConnect: vi.fn(),
|
||||
runNodeDisconnect: vi.fn(),
|
||||
runNodeShow: vi.fn(),
|
||||
runNodeHealth: vi.fn(),
|
||||
runMeshStatus: vi.fn(),
|
||||
// Legacy aliases
|
||||
runNodeAdd: vi.fn(),
|
||||
runNodeRemove: vi.fn(),
|
||||
|
||||
runAgentStop: vi.fn(),
|
||||
runAgentStart: vi.fn(),
|
||||
@@ -151,10 +155,14 @@ vi.mock("./commands/project.js", () => ({
|
||||
|
||||
vi.mock("./commands/node.js", () => ({
|
||||
runNodeList: commandMocks.runNodeList,
|
||||
runNodeAdd: commandMocks.runNodeAdd,
|
||||
runNodeRemove: commandMocks.runNodeRemove,
|
||||
runNodeConnect: commandMocks.runNodeConnect,
|
||||
runNodeDisconnect: commandMocks.runNodeDisconnect,
|
||||
runNodeShow: commandMocks.runNodeShow,
|
||||
runNodeHealth: commandMocks.runNodeHealth,
|
||||
runMeshStatus: commandMocks.runMeshStatus,
|
||||
// Legacy aliases
|
||||
runNodeAdd: commandMocks.runNodeAdd,
|
||||
runNodeRemove: commandMocks.runNodeRemove,
|
||||
}));
|
||||
|
||||
vi.mock("./commands/agent.js", () => ({
|
||||
@@ -435,7 +443,7 @@ describe("bin command routing and fallbacks", () => {
|
||||
"4",
|
||||
]);
|
||||
|
||||
expect(commandMocks.runNodeAdd).toHaveBeenCalledWith("worker-a", {
|
||||
expect(commandMocks.runNodeConnect).toHaveBeenCalledWith("worker-a", {
|
||||
url: "http://x",
|
||||
apiKey: "key",
|
||||
maxConcurrent: 4,
|
||||
|
||||
Reference in New Issue
Block a user