Use BuildKit when building integration tests headscale containers

This commit is contained in:
Juan Font Alonso 2022-07-31 10:37:49 +02:00
parent f9c4d577e2
commit 0f3dc9de4e
3 changed files with 18 additions and 0 deletions

View file

@ -9,6 +9,7 @@ import (
"log"
"net/http"
"os"
"runtime"
"testing"
"time"
@ -49,9 +50,13 @@ func (s *IntegrationCLITestSuite) SetupTest() {
s.FailNow(fmt.Sprintf("Could not create network: %s", err), "")
}
platform := fmt.Sprintf("%s/%s", runtime.GOOS, runtime.GOARCH)
headscaleBuildOptions := &dockertest.BuildOptions{
Dockerfile: "Dockerfile",
ContextDir: ".",
Platform: platform,
Version: "2",
}
currentPath, err := os.Getwd()
@ -66,6 +71,7 @@ func (s *IntegrationCLITestSuite) SetupTest() {
},
Networks: []*dockertest.Network{&s.network},
Cmd: []string{"headscale", "serve"},
Platform: platform,
}
err = s.pool.RemoveContainerByName(headscaleHostname)

View file

@ -13,6 +13,7 @@ import (
"net/http"
"os"
"path"
"runtime"
"strings"
"sync"
"testing"
@ -103,9 +104,13 @@ func (s *IntegrationDERPTestSuite) SetupSuite() {
}
}
platform := fmt.Sprintf("%s/%s", runtime.GOOS, runtime.GOARCH)
headscaleBuildOptions := &dockertest.BuildOptions{
Dockerfile: "Dockerfile",
ContextDir: ".",
Platform: platform,
Version: "2",
}
currentPath, err := os.Getwd()
@ -127,6 +132,7 @@ func (s *IntegrationDERPTestSuite) SetupSuite() {
"8443/tcp": {{HostPort: "8443"}},
"3478/udp": {{HostPort: "3478"}},
},
Platform: platform,
}
err = s.pool.RemoveContainerByName(headscaleHostname)

View file

@ -14,6 +14,7 @@ import (
"net/http"
"os"
"path"
"runtime"
"strings"
"sync"
"testing"
@ -227,9 +228,13 @@ func (s *IntegrationTestSuite) SetupSuite() {
s.FailNow(fmt.Sprintf("Could not create network: %s", err), "")
}
platform := fmt.Sprintf("%s/%s", runtime.GOOS, runtime.GOARCH)
headscaleBuildOptions := &dockertest.BuildOptions{
Dockerfile: "Dockerfile",
ContextDir: ".",
Platform: platform,
Version: "2",
}
currentPath, err := os.Getwd()
@ -244,6 +249,7 @@ func (s *IntegrationTestSuite) SetupSuite() {
},
Networks: []*dockertest.Network{&s.network},
Cmd: []string{"headscale", "serve"},
Platform: platform,
}
err = s.pool.RemoveContainerByName(headscaleHostname)