mirror of
https://github.com/juanfont/headscale.git
synced 2024-11-24 02:25:24 +00:00
Use failnow for cli tests aswell
This commit is contained in:
parent
8cae4f80d7
commit
3777de7133
@ -40,13 +40,13 @@ func (s *IntegrationCLITestSuite) SetupTest() {
|
|||||||
if ppool, err := dockertest.NewPool(""); err == nil {
|
if ppool, err := dockertest.NewPool(""); err == nil {
|
||||||
s.pool = *ppool
|
s.pool = *ppool
|
||||||
} else {
|
} else {
|
||||||
log.Fatalf("Could not connect to docker: %s", err)
|
s.FailNow(fmt.Sprintf("Could not connect to docker: %s", err), "")
|
||||||
}
|
}
|
||||||
|
|
||||||
if pnetwork, err := s.pool.CreateNetwork("headscale-test"); err == nil {
|
if pnetwork, err := s.pool.CreateNetwork("headscale-test"); err == nil {
|
||||||
s.network = *pnetwork
|
s.network = *pnetwork
|
||||||
} else {
|
} else {
|
||||||
log.Fatalf("Could not create network: %s", err)
|
s.FailNow(fmt.Sprintf("Could not create network: %s", err), "")
|
||||||
}
|
}
|
||||||
|
|
||||||
headscaleBuildOptions := &dockertest.BuildOptions{
|
headscaleBuildOptions := &dockertest.BuildOptions{
|
||||||
@ -56,7 +56,7 @@ func (s *IntegrationCLITestSuite) SetupTest() {
|
|||||||
|
|
||||||
currentPath, err := os.Getwd()
|
currentPath, err := os.Getwd()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("Could not determine current path: %s", err)
|
s.FailNow(fmt.Sprintf("Could not determine current path: %s", err), "")
|
||||||
}
|
}
|
||||||
|
|
||||||
headscaleOptions := &dockertest.RunOptions{
|
headscaleOptions := &dockertest.RunOptions{
|
||||||
@ -72,7 +72,7 @@ func (s *IntegrationCLITestSuite) SetupTest() {
|
|||||||
if pheadscale, err := s.pool.BuildAndRunWithBuildOptions(headscaleBuildOptions, headscaleOptions, DockerRestartPolicy); err == nil {
|
if pheadscale, err := s.pool.BuildAndRunWithBuildOptions(headscaleBuildOptions, headscaleOptions, DockerRestartPolicy); err == nil {
|
||||||
s.headscale = *pheadscale
|
s.headscale = *pheadscale
|
||||||
} else {
|
} else {
|
||||||
log.Fatalf("Could not start headscale container: %s", err)
|
s.FailNow(fmt.Sprintf("Could not start headscale container: %s", err), "")
|
||||||
}
|
}
|
||||||
fmt.Println("Created headscale container")
|
fmt.Println("Created headscale container")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user