Skip to content
This repository has been archived by the owner on Feb 28, 2020. It is now read-only.

Commit

Permalink
fix: use correct redis default port (#433)
Browse files Browse the repository at this point in the history
  • Loading branch information
tunniclm authored Jan 26, 2018
1 parent b3e1870 commit 623f206
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 34 deletions.
2 changes: 1 addition & 1 deletion lib/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ function sanitizeCredentialsAndFillInDefaults (serviceType, service) {
port: service.port || defaults.port
}
case 'redis':
var defaultRedisURI = { protocol: 'redis', auth: ':', hostname: 'localhost', port: 6397, slashes: true }
var defaultRedisURI = { protocol: 'redis', auth: ':', hostname: 'localhost', port: 6379, slashes: true }
if (service.host) defaultRedisURI.hostname = service.host
if (service.port) defaultRedisURI.port = service.port
if (service.password) defaultRedisURI.auth = `:${service.password}`
Expand Down
60 changes: 31 additions & 29 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test/integration/app/prompted_nobuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ describe('Integration tests (prompt no build) for swiftserver:app', function ()

commonTest.itCreatedServiceConfigFiles()
commonTest.redis.itCreatedServiceFilesWithExpectedContent('myRedisService', {
uri: 'redis://:@localhost:6397'
uri: 'redis://:@localhost:6379'
})
})

Expand Down
6 changes: 3 additions & 3 deletions test/unit/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ describe('Unit tests for helpers', function () {
label: 'compose-for-redis',
plan: 'Standard'
},
uri: 'redis://:@localhost:6397'
uri: 'redis://:@localhost:6379'
},
objectStorage: {
serviceInfo: {
Expand Down Expand Up @@ -326,14 +326,14 @@ describe('Unit tests for helpers', function () {
var service = helpers.sanitizeServiceAndFillInDefaults(
'redis', { serviceInfo: {name: 'my-service'}, password: 'my-password' }
)
assert.equal(service.uri, 'redis://:my-password@localhost:6397')
assert.equal(service.uri, 'redis://:my-password@localhost:6379')
})

it('uri from host (merge with default)', function () {
var service = helpers.sanitizeServiceAndFillInDefaults(
'redis', { serviceInfo: {name: 'my-service'}, host: 'my-host' }
)
assert.equal(service.uri, 'redis://:@my-host:6397')
assert.equal(service.uri, 'redis://:@my-host:6379')
})

it('uri from port (merge with default)', function () {
Expand Down

0 comments on commit 623f206

Please sign in to comment.