(t *testing.T)
| 694 | } |
| 695 | |
| 696 | func TestUpdateCmd_DoUpdate_PortsRepo(t *testing.T) { |
| 697 | // Cleanup. |
| 698 | dirs.RemoveAllForTest() |
| 699 | |
| 700 | // Check error. |
| 701 | var check = func(err error) { |
| 702 | t.Helper() |
| 703 | if err != nil { |
| 704 | t.Fatal(err) |
| 705 | } |
| 706 | } |
| 707 | |
| 708 | // Init celer. |
| 709 | celer := configs.NewCeler() |
| 710 | check(celer.Init()) |
| 711 | check(celer.CloneConf(test_conf_repo_url, test_conf_repo_branch, true)) |
| 712 | check(celer.SetBuildType("Release")) |
| 713 | |
| 714 | // Create update command |
| 715 | updateCmd := updateCmd{ |
| 716 | celer: celer, |
| 717 | portsRepo: true, |
| 718 | force: true, |
| 719 | } |
| 720 | |
| 721 | // Note: This test doesn't actually call doUpdate as it would os.Exit |
| 722 | // Instead we test the underlying method directly |
| 723 | err := updateCmd.updatePortsRepo() |
| 724 | if err != nil { |
| 725 | t.Logf("Update ports repo returned: %v (may be acceptable)", err) |
| 726 | } |
| 727 | } |
nothing calls this directly
no test coverage detected