-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introducing include and exclude in zip action (#991)
* adding include in yaml parser * wip include * wip * wip - dir level include * wip - dir level include * wip - dir level include * wip * wip * wip * wip * wip * wip * wip * wip * wip * include * deleting debugging statement * cleaning up * adding unit test * adding unit test * wip * refactoring * wip * wip * wip * wip * adding more unit tests * fixing unit test * fixing unit test * fixing unit test * adding exclude * fixing unit test * adding warning * adding exclude * refactoring exclude code * adding exclude test case * exclude integration test * cleaning up * adding wski18 strings
- Loading branch information
1 parent
4ad4b9c
commit 3092f1f
Showing
48 changed files
with
1,283 additions
and
95 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
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor | ||
# license agreements; and to You under the Apache License, Version 2.0. | ||
|
||
packages: | ||
helloworld: | ||
actions: | ||
helloNodejs: | ||
function: actions/ | ||
runtime: nodejs:6 | ||
include: | ||
- ["actions/hello.js"] | ||
- ["actions/hello.js", "actions/hello.js"] | ||
- ["actions/hello.js", "actions/hello.js", "actions/hello.js"] |
9 changes: 9 additions & 0 deletions
9
tests/src/integration/zipactionwithexclude/actions/common/utils.js
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// Licensed to the Apache Software Foundation (ASF) under one or more contributor | ||
// license agreements; and to You under the Apache License, Version 2.0. | ||
|
||
const hello = "Hello Dear"; | ||
|
||
module.exports = { | ||
hello: hello | ||
}; | ||
|
21 changes: 21 additions & 0 deletions
21
tests/src/integration/zipactionwithexclude/actions/greeting/index.js
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Licensed to the Apache Software Foundation (ASF) under one or more contributor | ||
// license agreements; and to You under the Apache License, Version 2.0. | ||
|
||
/** | ||
* Return a simple greeting message for someone. | ||
* | ||
* @param name A person's name. | ||
* @param place Where the person is from. | ||
*/ | ||
|
||
|
||
var common = require('./common/utils.js') | ||
|
||
function main(params) { | ||
var name = params.name || params.payload || 'stranger'; | ||
var place = params.place || 'somewhere'; | ||
var hello = common.hello || 'Hello'; | ||
return {payload: hello + ', ' + name + ' from ' + place + '!'}; | ||
} | ||
exports.main = main; | ||
|
6 changes: 6 additions & 0 deletions
6
tests/src/integration/zipactionwithexclude/actions/greeting/package.json
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"name": "my-action", | ||
"main": "index.js", | ||
"dependencies" : { | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
tests/src/integration/zipactionwithexclude/actions/index.js
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Licensed to the Apache Software Foundation (ASF) under one or more contributor | ||
// license agreements; and to You under the Apache License, Version 2.0. | ||
|
||
/** | ||
* Return a simple greeting message for someone. | ||
* | ||
* @param name A person's name. | ||
* @param place Where the person is from. | ||
*/ | ||
|
||
|
||
var common = require('./common/utils.js') | ||
|
||
function main(params) { | ||
var name = params.name || params.payload || 'stranger'; | ||
var place = params.place || 'somewhere'; | ||
var hello = common.hello || 'Hello'; | ||
return {payload: hello + ', ' + name + ' from ' + place + '!'}; | ||
} | ||
exports.main = main; | ||
|
9 changes: 9 additions & 0 deletions
9
tests/src/integration/zipactionwithexclude/actions/libs/lib1/utils.js
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// Licensed to the Apache Software Foundation (ASF) under one or more contributor | ||
// license agreements; and to You under the Apache License, Version 2.0. | ||
|
||
const hello = "Hello Dear"; | ||
|
||
module.exports = { | ||
hello: hello | ||
}; | ||
|
9 changes: 9 additions & 0 deletions
9
tests/src/integration/zipactionwithexclude/actions/libs/lib2/utils.js
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// Licensed to the Apache Software Foundation (ASF) under one or more contributor | ||
// license agreements; and to You under the Apache License, Version 2.0. | ||
|
||
const hello = "Hello Dear"; | ||
|
||
module.exports = { | ||
hello: hello | ||
}; | ||
|
9 changes: 9 additions & 0 deletions
9
tests/src/integration/zipactionwithexclude/actions/libs/lib3/utils.js
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// Licensed to the Apache Software Foundation (ASF) under one or more contributor | ||
// license agreements; and to You under the Apache License, Version 2.0. | ||
|
||
const hello = "Hello Dear"; | ||
|
||
module.exports = { | ||
hello: hello | ||
}; | ||
|
6 changes: 6 additions & 0 deletions
6
tests/src/integration/zipactionwithexclude/actions/package.json
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"name": "my-action", | ||
"main": "index.js", | ||
"dependencies" : { | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor | ||
# license agreements; and to You under the Apache License, Version 2.0. | ||
|
||
packages: | ||
zipactionwithexclude: | ||
version: 1.0 | ||
license: Apache-2.0 | ||
actions: | ||
greeting1: | ||
function: actions | ||
runtime: nodejs:6 | ||
exclude: | ||
- actions/* | ||
include: | ||
- ["actions/common/utils.js", "common/utils.js"] | ||
- ["actions/index.js", "index.js"] | ||
- ["actions/package.json", "package.json"] | ||
|
40 changes: 40 additions & 0 deletions
40
tests/src/integration/zipactionwithexclude/zipactionwithexclude_test.go
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// +build integration | ||
|
||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package tests | ||
|
||
import ( | ||
"github.com/apache/incubator-openwhisk-wskdeploy/tests/src/integration/common" | ||
"github.com/stretchr/testify/assert" | ||
"os" | ||
"testing" | ||
) | ||
|
||
func TestZipActionWithExclude(t *testing.T) { | ||
wskdeploy := common.NewWskdeploy() | ||
_, err := wskdeploy.Deploy(manifestPath, deploymentPath) | ||
assert.Equal(t, nil, err, "Failed to deploy based on the manifest and deployment files.") | ||
_, err = wskdeploy.Undeploy(manifestPath, deploymentPath) | ||
assert.Equal(t, nil, err, "Failed to undeploy based on the manifest and deployment files.") | ||
} | ||
|
||
var ( | ||
manifestPath = os.Getenv("GOPATH") + "/src/github.com/apache/incubator-openwhisk-wskdeploy/tests/src/integration/zipactionwithexclude/manifest.yml" | ||
deploymentPath = "" | ||
) |
9 changes: 9 additions & 0 deletions
9
tests/src/integration/zipactionwithinclude/actions/common/utils.js
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// Licensed to the Apache Software Foundation (ASF) under one or more contributor | ||
// license agreements; and to You under the Apache License, Version 2.0. | ||
|
||
const hello = "Hello Dear"; | ||
|
||
module.exports = { | ||
hello: hello | ||
}; | ||
|
21 changes: 21 additions & 0 deletions
21
tests/src/integration/zipactionwithinclude/actions/greeting1/index.js
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Licensed to the Apache Software Foundation (ASF) under one or more contributor | ||
// license agreements; and to You under the Apache License, Version 2.0. | ||
|
||
/** | ||
* Return a simple greeting message for someone. | ||
* | ||
* @param name A person's name. | ||
* @param place Where the person is from. | ||
*/ | ||
|
||
|
||
var common = require('./actions/common/utils.js') | ||
|
||
function main(params) { | ||
var name = params.name || params.payload || 'stranger'; | ||
var place = params.place || 'somewhere'; | ||
var hello = common.hello || 'Hello'; | ||
return {payload: hello + ', ' + name + ' from ' + place + '!'}; | ||
} | ||
exports.main = main; | ||
|
6 changes: 6 additions & 0 deletions
6
tests/src/integration/zipactionwithinclude/actions/greeting1/package.json
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"name": "my-action", | ||
"main": "index.js", | ||
"dependencies" : { | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
tests/src/integration/zipactionwithinclude/actions/greeting10/index.js
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Licensed to the Apache Software Foundation (ASF) under one or more contributor | ||
// license agreements; and to You under the Apache License, Version 2.0. | ||
|
||
/** | ||
* Return a simple greeting message for someone. | ||
* | ||
* @param name A person's name. | ||
* @param place Where the person is from. | ||
*/ | ||
|
||
|
||
var lib1 = require('./actions/libs/lib1/utils.js') | ||
var lib2 = require('./actions/libs/lib2/utils.js') | ||
var lib3 = require('./actions/libs/lib3/utils.js') | ||
|
||
function main(params) { | ||
var name = params.name || params.payload || 'stranger'; | ||
var place = params.place || 'somewhere'; | ||
var hello = lib1.hello || lib2.hello || lib3.hello || 'Hello'; | ||
return {payload: hello + ', ' + name + ' from ' + place + '!'}; | ||
} | ||
exports.main = main; | ||
|
6 changes: 6 additions & 0 deletions
6
tests/src/integration/zipactionwithinclude/actions/greeting10/package.json
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"name": "my-action", | ||
"main": "index.js", | ||
"dependencies" : { | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
tests/src/integration/zipactionwithinclude/actions/greeting2/index.js
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Licensed to the Apache Software Foundation (ASF) under one or more contributor | ||
// license agreements; and to You under the Apache License, Version 2.0. | ||
|
||
/** | ||
* Return a simple greeting message for someone. | ||
* | ||
* @param name A person's name. | ||
* @param place Where the person is from. | ||
*/ | ||
|
||
|
||
var common1 = require('./common/utils.js') | ||
var common2 = require('./common/common1/utils.js') | ||
var common3 = require('./common/common1/copyUtils.js') | ||
|
||
function main(params) { | ||
var name = params.name || params.payload || 'stranger'; | ||
var place = params.place || 'somewhere'; | ||
var hello = common1.hello || common2.hello || common3.hello || 'Hello'; | ||
return {payload: hello + ', ' + name + ' from ' + place + '!'}; | ||
} | ||
exports.main = main; | ||
|
6 changes: 6 additions & 0 deletions
6
tests/src/integration/zipactionwithinclude/actions/greeting2/package.json
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"name": "my-action", | ||
"main": "index.js", | ||
"dependencies" : { | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
tests/src/integration/zipactionwithinclude/actions/greeting3/index.js
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Licensed to the Apache Software Foundation (ASF) under one or more contributor | ||
// license agreements; and to You under the Apache License, Version 2.0. | ||
|
||
/** | ||
* Return a simple greeting message for someone. | ||
* | ||
* @param name A person's name. | ||
* @param place Where the person is from. | ||
*/ | ||
|
||
|
||
var common1 = require('./common/utils.js') | ||
var common2 = require('./common/common1/utils.js') | ||
|
||
function main(params) { | ||
var name = params.name || params.payload || 'stranger'; | ||
var place = params.place || 'somewhere'; | ||
var hello = common1.hello || common2.hello || 'Hello'; | ||
return {payload: hello + ', ' + name + ' from ' + place + '!'}; | ||
} | ||
exports.main = main; | ||
|
6 changes: 6 additions & 0 deletions
6
tests/src/integration/zipactionwithinclude/actions/greeting3/package.json
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"name": "my-action", | ||
"main": "index.js", | ||
"dependencies" : { | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
tests/src/integration/zipactionwithinclude/actions/greeting4/index.js
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Licensed to the Apache Software Foundation (ASF) under one or more contributor | ||
// license agreements; and to You under the Apache License, Version 2.0. | ||
|
||
/** | ||
* Return a simple greeting message for someone. | ||
* | ||
* @param name A person's name. | ||
* @param place Where the person is from. | ||
*/ | ||
|
||
|
||
var common = require('./common/utils.js') | ||
|
||
function main(params) { | ||
var name = params.name || params.payload || 'stranger'; | ||
var place = params.place || 'somewhere'; | ||
var hello = common.hello || 'Hello'; | ||
return {payload: hello + ', ' + name + ' from ' + place + '!'}; | ||
} | ||
exports.main = main; | ||
|
6 changes: 6 additions & 0 deletions
6
tests/src/integration/zipactionwithinclude/actions/greeting4/package.json
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"name": "my-action", | ||
"main": "index.js", | ||
"dependencies" : { | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
tests/src/integration/zipactionwithinclude/actions/greeting5/index.js
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Licensed to the Apache Software Foundation (ASF) under one or more contributor | ||
// license agreements; and to You under the Apache License, Version 2.0. | ||
|
||
/** | ||
* Return a simple greeting message for someone. | ||
* | ||
* @param name A person's name. | ||
* @param place Where the person is from. | ||
*/ | ||
|
||
|
||
var common = require('./common/utils.js') | ||
|
||
function main(params) { | ||
var name = params.name || params.payload || 'stranger'; | ||
var place = params.place || 'somewhere'; | ||
var hello = common.hello || 'Hello'; | ||
return {payload: hello + ', ' + name + ' from ' + place + '!'}; | ||
} | ||
exports.main = main; | ||
|
6 changes: 6 additions & 0 deletions
6
tests/src/integration/zipactionwithinclude/actions/greeting5/package.json
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"name": "my-action", | ||
"main": "index.js", | ||
"dependencies" : { | ||
} | ||
} |
Oops, something went wrong.