-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: check command input is valid array #290
base: master
Are you sure you want to change the base?
Changes from all commits
3e7b9d4
4e95d41
2f2f0db
bb32648
1765054
fc85ae9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -423,7 +423,7 @@ describe('Render task definition', () => { | |
.mockReturnValueOnce('awslogs') | ||
.mockReturnValueOnce('awslogs-create-group=true\nawslogs-group=/ecs/web\nawslogs-region=us-east-1\nawslogs-stream-prefix=ecs') | ||
.mockReturnValueOnce('key1=value1\nkey2=value2') | ||
.mockReturnValueOnce('npm start --nice --please'); | ||
.mockReturnValueOnce('["npm", "start", "--nice", "--please"]'); | ||
|
||
await run(); | ||
|
||
|
@@ -489,4 +489,21 @@ describe('Render task definition', () => { | |
}, null, 2) | ||
); | ||
}); | ||
|
||
test('error returned for invalid command', async () => { | ||
core.getInput = jest | ||
.fn() | ||
.mockReturnValueOnce('task-definition.json') | ||
.mockReturnValueOnce('web') | ||
.mockReturnValueOnce('nginx:latest') | ||
.mockReturnValueOnce('EXAMPLE=here') | ||
.mockReturnValueOnce('awslogs') | ||
.mockReturnValueOnce('awslogs-create-group=true\nawslogs-group=/ecs/web\nawslogs-region=us-east-1\nawslogs-stream-prefix=ecs') | ||
.mockReturnValueOnce('key1=value1\nkey2=value2') | ||
.mockReturnValueOnce('npm start --nice --please'); | ||
|
||
await run(); | ||
|
||
expect(core.setFailed).toBeCalledWith('Invalid command: \'npm start --nice --please\'. command must be a valid JSON array.'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please feel free to add additional insights to this, but seems like this change would render previously "valid" commands as "invalid" for other users. For example Is this correct? |
||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, please correct me if my understanding here is not correct:
Taking the example input you mentioned in PR description:
alembic revision --autogenerate -m "Your message here"
The input will be marked as invalid command in this case, but before your change it would be considered correct but would eventually fail, Is this correct?