Exemple #1
0
// Lists apps or fails.
func mustAppList(t testing.TB, c *heroku.Client) []heroku.App {
	apps, err := c.AppList(nil)
	if err != nil {
		t.Fatal(err)
	}

	return apps
}
Exemple #2
0
func mustFormationBatchUpdate(t testing.TB, c *heroku.Client, appName string, updates []heroku.FormationBatchUpdateOpts) []heroku.Formation {
	f, err := c.FormationBatchUpdate(appName, updates, "")
	if err != nil {
		t.Fatal(err)
	}

	return f
}
Exemple #3
0
func mustReleaseRollback(t testing.TB, c *heroku.Client, appName string, version string) *heroku.Release {
	release, err := c.ReleaseRollback(appName, version, "")
	if err != nil {
		t.Fatal(err)
	}

	return release
}
Exemple #4
0
func mustReleaseList(t testing.TB, c *heroku.Client, appName string) []heroku.Release {
	releases, err := c.ReleaseList(appName, nil)
	if err != nil {
		t.Fatal(err)
	}

	return releases
}
Exemple #5
0
func mustConfigVarInfo(t testing.TB, c *heroku.Client, appName string) map[string]string {
	vars, err := c.ConfigVarInfo(appName)
	if err != nil {
		t.Fatal(err)
	}

	return vars
}
Exemple #6
0
func mustConfigVarUpdate(t testing.TB, c *heroku.Client, appName string, options map[string]*string) map[string]string {
	vars, err := c.ConfigVarUpdate(appName, options, "")
	if err != nil {
		t.Fatal(err)
	}

	return vars
}
Exemple #7
0
func mustDeploy(t testing.TB, c *heroku.Client, image string) {
	var (
		f DeployForm
	)

	f.Image = image

	if err := c.Post(ioutil.Discard, "/deploys", &f); err != nil {
		t.Fatal(err)
	}
}
Exemple #8
0
// Deploys an image for the app or fails.
func mustAppDeploy(t testing.TB, c *heroku.Client, appName string, image string) {
	var (
		f DeployForm
	)

	f.Image = image
	endpoint := fmt.Sprintf("/apps/%s/deploys", appName)

	if err := c.Post(ioutil.Discard, endpoint, &f); err != nil {
		t.Fatal(err)
	}
}
Exemple #9
0
// Creates an app or fails.
func mustOrganizationAppCreate(t testing.TB, c *heroku.Client, app empire.App) *heroku.OrganizationApp {
	name := string(app.Name)

	opts := heroku.OrganizationAppCreateOpts{
		Name: &name,
	}

	a, err := c.OrganizationAppCreate(&opts)
	if err != nil {
		t.Fatal(err)
	}

	return a
}
Exemple #10
0
// Delets an app or fails.
func mustAppDelete(t testing.TB, c *heroku.Client, appName string) {
	if err := c.AppDelete(appName); err != nil {
		t.Fatal(err)
	}
}