TestAddonGetWithDefaultBranchFlag tests the --default-branch flag functionality
(t *testing.T)
| 678 | |
| 679 | // TestAddonGetWithDefaultBranchFlag tests the --default-branch flag functionality |
| 680 | func TestAddonGetWithDefaultBranchFlag(t *testing.T) { |
| 681 | if !github.HasGitHubToken() { |
| 682 | t.Skip("Skipping because DDEV_GITHUB_TOKEN is not set") |
| 683 | } |
| 684 | origDir, _ := os.Getwd() |
| 685 | site := TestSites[0] |
| 686 | err := os.Chdir(site.Dir) |
| 687 | require.NoError(t, err) |
| 688 | |
| 689 | t.Cleanup(func() { |
| 690 | assert := asrt.New(t) |
| 691 | _, _ = exec.RunHostCommand(DdevBin, "add-on", "remove", "ddev-redis") |
| 692 | err = os.Chdir(origDir) |
| 693 | assert.NoError(err) |
| 694 | }) |
| 695 | |
| 696 | // Test that --default-branch flag works and installs from default branch |
| 697 | out, err := exec.RunHostCommand(DdevBin, "add-on", "get", "ddev/ddev-redis", "--default-branch") |
| 698 | require.NoError(t, err, "Should succeed with --default-branch, out=%s", out) |
| 699 | // Should install from main branch (default_branch for ddev-redis) |
| 700 | require.Contains(t, out, "Installing ddev/ddev-redis:main") |
| 701 | } |
nothing calls this directly
no test coverage detected