-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b120ac0
commit 2b6c512
Showing
6 changed files
with
92 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
.PHONY: test deps clean install_glide | ||
|
||
PACKAGES = `go list ./... | grep -v vendor/` | ||
|
||
all: cumulus | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 @@ | ||
package test | ||
|
||
import ( | ||
. "github.com/onsi/ginkgo" | ||
. "github.com/onsi/gomega" | ||
|
||
"testing" | ||
) | ||
|
||
func TestCumulus(t *testing.T) { | ||
RegisterFailHandler(Fail) | ||
RunSpecs(t, "Cumulus Suite") | ||
} |
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,33 @@ | ||
package test | ||
|
||
import ( | ||
"os/exec" | ||
"strconv" | ||
|
||
. "github.com/onsi/ginkgo" | ||
. "github.com/onsi/gomega" | ||
"github.com/ubclaunchpad/cumulus/conn" | ||
"github.com/ubclaunchpad/cumulus/peer" | ||
) | ||
|
||
var _ = Describe("Initialization", func() { | ||
var instance *exec.Cmd | ||
|
||
BeforeEach(func() { | ||
var err error | ||
instance, err = startInstance() | ||
Expect(err).ToNot(HaveOccurred()) | ||
}) | ||
|
||
AfterEach(func() { | ||
if instance.Process != nil { | ||
instance.Process.Kill() | ||
} | ||
}) | ||
|
||
// TODO fails until new peer implementation is merged in | ||
PIt("should accept a TCP connection", func() { | ||
_, err := conn.Dial(peer.DefaultIP + ":" + strconv.Itoa(peer.DefaultPort)) | ||
Expect(err).ToNot(HaveOccurred()) | ||
}) | ||
}) |
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,29 @@ | ||
package test | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
"os/exec" | ||
) | ||
|
||
func startInstance() (*exec.Cmd, error) { | ||
fmt.Println("start instance") | ||
install := exec.Command("go", "install") | ||
install.Dir = "." | ||
|
||
if out, err := install.CombinedOutput(); err != nil { | ||
return nil, err | ||
} else if len(out) != 0 { | ||
// Successful go install is silent | ||
return nil, fmt.Errorf(string(out)) | ||
} | ||
|
||
app := exec.Command("cumulus", "run") | ||
app.Stdout = os.Stdout | ||
app.Stderr = os.Stderr | ||
|
||
fmt.Println("about to start") | ||
err := app.Start() | ||
fmt.Println("started") | ||
return app, err | ||
} |