Skip to content

Commit

Permalink
Merge 547556f into b83d703
Browse files Browse the repository at this point in the history
  • Loading branch information
istreeter committed Feb 20, 2020
2 parents b83d703 + 547556f commit f71dcaf
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: go
go:
- 1.8
- 1.13

before_script:
- wget https://releases.hashicorp.com/consul/1.4.0/consul_1.4.0_linux_amd64.zip
Expand All @@ -19,7 +19,7 @@ deploy:
provider: script
script: make release
on:
condition: '"${TRAVIS_GO_VERSION}" == "1.8"'
condition: '"${TRAVIS_GO_VERSION}" == "1.13"'
tags: true

env:
Expand Down
6 changes: 3 additions & 3 deletions src/config_resolver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ func TestTemplateRawBytes_timeWithFormat(t *testing.T) {
assert.Nil(templatedByteArr)
assert.NotNil(err)
assert.Equal(`template: `+templateName+`:1:10: executing "`+templateName+
`" at <timeWithFormat "qwer...>: error calling timeWithFormat: strconv.ParseInt: parsing "qwerty": invalid syntax`, err.Error())
`" at <timeWithFormat "qwerty" "2006">: error calling timeWithFormat: strconv.ParseInt: parsing "qwerty": invalid syntax`, err.Error())
}

func TestTemplateRawBytes_systemEnv(t *testing.T) {
Expand All @@ -235,7 +235,7 @@ func TestTemplateRawBytes_systemEnv(t *testing.T) {
assert.Nil(templatedByteArr)
assert.Equal(
`template: `+templateName+`:1:10: executing "`+templateName+
`" at <systemEnv "DOESNT_EX...>: error calling systemEnv: environment variable DOESNT_EXIST not set`,
`" at <systemEnv "DOESNT_EXIST">: error calling systemEnv: environment variable DOESNT_EXIST not set`,
err.Error())
}

Expand Down Expand Up @@ -272,7 +272,7 @@ func TestTemplateRawBytes_base64File(t *testing.T) {
assert.Nil(templatedByteArr)
assert.Equal(
`template: `+templateName+`:1:10: executing "`+templateName+
`" at <base64File "/tmp/doe...>: error calling base64File: open /tmp/doesnt/exist: no such file or directory`,
`" at <base64File "/tmp/doesnt/exist">: error calling base64File: open /tmp/doesnt/exist: no such file or directory`,
err.Error())
}

Expand Down
8 changes: 5 additions & 3 deletions src/emr_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,10 @@ func (ec EmrCluster) GetApplications() ([]*emr.Application, error) {
applications := ec.Config.Applications

var emrApplicationArr []*emr.Application
allowedApps := []string{"Hadoop", "Hive", "Mahout", "Pig", "Spark"}
allowedApps := []string{
"Hadoop", "Flink", "Ganglia", "HBase", "Hive", "HCatalog", "Hudi", "Hue", "JupyterHub", "Livy", "Mahout",
"MXNet", "Oozie", "Phoenix", "Pig", "Presto", "Spark", "Sqoop", "TensorFlow", "Tez", "Zeppelin", "Zookeeper",
}

if applications != nil && len(applications) > 0 {
emrApplicationArr = make([]*emr.Application, len(applications))
Expand All @@ -424,8 +427,7 @@ func (ec EmrCluster) GetApplications() ([]*emr.Application, error) {

emrApplicationArr[i] = &emrApplication
} else {
return nil, errors.New("Only " + strings.Join(allowedApps, ", ") +
" are allowed applications")
return nil, errors.New("The only allowed applications are: " + strings.Join(allowedApps, ", "))
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/emr_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ func TestGetApplications_WithApps(t *testing.T) {
ec, _ = InitEmrCluster(*record)
_, err := ec.GetApplications()
assert.NotNil(err)
assert.Equal("Only Hadoop, Hive, Mahout, Pig, Spark are allowed applications", err.Error())
assert.Equal("The only allowed applications are: Hadoop, Flink, Ganglia, HBase, Hive, HCatalog, Hudi, Hue, JupyterHub, Livy, Mahout, MXNet, Oozie, Phoenix, Pig, Presto, Spark, Sqoop, TensorFlow, Tez, Zeppelin, Zookeeper", err.Error())
}

func TestGetLocation_Fail(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion src/lock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"testing"

"github.com/hashicorp/consul/api"
"github.com/hashicorp/consul/testutil"
"github.com/hashicorp/consul/sdk/testutil"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion src/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ func getConsulFlag() cli.StringFlag {
func up(emrConfig string, vars string) (string, error) {
clusterRecord, err := parseClusterRecord(emrConfig, vars)
if err != nil {
return "", nil
return "", err
}

return upWithConfig(clusterRecord)
Expand Down

0 comments on commit f71dcaf

Please sign in to comment.