VAULT-14847 Skip cetain tests on ARM (#20990)

This commit is contained in:
Violet Hynes
2023-06-05 14:02:39 -04:00
committed by GitHub
parent da5d0ca498
commit 9163a237c1
11 changed files with 74 additions and 0 deletions

View File

@@ -8,6 +8,7 @@ import (
"fmt"
"os"
"reflect"
"runtime"
"strconv"
"strings"
"testing"
@@ -30,6 +31,10 @@ const (
)
func prepareRadiusTestContainer(t *testing.T) (func(), string, int) {
if strings.Contains(runtime.GOARCH, "arm") {
t.Skip("Skipping, as this image is not supported on ARM architectures")
}
if os.Getenv(envRadiusRadiusHost) != "" {
port, _ := strconv.Atoi(os.Getenv(envRadiusPort))
return func() {}, os.Getenv(envRadiusRadiusHost), port

View File

@@ -8,6 +8,7 @@ import (
"fmt"
"os"
"reflect"
"runtime"
"strings"
"testing"
"time"
@@ -38,6 +39,11 @@ func (c *Config) Client() (*nomadapi.Client, error) {
}
func prepareTestContainer(t *testing.T, bootstrap bool) (func(), *Config) {
// Skipping on ARM, as this image can't run on ARM architecture
if strings.Contains(runtime.GOARCH, "arm") {
t.Skip("Skipping, as this image is not supported on ARM architectures")
}
if retAddress := os.Getenv("NOMAD_ADDR"); retAddress != "" {
s, err := docker.NewServiceURLParse(retAddress)
if err != nil {

View File

@@ -9,6 +9,8 @@ import (
"net"
"os"
"path/filepath"
"runtime"
"strings"
"testing"
"time"
@@ -80,6 +82,12 @@ func (h Host) ConnectionURL() string {
func PrepareTestContainer(t *testing.T, opts ...ContainerOpt) (Host, func()) {
t.Helper()
// Skipping on ARM, as this image can't run on ARM architecture
if strings.Contains(runtime.GOARCH, "arm") {
t.Skip("Skipping, as this image is not supported on ARM architectures")
}
if os.Getenv("CASSANDRA_HOSTS") != "" {
host, port, err := net.SplitHostPort(os.Getenv("CASSANDRA_HOSTS"))
if err != nil {

View File

@@ -6,6 +6,8 @@ package ldap
import (
"context"
"fmt"
"runtime"
"strings"
"testing"
hclog "github.com/hashicorp/go-hclog"
@@ -14,6 +16,11 @@ import (
)
func PrepareTestContainer(t *testing.T, version string) (cleanup func(), cfg *ldaputil.ConfigEntry) {
// Skipping on ARM, as this image can't run on ARM architecture
if strings.Contains(runtime.GOARCH, "arm") {
t.Skip("Skipping, as this image is not supported on ARM architectures")
}
runner, err := docker.NewServiceRunner(docker.RunOptions{
// Currently set to "michelvocks" until https://github.com/rroemhild/docker-test-openldap/pull/14
// has been merged.

View File

@@ -9,6 +9,8 @@ import (
"fmt"
"net/url"
"os"
"runtime"
"strings"
"testing"
"github.com/hashicorp/vault/sdk/helper/docker"
@@ -22,6 +24,10 @@ const mssqlPassword = "yourStrong(!)Password"
const numRetries = 3
func PrepareMSSQLTestContainer(t *testing.T) (cleanup func(), retURL string) {
if strings.Contains(runtime.GOARCH, "arm") {
t.Skip("Skipping, as this image is not supported on ARM architectures")
}
if os.Getenv("MSSQL_URL") != "" {
return func() {}, os.Getenv("MSSQL_URL")
}

View File

@@ -8,6 +8,7 @@ import (
"database/sql"
"fmt"
"os"
"runtime"
"strings"
"testing"
@@ -26,6 +27,12 @@ func PrepareTestContainer(t *testing.T, legacy bool, pw string) (func(), string)
return func() {}, os.Getenv("MYSQL_URL")
}
// ARM64 is only supported on MySQL 8.0 and above. If we update
// our image and support to 8.0, we can unskip these tests.
if strings.Contains(runtime.GOARCH, "arm") {
t.Skip("Skipping, as MySQL 5.7 is not supported on ARM architectures")
}
imageVersion := "5.7"
if legacy {
imageVersion = "5.6"

View File

@@ -6,6 +6,8 @@ package aerospike
import (
"context"
"math/bits"
"runtime"
"strings"
"testing"
"time"
@@ -47,6 +49,11 @@ type aerospikeConfig struct {
}
func prepareAerospikeContainer(t *testing.T) (func(), *aerospikeConfig) {
// Skipping on ARM, as this image can't run on ARM architecture
if strings.Contains(runtime.GOARCH, "arm") {
t.Skip("Skipping, as this image is not supported on ARM architectures")
}
runner, err := docker.NewServiceRunner(docker.RunOptions{
ImageRepo: "docker.mirror.hashicorp.services/aerospike/aerospike-server",
ContainerName: "aerospikedb",

View File

@@ -9,6 +9,8 @@ import (
"fmt"
"net/url"
"os"
"runtime"
"strings"
"testing"
log "github.com/hashicorp/go-hclog"
@@ -26,6 +28,11 @@ type Config struct {
var _ docker.ServiceConfig = &Config{}
func prepareCockroachDBTestContainer(t *testing.T) (func(), *Config) {
// Skipping, as this image can't run on arm architecture
if strings.Contains(runtime.GOARCH, "arm") {
t.Skip("Skipping, as CockroachDB 1.0 is not supported on ARM architectures")
}
if retURL := os.Getenv("CR_URL"); retURL != "" {
s, err := docker.NewServiceURLParse(retURL)
if err != nil {

View File

@@ -10,6 +10,7 @@ import (
"net/http"
"net/url"
"os"
"runtime"
"strings"
"testing"
"time"
@@ -78,6 +79,13 @@ func (c couchDB) URL() *url.URL {
var _ docker.ServiceConfig = &couchDB{}
func prepareCouchdbDBTestContainer(t *testing.T) (func(), *couchDB) {
// ARM64 is only supported on CouchDB 2 and above. If we update
// our image and support to 2 and above, we can unskip these:
// https://hub.docker.com/r/arm64v8/couchdb/
if strings.Contains(runtime.GOARCH, "arm") {
t.Skip("Skipping, as CouchDB 1.6 is not supported on ARM architectures")
}
// If environment variable is set, assume caller wants to target a real
// DynamoDB.
if os.Getenv("COUCHDB_ENDPOINT") != "" {

View File

@@ -10,6 +10,8 @@ import (
"net/http"
"net/url"
"os"
"runtime"
"strings"
"testing"
"time"
@@ -373,6 +375,11 @@ type Config struct {
var _ docker.ServiceConfig = &Config{}
func prepareDynamoDBTestContainer(t *testing.T) (func(), *Config) {
// Skipping on ARM, as this image can't run on ARM architecture
if strings.Contains(runtime.GOARCH, "arm") {
t.Skip("Skipping, as this image is not supported on ARM architectures")
}
// If environment variable is set, assume caller wants to target a real
// DynamoDB.
if endpoint := os.Getenv("AWS_DYNAMODB_ENDPOINT"); endpoint != "" {

View File

@@ -9,6 +9,7 @@ import (
"net/url"
"os"
"reflect"
"runtime"
"strconv"
"strings"
"testing"
@@ -51,6 +52,11 @@ func (c *Config) connectionParams() map[string]interface{} {
}
func prepareInfluxdbTestContainer(t *testing.T) (func(), *Config) {
// Skipping on ARM, as this image can't run on ARM architecture
if strings.Contains(runtime.GOARCH, "arm") {
t.Skip("Skipping, as this image is not supported on ARM architectures")
}
c := &Config{
Username: "influx-root",
Password: "influx-root",