pritidesai commented on a change in pull request #310: Support both
manifest.yaml and manifest.yml
URL:
https://github.com/apache/incubator-openwhisk-wskdeploy/pull/310#discussion_r133848138
##########
File path: tests/src/integration/common/wskdeploy.go
##########
@@ -18,38 +18,46 @@
package common
import (
- "os"
- "os/exec"
+ "os"
+ "os/exec"
)
const cmd = "wskdeploy"
type Wskdeploy struct {
- Path string
- Dir string
+ Path string
+ Dir string
}
func NewWskdeploy() *Wskdeploy {
- return NewWskWithPath(os.Getenv("GOPATH") +
"/src/github.com/apache/incubator-openwhisk-wskdeploy/")
+ return NewWskWithPath(os.Getenv("GOPATH") +
"/src/github.com/apache/incubator-openwhisk-wskdeploy/")
}
func NewWskWithPath(path string) *Wskdeploy {
- var dep Wskdeploy
- dep.Path = cmd
- dep.Dir = path
- return &dep
+ var dep Wskdeploy
+ dep.Path = cmd
+ dep.Dir = path
+ return &dep
}
func (wskdeploy *Wskdeploy) RunCommand(s ...string) ([]byte, error) {
- command := exec.Command(wskdeploy.Path, s...)
- command.Dir = wskdeploy.Dir
- return command.CombinedOutput()
+ command := exec.Command(wskdeploy.Path, s...)
+ command.Dir = wskdeploy.Dir
+ return command.CombinedOutput()
}
func (wskdeploy *Wskdeploy) Deploy(manifestPath string, deploymentPath string)
([]byte, error) {
- return wskdeploy.RunCommand("-m", manifestPath, "-d", deploymentPath)
+ return wskdeploy.RunCommand("-m", manifestPath, "-d", deploymentPath)
}
func (wskdeploy *Wskdeploy) Undeploy(manifestPath string, deploymentPath
string) ([]byte, error) {
- return wskdeploy.RunCommand("undeploy", "-m", manifestPath, "-d",
deploymentPath)
+ return wskdeploy.RunCommand("undeploy", "-m", manifestPath, "-d",
deploymentPath)
+}
+
+func (wskdeploy *Wskdeploy) DeployProjectPathOnly(projectPath string) ([]byte,
error) {
+ return wskdeploy.RunCommand("-p", projectPath)
+}
+
+func (wskdeploy *Wskdeploy) DeployManifestPathOnly(manifestpath string)
([]byte, error) {
+ return wskdeploy.RunCommand("-p", manifestpath)
Review comment:
this should be
```
return wskdeploy.RunCommand("-m", manifestpath)
```
instead of
```
return wskdeploy.RunCommand("-p", manifestpath)
```
Integration tests are not clearly catching this bug, when I run it manually:
```
./wskdeploy -p tests/src/integration/flagstests/manifest.yaml
2017/08/17 15:46:51 Manifest file not found at path
/Users/pritidesai/Documents/goworkspace/src/github.com/apache/incubator-openwhisk-wskdeploy/tests/src/integration/flagstests/manifest.yaml
```
But two integration tests we have which are using this method (1)
TestSupportManifestYamlPath (2) TestSupportManifestYmlPath are passing (PASS)
on Travis.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services