Skip to content

Commit 4a5a050

Browse files
tests/e2e: Added E2E infra tests.
1 parent 9b676c8 commit 4a5a050

File tree

23 files changed

+3446
-406
lines changed

23 files changed

+3446
-406
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,8 @@ jobs:
204204
go-version: 1.22
205205

206206
- name: Run E2E Test
207+
env:
208+
isNightly: false
207209
run: make test/e2e/single-region
208210

209211
- name: Clean up Docker resources
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: integration-tests
2+
3+
on:
4+
# Run integration tests nightly.
5+
schedule:
6+
- cron: "0 0 * * *"
7+
# Or trigger on demand.
8+
workflow_dispatch:
9+
10+
jobs:
11+
integration-tests:
12+
runs-on: ubuntu-latest-x64-8-core
13+
permissions:
14+
contents: 'read'
15+
id-token: 'write'
16+
steps:
17+
- uses: bazel-contrib/[email protected]
18+
with:
19+
bazelisk-cache: true
20+
disk-cache: ${{ github.workflow }}
21+
repository-cache: true
22+
- uses: actions/checkout@v4
23+
- name: Setup Go ${{ matrix.go-version }}
24+
uses: actions/setup-go@v5
25+
with:
26+
go-version: 1.23
27+
- name: Set up gcloud CLI
28+
uses: google-github-actions/setup-gcloud@v2
29+
- name: Authenticate to Google Cloud
30+
uses: 'google-github-actions/auth@v2'
31+
id: auth
32+
with:
33+
token_format: access_token
34+
project_id: 'cockroach-nishanth'
35+
workload_identity_provider: 'projects/893592977954/locations/global/workloadIdentityPools/github-actions/providers/github-actions-provider'
36+
service_account: '[email protected]'
37+
- name: Run tests
38+
env:
39+
isNightly: true
40+
run: make test/nightly-e2e/singleRegion

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,9 @@ test/single-cluster/up: bin/k3d
139139
test/multi-cluster/down: bin/k3d
140140
./tests/k3d/dev-multi-cluster.sh down --name "$(K3D_CLUSTER)" --nodes $(MULTI_REGION_NODE_SIZE) --clusters $(REGIONS)
141141

142+
test/nightly-e2e/single-region: bin/cockroach bin/kubectl bin/helm build/self-signer
143+
@PATH="$(PWD)/bin:${PATH}" go test -timeout 60m -v -test.run TestOperatorInSingleRegion ./tests/e2e/operator/singleRegion/... || EXIT_CODE=$$?; \
144+
142145
test/lint: bin/helm ## lint the helm chart
143146
@build/lint.sh && \
144147
bin/helm lint cockroachdb && \

build/templates/values.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -862,15 +862,15 @@ operator:
862862

863863
# Regions controls the number of CockroachDB nodes that are deployed per region.
864864
regions:
865-
# Code corresponds to the cloud provider's identifier of this region (e.g.
865+
# Code corresponds to the cloud infra's identifier of this region (e.g.
866866
# "us-east-1" for AWS, "us-east1" for GCP). This value is used to detect
867867
# which CrdbClusterRegion will be reconciled and must match the
868868
# "topology.kubernetes.io/region" label on Kubernetes Nodes in this
869869
# cluster.
870870
- code: us-east-1
871871
# Nodes is the number of CRDB nodes that are in the region.
872872
nodes: 3
873-
# CloudProvider sets the cloud provider for this region.
873+
# CloudProvider sets the cloud infra for this region.
874874
cloudProvider: k3d
875875
# Namespace is the name of the Kubernetes namespace that this
876876
# CrdbClusterRegion is deployed within. It is used to compute the --join

cmd/migrate/cockroachdb-enterprise-operator/root.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ func Execute() {
4040
}
4141

4242
func init() {
43-
buildManifestCmd.PersistentFlags().StringVar(&cloudProvider, "cloud-provider", "", "name of cloud provider")
44-
buildManifestCmd.PersistentFlags().StringVar(&cloudRegion, "cloud-region", "", "name of cloud provider region")
43+
buildManifestCmd.PersistentFlags().StringVar(&cloudProvider, "cloud-infra", "", "name of cloud infra")
44+
buildManifestCmd.PersistentFlags().StringVar(&cloudRegion, "cloud-region", "", "name of cloud infra region")
4545
buildManifestCmd.PersistentFlags().StringVar(&kubeconfig, "kubeconfig", filepath.Join(homedir.HomeDir(), ".kube", "config"), "path to kubeconfig file")
4646
buildManifestCmd.PersistentFlags().StringVar(&outputDir, "output-dir", "./manifests", "manifest output directory")
47-
_ = buildManifestCmd.MarkPersistentFlagRequired("cloud-provider")
47+
_ = buildManifestCmd.MarkPersistentFlagRequired("cloud-infra")
4848
_ = buildManifestCmd.MarkPersistentFlagRequired("cloud-region")
4949
rootCmd.AddCommand(buildManifestCmd)
5050
rootCmd.AddCommand(migrateCertsCmd)

cockroachdb/values.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -863,15 +863,15 @@ operator:
863863

864864
# Regions controls the number of CockroachDB nodes that are deployed per region.
865865
regions:
866-
# Code corresponds to the cloud provider's identifier of this region (e.g.
866+
# Code corresponds to the cloud infra's identifier of this region (e.g.
867867
# "us-east-1" for AWS, "us-east1" for GCP). This value is used to detect
868868
# which CrdbClusterRegion will be reconciled and must match the
869869
# "topology.kubernetes.io/region" label on Kubernetes Nodes in this
870870
# cluster.
871871
- code: us-east-1
872872
# Nodes is the number of CRDB nodes that are in the region.
873873
nodes: 3
874-
# CloudProvider sets the cloud provider for this region.
874+
# CloudProvider sets the cloud infra for this region.
875875
cloudProvider: k3d
876876
# Namespace is the name of the Kubernetes namespace that this
877877
# CrdbClusterRegion is deployed within. It is used to compute the --join

go.mod

Lines changed: 44 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,24 @@
11
module github.com/cockroachdb/helm-charts
22

3-
go 1.22.3
3+
go 1.23.0
44

5-
toolchain go1.23.7
5+
toolchain go1.24.1
66

77
require (
8+
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.18.0
9+
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.10.0
10+
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v4 v4.8.0
11+
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4 v4.3.0
12+
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0
813
github.com/Masterminds/semver/v3 v3.2.1
14+
github.com/aws/aws-sdk-go-v2 v1.36.3
15+
github.com/aws/aws-sdk-go-v2/config v1.29.14
16+
github.com/aws/aws-sdk-go-v2/service/ec2 v1.224.0
17+
github.com/aws/aws-sdk-go-v2/service/eks v1.64.0
18+
github.com/aws/aws-sdk-go-v2/service/iam v1.36.0
919
github.com/cenkalti/backoff v2.2.1+incompatible
1020
github.com/cockroachdb/cockroach-operator v0.0.0-20250205123916-58abbe6772fc
1121
github.com/cockroachdb/errors v1.8.0
12-
github.com/dgraph-io/badger v1.6.0
1322
github.com/google/martian v2.1.1-0.20190517191504-25dcb96d9e51+incompatible
1423
github.com/gruntwork-io/terratest v0.41.26
1524
github.com/mitchellh/hashstructure/v2 v2.0.2
@@ -18,7 +27,8 @@ require (
1827
github.com/robfig/cron v1.2.0
1928
github.com/sirupsen/logrus v1.8.1
2029
github.com/spf13/cobra v1.2.1
21-
github.com/stretchr/testify v1.8.1
30+
github.com/stretchr/testify v1.10.0
31+
google.golang.org/api v0.103.0
2232
google.golang.org/protobuf v1.36.3
2333
gopkg.in/yaml.v3 v3.0.1
2434
k8s.io/api v0.22.3
@@ -33,25 +43,35 @@ require (
3343
cloud.google.com/go/compute v1.12.1 // indirect
3444
cloud.google.com/go/compute/metadata v0.2.1 // indirect
3545
emperror.dev/errors v0.8.0 // indirect
36-
github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9 // indirect
46+
github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.1 // indirect
3747
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
3848
github.com/Azure/go-autorest/autorest v0.11.20 // indirect
3949
github.com/Azure/go-autorest/autorest/adal v0.9.13 // indirect
4050
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
4151
github.com/Azure/go-autorest/logger v0.2.1 // indirect
4252
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
53+
github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2 // indirect
4354
github.com/aws/aws-sdk-go v1.44.122 // indirect
55+
github.com/aws/aws-sdk-go-v2/credentials v1.17.67 // indirect
56+
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.30 // indirect
57+
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.34 // indirect
58+
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.34 // indirect
59+
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3 // indirect
60+
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.3 // indirect
61+
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.15 // indirect
62+
github.com/aws/aws-sdk-go-v2/service/sso v1.25.3 // indirect
63+
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.30.1 // indirect
64+
github.com/aws/aws-sdk-go-v2/service/sts v1.33.19 // indirect
65+
github.com/aws/smithy-go v1.22.2 // indirect
4466
github.com/banzaicloud/k8s-objectmatcher v1.8.0 // indirect
4567
github.com/beorn7/perks v1.0.1 // indirect
4668
github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc // indirect
47-
github.com/cespare/xxhash/v2 v2.1.1 // indirect
69+
github.com/cespare/xxhash/v2 v2.3.0 // indirect
4870
github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f // indirect
4971
github.com/cockroachdb/redact v1.0.6 // indirect
5072
github.com/cockroachdb/sentry-go v0.6.1-cockroachdb.2 // indirect
5173
github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect
5274
github.com/davecgh/go-spew v1.1.1 // indirect
53-
github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 // indirect
54-
github.com/dustin/go-humanize v1.0.0 // indirect
5575
github.com/evanphx/json-patch v4.11.0+incompatible // indirect
5676
github.com/form3tech-oss/jwt-go v3.2.3+incompatible // indirect
5777
github.com/fsnotify/fsnotify v1.4.9 // indirect
@@ -60,11 +80,14 @@ require (
6080
github.com/go-logr/logr v0.4.0 // indirect
6181
github.com/go-sql-driver/mysql v1.5.0 // indirect
6282
github.com/gogo/protobuf v1.3.2 // indirect
83+
github.com/golang-jwt/jwt/v5 v5.2.2 // indirect
6384
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
6485
github.com/golang/protobuf v1.5.2 // indirect
6586
github.com/google/go-cmp v0.6.0 // indirect
6687
github.com/google/gofuzz v1.1.0 // indirect
67-
github.com/google/uuid v1.3.0 // indirect
88+
github.com/google/uuid v1.6.0 // indirect
89+
github.com/googleapis/enterprise-certificate-proxy v0.2.0 // indirect
90+
github.com/googleapis/gax-go/v2 v2.7.0 // indirect
6891
github.com/googleapis/gnostic v0.5.5 // indirect
6992
github.com/gosimple/slug v1.9.0 // indirect
7093
github.com/gruntwork-io/go-commons v0.8.0 // indirect
@@ -82,38 +105,42 @@ require (
82105
github.com/jackc/pgx/v4 v4.18.2 // indirect
83106
github.com/jmespath/go-jmespath v0.4.0 // indirect
84107
github.com/json-iterator/go v1.1.12 // indirect
85-
github.com/kr/pretty v0.3.0 // indirect
108+
github.com/kr/pretty v0.3.1 // indirect
86109
github.com/kr/text v0.2.0 // indirect
110+
github.com/kylelemons/godebug v1.1.0 // indirect
87111
github.com/mattn/go-zglob v0.0.2-0.20190814121620-e3c945676326 // indirect
88112
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
89113
github.com/mitchellh/go-homedir v1.1.0 // indirect
90114
github.com/moby/spdystream v0.2.0 // indirect
91115
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
92116
github.com/modern-go/reflect2 v1.0.2 // indirect
117+
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
93118
github.com/pmezard/go-difflib v1.0.0 // indirect
94119
github.com/pquerna/otp v1.2.0 // indirect
95120
github.com/prometheus/client_golang v1.11.1 // indirect
96121
github.com/prometheus/client_model v0.2.0 // indirect
97122
github.com/prometheus/common v0.26.0 // indirect
98123
github.com/prometheus/procfs v0.6.0 // indirect
99124
github.com/rainycape/unidecode v0.0.0-20150907023854-cb7f23ec59be // indirect
100-
github.com/rogpeppe/go-internal v1.6.1 // indirect
125+
github.com/rogpeppe/go-internal v1.12.0 // indirect
101126
github.com/russross/blackfriday/v2 v2.1.0 // indirect
102127
github.com/spf13/pflag v1.0.5 // indirect
103128
github.com/urfave/cli v1.22.2 // indirect
129+
go.opencensus.io v0.24.0 // indirect
104130
go.uber.org/atomic v1.7.0 // indirect
105131
go.uber.org/multierr v1.6.0 // indirect
106132
go.uber.org/zap v1.17.0 // indirect
107-
golang.org/x/crypto v0.32.0 // indirect
108-
golang.org/x/net v0.34.0 // indirect
133+
golang.org/x/crypto v0.38.0 // indirect
134+
golang.org/x/net v0.40.0 // indirect
109135
golang.org/x/oauth2 v0.1.0 // indirect
110-
golang.org/x/sys v0.29.0 // indirect
111-
golang.org/x/term v0.28.0 // indirect
112-
golang.org/x/text v0.21.0 // indirect
136+
golang.org/x/sys v0.33.0 // indirect
137+
golang.org/x/term v0.32.0 // indirect
138+
golang.org/x/text v0.25.0 // indirect
113139
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
114140
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
115141
google.golang.org/appengine v1.6.7 // indirect
116-
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
142+
google.golang.org/genproto v0.0.0-20221201164419-0e50fba7f41c // indirect
143+
google.golang.org/grpc v1.51.0 // indirect
117144
gopkg.in/inf.v0 v0.9.1 // indirect
118145
gopkg.in/yaml.v2 v2.4.0 // indirect
119146
k8s.io/component-base v0.22.3 // indirect

0 commit comments

Comments
 (0)