Skip to content

Commit

Permalink
Support setting action concurrency in manifest adobe#176 (adobe#177)
Browse files Browse the repository at this point in the history
* Support setting action concurrency in manifest adobe#176
  • Loading branch information
alexkli authored and purplecabbage committed Jul 16, 2020
1 parent dce1297 commit fb2c4c9
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/__fixtures__/deploy/manifest_concurrency.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
# license agreements; and to You under the Apache License, Version 2.0.

# Example: set custom action concurrency
packages:
demo_package:
actions:
sampleAction:
function: /deploy/main.js
limits:
concurrency: 10

25 changes: 25 additions & 0 deletions test/commands/runtime/deploy/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ describe('instance methods', () => {
'deploy/manifest_conductor.yaml': fixtureFile('deploy/manifest_conductor.yaml'),
'deploy/manifest_final.yaml': fixtureFile('deploy/manifest_final.yaml'),
'deploy/manifest_docker.yaml': fixtureFile('deploy/manifest_docker.yaml'),
'deploy/manifest_concurrency.yaml': fixtureFile('deploy/manifest_concurrency.yaml'),
'deploy/manifest_api_incorrect.yaml': fixtureFile('deploy/manifest_api_incorrect.yaml'),
'deploy/deployment_syncMissingAction.yaml': fixtureFile('deploy/deployment_syncMissingAction.yaml'),
'deploy/manifest_multiple_packages.yaml': fixtureFile('deploy/manifest_multiple_packages.yaml'),
Expand Down Expand Up @@ -404,6 +405,30 @@ describe('instance methods', () => {
})
})

test('deploys actions with concurrency limit', () => {
const cmd = ow.mockResolved(owAction, '')
const mainAction = fixtureFile('deploy/main.js')
command.argv = ['-m', '/deploy/manifest_concurrency.yaml']
return command.run()
.then(() => {
expect(cmd).toHaveBeenCalledWith({
name: 'demo_package/sampleAction',
action: mainAction,
annotations: {
'raw-http': false,
'web-export': false
},
limits: {
concurrency: 10,
logs: 10,
memory: 256,
timeout: 60000
}
})
expect(stdout.output).toMatch('')
})
})

test('deploys actions with manifest inputs when no actions present in deployment file', () => {
const cmd = ow.mockResolved(owAction, '')
command.argv = ['-m', '/deploy/manifest_dep.yaml', '--deployment', '/deploy/deployment_wrongTrigger.yaml']
Expand Down

0 comments on commit fb2c4c9

Please sign in to comment.