Reconstruction tests
(t *testing.T)
| 490 | // Reconstruction tests |
| 491 | |
| 492 | func TestReconstructionService(t *testing.T) { |
| 493 | ctrl := gomock.NewController(t) |
| 494 | defer ctrl.Finish() |
| 495 | |
| 496 | logrus.SetLevel(logrus.FatalLevel) |
| 497 | |
| 498 | persistenceLayer := mock_persistence.NewMockPersistenceLayer(ctrl) |
| 499 | |
| 500 | persistenceLayer.EXPECT().GetWorkerNodeInformation(gomock.Any()).DoAndReturn(func(_ context.Context) ([]*proto.WorkerNodeInformation, error) { |
| 501 | return make([]*proto.WorkerNodeInformation, 0), nil |
| 502 | }).Times(1) |
| 503 | |
| 504 | persistenceLayer.EXPECT().GetServiceInformation(gomock.Any()).DoAndReturn(func(_ context.Context) ([]*proto.ServiceInfo, error) { |
| 505 | return []*proto.ServiceInfo{ |
| 506 | { |
| 507 | Name: "1", |
| 508 | Image: "", |
| 509 | PortForwarding: nil, |
| 510 | AutoscalingConfig: nil, |
| 511 | }, |
| 512 | { |
| 513 | Name: "2", |
| 514 | Image: "", |
| 515 | PortForwarding: nil, |
| 516 | AutoscalingConfig: nil, |
| 517 | }, |
| 518 | { |
| 519 | Name: "3", |
| 520 | Image: "", |
| 521 | PortForwarding: nil, |
| 522 | AutoscalingConfig: nil, |
| 523 | }, |
| 524 | { |
| 525 | Name: "4", |
| 526 | Image: "", |
| 527 | PortForwarding: nil, |
| 528 | AutoscalingConfig: nil, |
| 529 | }, |
| 530 | { |
| 531 | Name: "5", |
| 532 | Image: "", |
| 533 | PortForwarding: nil, |
| 534 | AutoscalingConfig: nil, |
| 535 | }, |
| 536 | }, nil |
| 537 | }).Times(1) |
| 538 | |
| 539 | persistenceLayer.EXPECT().GetDataPlaneInformation(gomock.Any()).DoAndReturn(func(_ context.Context) ([]*proto.DataplaneInformation, error) { |
| 540 | return make([]*proto.DataplaneInformation, 0), nil |
| 541 | }).Times(1) |
| 542 | |
| 543 | persistenceLayer.EXPECT().SetLeader(gomock.Any()).DoAndReturn(func(_ context.Context) error { |
| 544 | return nil |
| 545 | }).Times(1) |
| 546 | |
| 547 | controlPlane := NewControlPlane(persistenceLayer, "", placement_policy.NewRandomPlacement(), data_plane.NewDataplaneConnection, workers.NewWorkerNode, &mockConfig) |
| 548 | |
| 549 | start := time.Now() |
nothing calls this directly
no test coverage detected