Skip to content

Commit

Permalink
enable nightlies for 1.11 and 1.12 and 1.13 (#1339)
Browse files Browse the repository at this point in the history
* enable nightlies for 1.11 and 1.12 and 1.13
  • Loading branch information
kschoche authored Aug 24, 2022
1 parent 13b5926 commit e0ede3e
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 33 deletions.
41 changes: 22 additions & 19 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,8 @@ jobs:
- TEST_RESULTS: /tmp/test-results
- CONSUL_IMAGE: "docker.mirror.hashicorp.services/hashicorppreview/consul-enterprise:1.11-dev"
- ENVOY_IMAGE: "envoyproxy/envoy:v1.20.2"
- CONSUL_K8S_IMAGE: "docker.mirror.hashicorp.services/hashicorp/consul-k8s-control-plane:0.45.0"
- CONSUL_K8S_IMAGE: "docker.mirror.hashicorp.services/hashicorp/consul-k8s-control-plane:0.47.1"
- HELM_CHART_VERSION: "0.47.1"
machine:
image: ubuntu-2004:202010-01
resource_class: xlarge
Expand All @@ -902,21 +903,22 @@ jobs:
- ~/.go_workspace/pkg/mod
- run: mkdir -p $TEST_RESULTS
- run-acceptance-tests:
additional-flags: -use-kind -kubecontext="kind-dc1" -secondary-kubecontext="kind-dc2" -enable-transparent-proxy -consul-k8s-image=$CONSUL_K8S_IMAGE -consul-image=$CONSUL_IMAGE -consul-version="1.11" -envoy-image=$ENVOY_IMAGE
additional-flags: -use-kind -kubecontext="kind-dc1" -secondary-kubecontext="kind-dc2" -enable-transparent-proxy -consul-k8s-image=$CONSUL_K8S_IMAGE -consul-image=$CONSUL_IMAGE -consul-version="1.11" -envoy-image=$ENVOY_IMAGE -helm-chart-version=$HELM_CHART_VERSION
- store_test_results:
path: /tmp/test-results
- store_artifacts:
path: /tmp/test-results
- slack/status:
fail_only: true
failure_message: "Acceptance tests against Kind with Kubernetes v1.23 with Consul 1.11.x nightly failed. Check the logs at: ${CIRCLE_BUILD_URL}"
failure_message: "Acceptance tests against Kind with Kubernetes v1.23 with Consul 1.11 nightly failed. Check the logs at: ${CIRCLE_BUILD_URL}"

acceptance-kind-1-23-consul-nightly-1-12:
environment:
- TEST_RESULTS: /tmp/test-results
- CONSUL_IMAGE: "docker.mirror.hashicorp.services/hashicorppreview/consul-enterprise:1.12-dev"
- ENVOY_IMAGE: "envoyproxy/envoy:v1.22.2"
- CONSUL_K8S_IMAGE: "docker.mirror.hashicorp.services/hashicorp/consul-k8s-control-plane:0.45.0"
- HELM_CHART_VERSION: "0.47.1"
- CONSUL_K8S_IMAGE: "docker.mirror.hashicorp.services/hashicorp/consul-k8s-control-plane:0.47.1"
machine:
image: ubuntu-2004:202010-01
resource_class: xlarge
Expand All @@ -938,7 +940,7 @@ jobs:
- ~/.go_workspace/pkg/mod
- run: mkdir -p $TEST_RESULTS
- run-acceptance-tests:
additional-flags: -use-kind -kubecontext="kind-dc1" -secondary-kubecontext="kind-dc2" -enable-transparent-proxy -consul-k8s-image=$CONSUL_K8S_IMAGE -consul-image=$CONSUL_IMAGE -consul-version="1.12" -envoy-image=$ENVOY_IMAGE
additional-flags: -use-kind -kubecontext="kind-dc1" -secondary-kubecontext="kind-dc2" -enable-transparent-proxy -consul-k8s-image=$CONSUL_K8S_IMAGE -consul-image=$CONSUL_IMAGE -consul-version="1.12" -envoy-image=$ENVOY_IMAGE -helm-chart-version=$HELM_CHART_VERSION
- store_test_results:
path: /tmp/test-results
- store_artifacts:
Expand All @@ -952,7 +954,8 @@ jobs:
- TEST_RESULTS: /tmp/test-results
- CONSUL_IMAGE: "docker.mirror.hashicorp.services/hashicorppreview/consul-enterprise:1.13-dev"
- ENVOY_IMAGE: "envoyproxy/envoy:v1.22.2"
- CONSUL_K8S_IMAGE: "docker.mirror.hashicorp.services/hashicorp/consul-k8s-control-plane:0.45.0"
- CONSUL_K8S_IMAGE: "docker.mirror.hashicorp.services/hashicorp/consul-k8s-control-plane:0.47.1"
- HELM_CHART_VERSION: "0.47.1"
machine:
image: ubuntu-2004:202010-01
resource_class: xlarge
Expand All @@ -974,7 +977,7 @@ jobs:
- ~/.go_workspace/pkg/mod
- run: mkdir -p $TEST_RESULTS
- run-acceptance-tests:
additional-flags: -use-kind -kubecontext="kind-dc1" -secondary-kubecontext="kind-dc2" -enable-transparent-proxy -consul-k8s-image=$CONSUL_K8S_IMAGE -consul-image=$CONSUL_IMAGE -consul-version="1.13" -envoy-image=$ENVOY_IMAGE
additional-flags: -use-kind -kubecontext="kind-dc1" -secondary-kubecontext="kind-dc2" -enable-transparent-proxy -consul-k8s-image=$CONSUL_K8S_IMAGE -consul-image=$CONSUL_IMAGE -consul-version="1.13" -envoy-image=$ENVOY_IMAGE -helm-chart-version=$HELM_CHART_VERSION
- store_test_results:
path: /tmp/test-results
- store_artifacts:
Expand Down Expand Up @@ -1047,15 +1050,15 @@ workflows:
requires:
- dev-upload-docker

# nightly-acceptance-tests-consul:
# triggers:
# - schedule:
# cron: "0 0 * * *"
# filters:
# branches:
# only:
# - main
# jobs:
# - acceptance-kind-1-23-consul-nightly-1-11
# - acceptance-kind-1-23-consul-nightly-1-12
# - acceptance-kind-1-23-consul-nightly-1-13
nightly-acceptance-tests-consul:
triggers:
- schedule:
cron: "0 0 * * *"
filters:
branches:
only:
- main
jobs:
- acceptance-kind-1-23-consul-nightly-1-11
- acceptance-kind-1-23-consul-nightly-1-12
- acceptance-kind-1-23-consul-nightly-1-13
9 changes: 5 additions & 4 deletions acceptance/framework/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,11 @@ type TestConfig struct {

DisablePeering bool

ConsulImage string
ConsulK8SImage string
ConsulVersion *version.Version
EnvoyImage string
HelmChartVersion string
ConsulImage string
ConsulK8SImage string
ConsulVersion *version.Version
EnvoyImage string

NoCleanupOnFailure bool
DebugDirectory string
Expand Down
13 changes: 11 additions & 2 deletions acceptance/framework/consul/helm_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ func NewHelmCluster(
KubectlOptions: ctx.KubectlOptions(t),
Logger: logger,
ExtraArgs: extraArgs,
Version: cfg.HelmChartVersion,
}
return &HelmCluster{
ctx: ctx,
Expand All @@ -110,7 +111,11 @@ func (h *HelmCluster) Create(t *testing.T) {
// Fail if there are any existing installations of the Helm chart.
helpers.CheckForPriorInstallations(t, h.kubernetesClient, h.helmOptions, "consul-helm", "chart=consul-helm")

helm.Install(t, h.helmOptions, config.HelmChartPath, h.releaseName)
chartName := "hashicorp/consul"
if h.helmOptions.Version == config.HelmChartPath {
chartName = config.HelmChartPath
}
helm.Install(t, h.helmOptions, chartName, h.releaseName)

k8s.WaitForAllPodsToBeReady(t, h.kubernetesClient, h.helmOptions.KubectlOptions.Namespace, fmt.Sprintf("release=%s", h.releaseName))
}
Expand Down Expand Up @@ -271,7 +276,11 @@ func (h *HelmCluster) Upgrade(t *testing.T, helmValues map[string]string) {
t.Helper()

helpers.MergeMaps(h.helmOptions.SetValues, helmValues)
helm.Upgrade(t, h.helmOptions, config.HelmChartPath, h.releaseName)
chartName := "hashicorp/consul"
if h.helmOptions.Version == config.HelmChartPath {
chartName = config.HelmChartPath
}
helm.Upgrade(t, h.helmOptions, chartName, h.releaseName)
k8s.WaitForAllPodsToBeReady(t, h.kubernetesClient, h.helmOptions.KubectlOptions.Namespace, fmt.Sprintf("release=%s", h.releaseName))
}

Expand Down
19 changes: 11 additions & 8 deletions acceptance/framework/flags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ type TestFlags struct {

flagEnableTransparentProxy bool

flagConsulImage string
flagConsulK8sImage string
flagConsulVersion string
flagEnvoyImage string
flagHelmChartVersion string
flagConsulImage string
flagConsulK8sImage string
flagConsulVersion string
flagEnvoyImage string

flagNoCleanupOnFailure bool

Expand Down Expand Up @@ -62,6 +63,7 @@ func (t *TestFlags) init() {
flag.StringVar(&t.flagConsulImage, "consul-image", "", "The Consul image to use for all tests.")
flag.StringVar(&t.flagConsulK8sImage, "consul-k8s-image", "", "The consul-k8s image to use for all tests.")
flag.StringVar(&t.flagConsulVersion, "consul-version", "", "The consul version used for all tests.")
flag.StringVar(&t.flagHelmChartVersion, "helm-chart-version", config.HelmChartPath, "The helm chart used for all tests.")
flag.StringVar(&t.flagEnvoyImage, "envoy-image", "", "The Envoy image to use for all tests.")

flag.BoolVar(&t.flagEnableMultiCluster, "enable-multi-cluster", false,
Expand Down Expand Up @@ -146,10 +148,11 @@ func (t *TestFlags) TestConfigFromFlags() *config.TestConfig {

DisablePeering: t.flagDisablePeering,

ConsulImage: t.flagConsulImage,
ConsulK8SImage: t.flagConsulK8sImage,
ConsulVersion: consulVersion,
EnvoyImage: t.flagEnvoyImage,
HelmChartVersion: t.flagHelmChartVersion,
ConsulImage: t.flagConsulImage,
ConsulK8SImage: t.flagConsulK8sImage,
ConsulVersion: consulVersion,
EnvoyImage: t.flagEnvoyImage,

NoCleanupOnFailure: t.flagNoCleanupOnFailure,
DebugDirectory: tempDir,
Expand Down
7 changes: 7 additions & 0 deletions acceptance/tests/snapshot-agent/snapshot_agent_vault_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"github.com/hashicorp/consul-k8s/acceptance/framework/logger"
"github.com/hashicorp/consul-k8s/acceptance/framework/vault"
"github.com/hashicorp/go-uuid"
"github.com/hashicorp/go-version"
"github.com/stretchr/testify/require"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
Expand All @@ -31,6 +32,12 @@ func TestSnapshotAgent_Vault(t *testing.T) {
kubectlOptions := ctx.KubectlOptions(t)
ns := kubectlOptions.Namespace

ver, err := version.NewVersion("1.12.0")
require.NoError(t, err)
if cfg.ConsulVersion != nil && cfg.ConsulVersion.LessThan(ver) {
t.Skipf("skipping this test because vault secrets backend is not supported in version %v", cfg.ConsulVersion.String())
}

consulReleaseName := helpers.RandomName()
vaultReleaseName := helpers.RandomName()

Expand Down

0 comments on commit e0ede3e

Please sign in to comment.