MCPcopy Index your code
hub / github.com/celer-pkg/celer / TestUpdateCmd_DoUpdate_ConfRepo

Function TestUpdateCmd_DoUpdate_ConfRepo

cmds/cmd_update_test.go:663–694  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

661}
662
663func 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
696func TestUpdateCmd_DoUpdate_PortsRepo(t *testing.T) {
697 // Cleanup.

Callers

nothing calls this directly

Calls 7

InitMethod · 0.95
CloneConfMethod · 0.95
SetBuildTypeMethod · 0.95
updateConfRepoMethod · 0.95
RemoveAllForTestFunction · 0.92
NewCelerFunction · 0.92
checkFunction · 0.85

Tested by

no test coverage detected