Skip to content
Permalink
Browse files

add error for multiple regions, until the feature is complete

  • Loading branch information...
tj committed Jan 2, 2018
1 parent 2fdb36e commit f3c139ff41a72975a182932a3abfade706aa6802
Showing with 8 additions and 2 deletions.
  1. +4 −0 config.go
  2. +4 −2 config_test.go
@@ -129,6 +129,10 @@ func (c *Config) Validate() error {
return errors.Wrap(err, ".stages")
}

if len(c.Regions) > 1 {
return errors.New("multiple regions is not yet supported, see https://github.com/apex/up/issues/134")
}

return nil
}

@@ -73,6 +73,8 @@ func TestConfig_Type(t *testing.T) {
}

func TestConfig_Regions(t *testing.T) {
t.Skip()

t.Run("valid multiple", func(t *testing.T) {
c := Config{
Name: "api",
@@ -166,7 +168,7 @@ func TestConfig_Regions(t *testing.T) {

func TestConfig_defaultRegions(t *testing.T) {
t.Run("regions from config", func(t *testing.T) {
regions := []string{"us-west-2", "us-east-1"}
regions := []string{"us-east-1"}
c := Config{
Name: "api",
Type: "server",
@@ -175,7 +177,7 @@ func TestConfig_defaultRegions(t *testing.T) {
assert.NoError(t, c.Default(), "default")

assert.NoError(t, c.defaultRegions(), "defaultRegions")
assert.Equal(t, 2, len(c.Regions), "regions should have length 2")
assert.Equal(t, 1, len(c.Regions), "regions should have length 2")
assert.Equal(t, regions, c.Regions, "should read regions from config")
assert.NoError(t, c.Validate(), "validate")
})

0 comments on commit f3c139f

Please sign in to comment.
You can’t perform that action at this time.