diff options
author | Carlos Tadeu Panato Junior <ctadeu@gmail.com> | 2017-10-25 18:41:16 +0200 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2017-10-25 09:41:16 -0700 |
commit | b4930fb8e5c41b54272661426ec0633255089eb3 (patch) | |
tree | 91f7f42d4e0008530b4a630eeeb2c9e5806f670f /utils/file_test.go | |
parent | 5dd4466ab32d55f1369ad6a30670b3559ff41e11 (diff) | |
download | chat-b4930fb8e5c41b54272661426ec0633255089eb3.tar.gz chat-b4930fb8e5c41b54272661426ec0633255089eb3.tar.bz2 chat-b4930fb8e5c41b54272661426ec0633255089eb3.zip |
[PLT-7726] adjustments for the mm-server jenkinsfile (#7688)
Diffstat (limited to 'utils/file_test.go')
-rw-r--r-- | utils/file_test.go | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/utils/file_test.go b/utils/file_test.go index 0ad02de7e..ed2e8683b 100644 --- a/utils/file_test.go +++ b/utils/file_test.go @@ -4,6 +4,8 @@ package utils import ( + "fmt" + "os" "testing" "github.com/stretchr/testify/suite" @@ -53,6 +55,17 @@ func (s *FileTestSuite) SetupTest() { s.amazonS3SSL = *Cfg.FileSettings.AmazonS3SSL // Set up the state for the tests. + s3Host := os.Getenv("CI_HOST") + if s3Host == "" { + s3Host = "dockerhost" + } + + s3Port := os.Getenv("CI_MINIO_PORT") + if s3Port == "" { + s3Port = "9001" + } + + s3Endpoint := fmt.Sprintf("%s:%s", s3Host, s3Port) if s.testDriver == model.IMAGE_DRIVER_LOCAL { *Cfg.FileSettings.DriverName = model.IMAGE_DRIVER_LOCAL } else if s.testDriver == model.IMAGE_DRIVER_S3 { @@ -60,7 +73,7 @@ func (s *FileTestSuite) SetupTest() { Cfg.FileSettings.AmazonS3AccessKeyId = "minioaccesskey" Cfg.FileSettings.AmazonS3SecretAccessKey = "miniosecretkey" Cfg.FileSettings.AmazonS3Bucket = "mattermost-test" - Cfg.FileSettings.AmazonS3Endpoint = "dockerhost:9001" + Cfg.FileSettings.AmazonS3Endpoint = s3Endpoint *Cfg.FileSettings.AmazonS3SSL = false } else { s.T().Fatal("Invalid image driver set for test suite.") |