-
Notifications
You must be signed in to change notification settings - Fork 224
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: only print slug size for apps:info for non-fir apps (#3129)
* fix: only print slug size for apps:info for non-fir apps * test: update apps:info tests for slug size and add fir tests
- Loading branch information
Showing
2 changed files
with
97 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,25 @@ const app = { | |
stack: {name: 'cedar-14'}, | ||
owner: {email: '[email protected]'}, | ||
space: {name: 'myspace'}, | ||
generation: {id: '123', name: 'cedar'}, | ||
internal_routing: true, | ||
} | ||
|
||
const firApp = { | ||
id: 'app-id', | ||
name: 'myapp', | ||
database_size: 1000, | ||
create_status: 'complete', | ||
repo_size: 1000, | ||
slug_size: null, | ||
git_url: 'https://git.heroku.com/myapp', | ||
web_url: 'https://myapp.herokuapp.com', | ||
region: {name: 'eu'}, | ||
build_stack: {name: 'cedar-14'}, | ||
stack: {name: 'cedar-14'}, | ||
owner: {email: '[email protected]'}, | ||
space: {name: 'myspace'}, | ||
generation: {id: '123', name: 'fir'}, | ||
internal_routing: true, | ||
} | ||
|
||
|
@@ -33,6 +52,10 @@ const appAcm = Object.assign({}, app, { | |
acm: true, | ||
}) | ||
|
||
const firAppAcm = Object.assign({}, firApp, { | ||
acm: true, | ||
}) | ||
|
||
const addons = [ | ||
{plan: {name: 'papertrail'}}, | ||
{plan: {name: 'heroku-redis'}}, | ||
|
@@ -62,6 +85,24 @@ Stack: cedar-14 | |
Web URL: https://myapp.herokuapp.com | ||
` | ||
|
||
const BASE_INFO_FIR = `=== myapp | ||
Addons: heroku-redis | ||
papertrail | ||
Auto Cert Mgmt: true | ||
Collaborators: [email protected] | ||
Database Size: 1000 B | ||
Dynos: web: 1 | ||
Git URL: https://git.heroku.com/myapp | ||
Internal Routing: true | ||
Owner: [email protected] | ||
Region: eu | ||
Repo Size: 1000 B | ||
Space: myspace | ||
Stack: cedar-14 | ||
Web URL: https://myapp.herokuapp.com | ||
` | ||
|
||
describe('apps:info', function () { | ||
test | ||
.stdout() | ||
|
@@ -351,6 +392,60 @@ Slug Size: 1000 B | |
Space: myspace | ||
Stack: cedar-14 (next build will use heroku-24) | ||
Web URL: https://myapp.herokuapp.com | ||
`) | ||
expect(unwrap(stderr)).to.contains('') | ||
}) | ||
|
||
test | ||
.stdout() | ||
.stderr() | ||
.nock('https://api.heroku.com', api => | ||
api | ||
.get('/apps/myapp') | ||
.reply(200, firAppAcm), | ||
) | ||
.nock('https://api.heroku.com:443', api => | ||
api | ||
.get('/apps/myapp/addons') | ||
.reply(200, addons) | ||
.get('/apps/myapp/collaborators') | ||
.reply(200, collaborators) | ||
.get('/apps/myapp/dynos') | ||
.reply(200, [{type: 'web', size: 'Standard-1X', quantity: 2}]), | ||
) | ||
.command(['apps:info', '-a', 'myapp']) | ||
.it('shows fir app info without slug size', ({stdout, stderr}) => { | ||
expect(stdout).to.equal(BASE_INFO_FIR) | ||
expect(unwrap(stderr)).to.contains('') | ||
}) | ||
|
||
test | ||
.stdout() | ||
.stderr() | ||
.nock('https://api.heroku.com', api => | ||
api | ||
.get('/apps/myapp') | ||
.reply(200, firAppAcm), | ||
) | ||
.nock('https://api.heroku.com:443', api => | ||
api | ||
.get('/apps/myapp/addons').reply(200, addons) | ||
.get('/apps/myapp/collaborators').reply(200, collaborators) | ||
.get('/apps/myapp/dynos').reply(200, [{type: 'web', size: 'Standard-1X', quantity: 2}]), | ||
) | ||
.command(['apps:info', 'myapp', '--shell']) | ||
.it('shows fir app info in shell format without slug size', ({stdout, stderr}) => { | ||
expect(stdout).to.equal(`auto_cert_mgmt=true | ||
addons=heroku-redis,papertrail | ||
[email protected] | ||
database_size=1000 B | ||
git_url=https://git.heroku.com/myapp | ||
web_url=https://myapp.herokuapp.com | ||
repo_size=1000 B | ||
[email protected] | ||
region=eu | ||
dynos={ web: 1 } | ||
stack=cedar-14 | ||
`) | ||
expect(unwrap(stderr)).to.contains('') | ||
}) | ||
|