(t *testing.T)
| 661 | } |
| 662 | |
| 663 | func TestUpdateCmd_DoUpdate_ConfRepo(t *testing.T) { |
| 664 | // Cleanup. |
| 665 | dirs.RemoveAllForTest() |
| 666 | |
| 667 | // Check error. |
| 668 | var check = func(err error) { |
| 669 | t.Helper() |
| 670 | if err != nil { |
| 671 | t.Fatal(err) |
| 672 | } |
| 673 | } |
| 674 | |
| 675 | // Init celer. |
| 676 | celer := configs.NewCeler() |
| 677 | check(celer.Init()) |
| 678 | check(celer.CloneConf(test_conf_repo_url, test_conf_repo_branch, true)) |
| 679 | check(celer.SetBuildType("Release")) |
| 680 | |
| 681 | // Create update command |
| 682 | updateCmd := updateCmd{ |
| 683 | celer: celer, |
| 684 | confRepo: true, |
| 685 | force: true, |
| 686 | } |
| 687 | |
| 688 | // Note: This test doesn't actually call doUpdate as it would os.Exit |
| 689 | // Instead we test the underlying method directly |
| 690 | err := updateCmd.updateConfRepo() |
| 691 | if err != nil { |
| 692 | t.Logf("Update conf repo returned: %v (may be acceptable)", err) |
| 693 | } |
| 694 | } |
| 695 | |
| 696 | func TestUpdateCmd_DoUpdate_PortsRepo(t *testing.T) { |
| 697 | // Cleanup. |
nothing calls this directly
no test coverage detected