diff --git a/.dockerignore b/.dockerignore index 7e6fd07a0..a18521741 100644 --- a/.dockerignore +++ b/.dockerignore @@ -8,7 +8,7 @@ vendor/ pkg/client/ docker/mongodb-kubernetes-tests -scripts/ +# scripts/ samples/ .multi_cluster_local_test_files/ diff --git a/.evergreen-functions.yml b/.evergreen-functions.yml index c004dd098..fe93a2987 100644 --- a/.evergreen-functions.yml +++ b/.evergreen-functions.yml @@ -659,12 +659,9 @@ functions: params: shell: bash working_dir: src/github.com/mongodb/mongodb-kubernetes - script: | - source .generated/context.export.env - make test-race - - command: gotest.parse_files - params: - files: [ "src/github.com/mongodb/mongodb-kubernetes/*.suite", "src/github.com/mongodb/mongodb-kubernetes/docker/mongodb-kubernetes-init-ops-manager/mmsconfiguration/*.suite" ] + env: + USE_RACE: "true" + script: scripts/evergreen/unit-tests-golang.sh test_python_unit: - command: shell.exec @@ -672,19 +669,15 @@ functions: params: shell: bash working_dir: src/github.com/mongodb/mongodb-kubernetes - script: | - source .generated/context.export.env - make python-tests + script: scripts/evergreen/unit-tests-python.sh - test_sboms: + test_python_sbom: - command: shell.exec type: test params: shell: bash working_dir: src/github.com/mongodb/mongodb-kubernetes - script: | - source .generated/context.export.env - make sbom-tests + script: scripts/evergreen/unit-tests-sbom.sh generate_perf_tests_tasks: - *switch_context diff --git a/.evergreen.yml b/.evergreen.yml index 209bf152a..02b289a32 100644 --- a/.evergreen.yml +++ b/.evergreen.yml @@ -268,7 +268,7 @@ tasks: # See https://docs.devprod.prod.corp.mongodb.com/evergreen/Project-Configuration/Project-Configuration-Files#limiting-when-a-task-or-variant-will-run patchable: false commands: - - func: "test_sboms" + - func: "test_python_sbom" - name: lint_repo tags: [ "unit_tests" ] @@ -664,6 +664,11 @@ task_groups: - unit_tests_golang - unit_tests_python - sbom_tests + teardown_task: + - command: attach.xunit_results + params: + files: [ "src/github.com/mongodb/mongodb-kubernetes/*-result.xml" ] + - name: gke_code_snippets_task_group <<: *setup_and_teardown_group_gke_code_snippets diff --git a/.gitignore b/.gitignore index ec7ebbab0..77dd2c698 100644 --- a/.gitignore +++ b/.gitignore @@ -56,6 +56,7 @@ bundle .DS_Store cover.out result.suite +*result.xml # loadtesting binary production_notes/cmd/runtest/runtest production_notes/helm_charts/opsmanager/charts/ diff --git a/Makefile b/Makefile index 9c45c1c3b..bab4a2fc7 100644 --- a/Makefile +++ b/Makefile @@ -278,19 +278,18 @@ endif ENVTEST_ASSETS_DIR=$(shell pwd)/testbin golang-tests: - scripts/evergreen/unit-tests.sh + scripts/evergreen/unit-tests-golang.sh golang-tests-race: - USE_RACE=true scripts/evergreen/unit-tests.sh + USE_RACE=true scripts/evergreen/unit-tests-golang.sh sbom-tests: - @ scripts/evergreen/run_python.sh -m pytest generate_ssdlc_report_test.py + scripts/evergreen/unit-tests-sbom.sh # e2e tests are also in python and we will need to ignore them as they are in the docker/mongodb-kubernetes-tests folder # additionally, we have one lib which we want to test which is in the =docker/mongodb-kubernetes-tests folder. python-tests: - @ scripts/evergreen/run_python.sh -m pytest docker/mongodb-kubernetes-tests/kubeobject - @ scripts/evergreen/run_python.sh -m pytest --ignore=docker/mongodb-kubernetes-tests + scripts/evergreen/unit-tests-python.sh generate-ssdlc-report: @ scripts/evergreen/run_python.sh generate_ssdlc_report.py diff --git a/api/v1/mdb/sharded_cluster_validation_test.go b/api/v1/mdb/sharded_cluster_validation_test.go index 6918c4d16..6838e9cce 100644 --- a/api/v1/mdb/sharded_cluster_validation_test.go +++ b/api/v1/mdb/sharded_cluster_validation_test.go @@ -238,6 +238,10 @@ func TestNoIgnoredFieldUsed(t *testing.T) { Spec: corev1.PodSpec{}, }}, } + + // when tests are executed with env set from current context, some kubeconfig validation tests might stop working + t.Setenv(multicluster.KubeConfigPathEnv, "") + tests := []struct { name string isMultiCluster bool diff --git a/controllers/operator/appdbreplicaset_controller_test.go b/controllers/operator/appdbreplicaset_controller_test.go index 8559cf824..57b4d1bed 100644 --- a/controllers/operator/appdbreplicaset_controller_test.go +++ b/controllers/operator/appdbreplicaset_controller_test.go @@ -6,7 +6,6 @@ import ( "fmt" "os" "path/filepath" - "strings" "testing" "time" @@ -54,7 +53,6 @@ func init() { // getReleaseJsonPath searches for a specified target directory by traversing the directory tree backwards from the current working directory func getReleaseJsonPath() (string, error) { - repositoryRootDirName := "mongodb-kubernetes" releaseFileName := "release.json" currentDir, err := os.Getwd() @@ -62,7 +60,7 @@ func getReleaseJsonPath() (string, error) { return "", err } for currentDir != "/" { - if strings.HasSuffix(currentDir, repositoryRootDirName) { + if _, err := os.Stat(filepath.Join(currentDir, releaseFileName)); err == nil { return filepath.Join(currentDir, releaseFileName), nil } currentDir = filepath.Dir(currentDir) diff --git a/docker/mongodb-kubernetes-init-ops-manager/Dockerfile.builder b/docker/mongodb-kubernetes-init-ops-manager/Dockerfile.builder index 62fa29cd7..ce7e43b4d 100644 --- a/docker/mongodb-kubernetes-init-ops-manager/Dockerfile.builder +++ b/docker/mongodb-kubernetes-init-ops-manager/Dockerfile.builder @@ -2,13 +2,16 @@ # Dockerfile for Init Ops Manager Context. # -FROM public.ecr.aws/docker/library/golang:1.24 as builder -WORKDIR /go/src -ADD . . -RUN CGO_ENABLED=0 go build -a -buildvcs=false -o /data/scripts/mmsconfiguration ./mmsconfiguration -RUN CGO_ENABLED=0 go build -a -buildvcs=false -o /data/scripts/backup-daemon-readiness-probe ./backupdaemon_readinessprobe/ +FROM public.ecr.aws/docker/library/golang:1.24 AS builder -COPY scripts/docker-entry-point.sh /data/scripts/ -COPY scripts/backup-daemon-liveness-probe.sh /data/scripts/ +COPY . /build +WORKDIR /build -COPY LICENSE /data/licenses/mongodb-enterprise-ops-manager +RUN mkdir -p /data/scripts /data/licenses + +RUN CGO_ENABLED=0 go build -a -buildvcs=false -o /data/scripts/mmsconfiguration ./docker/mongodb-kubernetes-init-ops-manager/mmsconfiguration +RUN CGO_ENABLED=0 go build -a -buildvcs=false -o /data/scripts/backup-daemon-readiness-probe ./docker/mongodb-kubernetes-init-ops-manager/backupdaemon_readinessprobe + +COPY docker/mongodb-kubernetes-init-ops-manager/scripts/*.sh /data/scripts/ + +COPY docker/mongodb-kubernetes-init-ops-manager/LICENSE /data/licenses/mongodb-enterprise-ops-manager diff --git a/docker/mongodb-kubernetes-init-ops-manager/go.mod b/docker/mongodb-kubernetes-init-ops-manager/go.mod deleted file mode 100644 index 8359c6c20..000000000 --- a/docker/mongodb-kubernetes-init-ops-manager/go.mod +++ /dev/null @@ -1,14 +0,0 @@ -module github.com/mongodb/mongodb-kubernetes/docker/mongodb-kubernetes-init-ops-manager - -go 1.24.0 - -require ( - github.com/stretchr/testify v1.10.0 - golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 -) - -require ( - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect -) diff --git a/docker/mongodb-kubernetes-init-ops-manager/go.sum b/docker/mongodb-kubernetes-init-ops-manager/go.sum deleted file mode 100644 index eea6469fb..000000000 --- a/docker/mongodb-kubernetes-init-ops-manager/go.sum +++ /dev/null @@ -1,12 +0,0 @@ -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= -github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/docker/mongodb-kubernetes-init-ops-manager/scripts/backup-daemon-liveness-probe.sh b/docker/mongodb-kubernetes-init-ops-manager/scripts/backup-daemon-liveness-probe.sh index ea8daa188..b53ca2231 100755 --- a/docker/mongodb-kubernetes-init-ops-manager/scripts/backup-daemon-liveness-probe.sh +++ b/docker/mongodb-kubernetes-init-ops-manager/scripts/backup-daemon-liveness-probe.sh @@ -6,4 +6,4 @@ check_backup_daemon_alive () { pgrep --exact 'mms-app' || pgrep -f '/mongodb-ops-manager/jdk/bin/mms-app' } -check_backup_daemon_alive +check_backup_daemon_alive \ No newline at end of file diff --git a/go.mod b/go.mod index c166d8d9a..f3510b004 100644 --- a/go.mod +++ b/go.mod @@ -48,13 +48,16 @@ require google.golang.org/protobuf v1.36.5 // indirect require ( github.com/beorn7/perks v1.0.1 // indirect + github.com/bitfield/gotestdox v0.2.2 // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect + github.com/dnephin/pflag v1.0.7 // indirect github.com/emicklei/go-restful/v3 v3.11.0 // indirect github.com/evanphx/json-patch v5.9.0+incompatible // indirect github.com/evanphx/json-patch/v5 v5.9.0 // indirect - github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fatih/color v1.18.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/go-jose/go-jose/v4 v4.0.5 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-openapi/jsonpointer v0.19.6 // indirect @@ -67,6 +70,7 @@ require ( github.com/google/gnostic-models v0.6.8 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/google/gofuzz v1.2.0 // indirect + github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect @@ -81,6 +85,8 @@ require ( github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/compress v1.18.0 // indirect github.com/mailru/easyjson v0.7.7 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/moby/spdystream v0.2.0 // indirect @@ -112,14 +118,14 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.yaml.in/yaml/v2 v2.4.2 // indirect golang.org/x/mod v0.25.0 // indirect - golang.org/x/net v0.40.0 // indirect + golang.org/x/net v0.41.0 // indirect golang.org/x/oauth2 v0.29.0 // indirect golang.org/x/sync v0.15.0 // indirect golang.org/x/sys v0.33.0 // indirect golang.org/x/term v0.32.0 // indirect golang.org/x/text v0.26.0 // indirect golang.org/x/time v0.3.0 // indirect - golang.org/x/tools v0.33.0 // indirect + golang.org/x/tools v0.34.0 // indirect gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20230726155614-23370e0ffb3e // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect @@ -127,6 +133,7 @@ require ( gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect + gotest.tools/gotestsum v1.12.3 // indirect k8s.io/apiextensions-apiserver v0.30.1 // indirect k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70 // indirect k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect @@ -135,3 +142,5 @@ require ( ) go 1.24.0 + +tool gotest.tools/gotestsum diff --git a/go.sum b/go.sum index cb2a27f2f..a9167d66f 100644 --- a/go.sum +++ b/go.sum @@ -4,6 +4,8 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkY github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bitfield/gotestdox v0.2.2 h1:x6RcPAbBbErKLnapz1QeAlf3ospg8efBsedU93CDsnE= +github.com/bitfield/gotestdox v0.2.2/go.mod h1:D+gwtS0urjBrzguAkTM2wodsTQYFHdpx8eqRJ3N+9pY= github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= @@ -15,6 +17,8 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dnephin/pflag v1.0.7 h1:oxONGlWxhmUct0YzKTgrpQv9AUA1wtPBn7zuSjJqptk= +github.com/dnephin/pflag v1.0.7/go.mod h1:uxE91IoWURlOiTUIA8Mq5ZZkAv3dPUfZNaT80Zm7OQE= github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/evanphx/json-patch v5.9.0+incompatible h1:fBXyNpNMuTTDdquAq/uisOr2lShz4oaXpDTX2bLe7ls= @@ -22,14 +26,14 @@ github.com/evanphx/json-patch v5.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLi github.com/evanphx/json-patch/v5 v5.9.0 h1:kcBlZQbplgElYIlo/n1hJbls2z/1awpXxpRi0/FOJfg= github.com/evanphx/json-patch/v5 v5.9.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= -github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= +github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= +github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= -github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-jose/go-jose/v4 v4.0.5 h1:M6T8+mKZl/+fNNuFHvGIzDz7BTLQPIounk/b9dw3AaE= @@ -85,6 +89,8 @@ github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= +github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= @@ -146,6 +152,7 @@ github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaO github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= @@ -299,8 +306,8 @@ golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.40.0 h1:79Xs7wF06Gbdcg4kdCCIQArK11Z1hr5POQ6+fIYHNuY= -golang.org/x/net v0.40.0/go.mod h1:y0hY0exeL2Pku80/zKK7tpntoX23cqL3Oa6njdgRtds= +golang.org/x/net v0.41.0 h1:vBTly1HeNPEn3wtREYfy4GZ/NECgw2Cnl+nK6Nz3uvw= +golang.org/x/net v0.41.0/go.mod h1:B/K4NNqkfmg07DQYrbwvSluqCJOOXwUjeb/5lOisjbA= golang.org/x/oauth2 v0.29.0 h1:WdYw2tdTK1S8olAzWHdgeqfy+Mtm9XNhv/xJsY65d98= golang.org/x/oauth2 v0.29.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -324,6 +331,8 @@ golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw= golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -344,8 +353,8 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.33.0 h1:4qz2S3zmRxbGIhDIAgjxvFutSvH5EfnsYrRBj0UI0bc= -golang.org/x/tools v0.33.0/go.mod h1:CIJMaWEY88juyUfo7UbgPqbC8rU2OqfAV1h2Qp0oMYI= +golang.org/x/tools v0.34.0 h1:qIpSLOxeCYGg9TrcJokLBG4KFA6d795g0xkBkiESGlo= +golang.org/x/tools v0.34.0/go.mod h1:pAP9OwEaY1CAW3HOmg3hLZC5Z0CCmzjAF2UQMSqNARg= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -390,6 +399,10 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gotest.tools/gotestsum v1.12.3 h1:jFwenGJ0RnPkuKh2VzAYl1mDOJgbhobBDeL2W1iEycs= +gotest.tools/gotestsum v1.12.3/go.mod h1:Y1+e0Iig4xIRtdmYbEV7K7H6spnjc1fX4BOuUhWw2Wk= +gotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q= +gotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA= k8s.io/api v0.30.10 h1:2YvzRF/BELgCvxbQqFKaan5hnj2+y7JOuqu2WpVk3gg= k8s.io/api v0.30.10/go.mod h1:Hyz3ZuK7jVLJBUFvwzDSGwxHuDdsrGs5RzF16wfHIn4= k8s.io/apiextensions-apiserver v0.30.1 h1:4fAJZ9985BmpJG6PkoxVRpXv9vmPUOVzl614xarePws= diff --git a/inventories/init_om.yaml b/inventories/init_om.yaml index f3d310470..1d7195321 100644 --- a/inventories/init_om.yaml +++ b/inventories/init_om.yaml @@ -5,13 +5,14 @@ vars: images: - name: init-ops-manager vars: - context: docker/mongodb-kubernetes-init-ops-manager + context: . + template_context: docker/mongodb-kubernetes-init-ops-manager platform: linux/amd64 stages: - name: init-ops-manager-build-context task_type: docker_build - dockerfile: Dockerfile.builder + dockerfile: docker/mongodb-kubernetes-init-ops-manager/Dockerfile.builder output: - registry: $(inputs.params.registry)/mongodb-kubernetes-init-ops-manager-context tag: $(inputs.params.version_id) diff --git a/mongodb-community-operator/scripts/dev/e2e.py b/mongodb-community-operator/scripts/dev/e2e.py index d22c99abe..a63e04065 100755 --- a/mongodb-community-operator/scripts/dev/e2e.py +++ b/mongodb-community-operator/scripts/dev/e2e.py @@ -125,7 +125,7 @@ def create_test_pod(args: argparse.Namespace, namespace: str) -> None: "command": [ "sh", "-c", - f"go test -v -timeout=45m -failfast ./mongodb-community-operator/test/e2e/{args.test} | tee -a /tmp/results/result.suite", + f"go test -tags=community_e2e -v -timeout=45m -failfast ./mongodb-community-operator/test/e2e/{args.test} | tee -a /tmp/results/result.suite", ], "volumeMounts": [{"name": "results", "mountPath": "/tmp/results"}], }, diff --git a/mongodb-community-operator/test/e2e/feature_compatibility_version/feature_compatibility_version_test.go b/mongodb-community-operator/test/e2e/feature_compatibility_version/feature_compatibility_version_test.go index e977ca396..fb9e72e06 100644 --- a/mongodb-community-operator/test/e2e/feature_compatibility_version/feature_compatibility_version_test.go +++ b/mongodb-community-operator/test/e2e/feature_compatibility_version/feature_compatibility_version_test.go @@ -1,3 +1,5 @@ +//go:build community_e2e + package feature_compatibility_version import ( diff --git a/mongodb-community-operator/test/e2e/prometheus/prometheus_test.go b/mongodb-community-operator/test/e2e/prometheus/prometheus_test.go index 3b0ba02ff..37d428419 100644 --- a/mongodb-community-operator/test/e2e/prometheus/prometheus_test.go +++ b/mongodb-community-operator/test/e2e/prometheus/prometheus_test.go @@ -1,3 +1,5 @@ +//go:build community_e2e + package prometheus import ( diff --git a/mongodb-community-operator/test/e2e/replica_set/replica_set_test.go b/mongodb-community-operator/test/e2e/replica_set/replica_set_test.go index 1b75589fe..62a8c0a09 100644 --- a/mongodb-community-operator/test/e2e/replica_set/replica_set_test.go +++ b/mongodb-community-operator/test/e2e/replica_set/replica_set_test.go @@ -1,3 +1,5 @@ +//go:build community_e2e + package replica_set import ( diff --git a/mongodb-community-operator/test/e2e/replica_set_arbiter/replica_set_arbiter_test.go b/mongodb-community-operator/test/e2e/replica_set_arbiter/replica_set_arbiter_test.go index 52bbaa487..e45eef2a0 100644 --- a/mongodb-community-operator/test/e2e/replica_set_arbiter/replica_set_arbiter_test.go +++ b/mongodb-community-operator/test/e2e/replica_set_arbiter/replica_set_arbiter_test.go @@ -1,3 +1,5 @@ +//go:build community_e2e + package replica_set import ( diff --git a/mongodb-community-operator/test/e2e/replica_set_authentication/replica_set_authentication_test.go b/mongodb-community-operator/test/e2e/replica_set_authentication/replica_set_authentication_test.go index 757ac10c4..d52a77185 100644 --- a/mongodb-community-operator/test/e2e/replica_set_authentication/replica_set_authentication_test.go +++ b/mongodb-community-operator/test/e2e/replica_set_authentication/replica_set_authentication_test.go @@ -1,3 +1,5 @@ +//go:build community_e2e + package replica_set_authentication import ( diff --git a/mongodb-community-operator/test/e2e/replica_set_change_version/replica_set_change_version_test.go b/mongodb-community-operator/test/e2e/replica_set_change_version/replica_set_change_version_test.go index bf1128f5c..6295f174c 100644 --- a/mongodb-community-operator/test/e2e/replica_set_change_version/replica_set_change_version_test.go +++ b/mongodb-community-operator/test/e2e/replica_set_change_version/replica_set_change_version_test.go @@ -1,3 +1,5 @@ +//go:build community_e2e + package replica_set import ( diff --git a/mongodb-community-operator/test/e2e/replica_set_connection_string_options/replica_set_connection_string_options_test.go b/mongodb-community-operator/test/e2e/replica_set_connection_string_options/replica_set_connection_string_options_test.go index bc895adef..87e102ad2 100644 --- a/mongodb-community-operator/test/e2e/replica_set_connection_string_options/replica_set_connection_string_options_test.go +++ b/mongodb-community-operator/test/e2e/replica_set_connection_string_options/replica_set_connection_string_options_test.go @@ -1,3 +1,5 @@ +//go:build community_e2e + package replica_set_connection_string_options import ( diff --git a/mongodb-community-operator/test/e2e/replica_set_cross_namespace_deploy/replica_set_cross_namespace_deploy_test.go b/mongodb-community-operator/test/e2e/replica_set_cross_namespace_deploy/replica_set_cross_namespace_deploy_test.go index 8fd514f2a..3e1f4c06c 100644 --- a/mongodb-community-operator/test/e2e/replica_set_cross_namespace_deploy/replica_set_cross_namespace_deploy_test.go +++ b/mongodb-community-operator/test/e2e/replica_set_cross_namespace_deploy/replica_set_cross_namespace_deploy_test.go @@ -1,3 +1,5 @@ +//go:build community_e2e + package replica_set_cross_namespace_deploy import ( diff --git a/mongodb-community-operator/test/e2e/replica_set_custom_annotations_test/replica_set_custom_annotations_test.go b/mongodb-community-operator/test/e2e/replica_set_custom_annotations_test/replica_set_custom_annotations_test.go index e19ac6055..2282c31cc 100644 --- a/mongodb-community-operator/test/e2e/replica_set_custom_annotations_test/replica_set_custom_annotations_test.go +++ b/mongodb-community-operator/test/e2e/replica_set_custom_annotations_test/replica_set_custom_annotations_test.go @@ -1,3 +1,5 @@ +//go:build community_e2e + package replica_set_custom_annotations_test import ( diff --git a/mongodb-community-operator/test/e2e/replica_set_custom_persistent_volume/replica_set_custom_persistent_volume_test.go b/mongodb-community-operator/test/e2e/replica_set_custom_persistent_volume/replica_set_custom_persistent_volume_test.go index fc621acc0..1244674db 100644 --- a/mongodb-community-operator/test/e2e/replica_set_custom_persistent_volume/replica_set_custom_persistent_volume_test.go +++ b/mongodb-community-operator/test/e2e/replica_set_custom_persistent_volume/replica_set_custom_persistent_volume_test.go @@ -1,3 +1,5 @@ +//go:build community_e2e + package replica_set_custom_persistent_volume import ( diff --git a/mongodb-community-operator/test/e2e/replica_set_custom_role/replica_set_custom_role_test.go b/mongodb-community-operator/test/e2e/replica_set_custom_role/replica_set_custom_role_test.go index 70d3b4f47..258d4f331 100644 --- a/mongodb-community-operator/test/e2e/replica_set_custom_role/replica_set_custom_role_test.go +++ b/mongodb-community-operator/test/e2e/replica_set_custom_role/replica_set_custom_role_test.go @@ -1,3 +1,5 @@ +//go:build community_e2e + package replica_set_custom_role import ( diff --git a/mongodb-community-operator/test/e2e/replica_set_enterprise_upgrade_4_5/replica_set_enterprise_upgrade_4_5_test.go b/mongodb-community-operator/test/e2e/replica_set_enterprise_upgrade_4_5/replica_set_enterprise_upgrade_4_5_test.go index 8d5e9e678..c94e45b6e 100644 --- a/mongodb-community-operator/test/e2e/replica_set_enterprise_upgrade_4_5/replica_set_enterprise_upgrade_4_5_test.go +++ b/mongodb-community-operator/test/e2e/replica_set_enterprise_upgrade_4_5/replica_set_enterprise_upgrade_4_5_test.go @@ -1,3 +1,5 @@ +//go:build community_e2e + package replica_set import ( diff --git a/mongodb-community-operator/test/e2e/replica_set_enterprise_upgrade_5_6/replica_set_enterprise_upgrade_5_6_test.go b/mongodb-community-operator/test/e2e/replica_set_enterprise_upgrade_5_6/replica_set_enterprise_upgrade_5_6_test.go index 6f7b33d77..3ef82aa30 100644 --- a/mongodb-community-operator/test/e2e/replica_set_enterprise_upgrade_5_6/replica_set_enterprise_upgrade_5_6_test.go +++ b/mongodb-community-operator/test/e2e/replica_set_enterprise_upgrade_5_6/replica_set_enterprise_upgrade_5_6_test.go @@ -1,3 +1,5 @@ +//go:build community_e2e + package replica_set import ( diff --git a/mongodb-community-operator/test/e2e/replica_set_enterprise_upgrade_6_7/replica_set_enterprise_upgrade_5_6_test.go b/mongodb-community-operator/test/e2e/replica_set_enterprise_upgrade_6_7/replica_set_enterprise_upgrade_5_6_test.go index 9f2bed183..0c7885232 100644 --- a/mongodb-community-operator/test/e2e/replica_set_enterprise_upgrade_6_7/replica_set_enterprise_upgrade_5_6_test.go +++ b/mongodb-community-operator/test/e2e/replica_set_enterprise_upgrade_6_7/replica_set_enterprise_upgrade_5_6_test.go @@ -1,3 +1,5 @@ +//go:build community_e2e + package replica_set import ( diff --git a/mongodb-community-operator/test/e2e/replica_set_enterprise_upgrade_7_8/replica_set_enterprise_upgrade_5_6_test.go b/mongodb-community-operator/test/e2e/replica_set_enterprise_upgrade_7_8/replica_set_enterprise_upgrade_5_6_test.go index a7f91fa8f..33f50b654 100644 --- a/mongodb-community-operator/test/e2e/replica_set_enterprise_upgrade_7_8/replica_set_enterprise_upgrade_5_6_test.go +++ b/mongodb-community-operator/test/e2e/replica_set_enterprise_upgrade_7_8/replica_set_enterprise_upgrade_5_6_test.go @@ -1,3 +1,5 @@ +//go:build community_e2e + package replica_set import ( diff --git a/mongodb-community-operator/test/e2e/replica_set_mongod_config/replica_set_mongod_config_test.go b/mongodb-community-operator/test/e2e/replica_set_mongod_config/replica_set_mongod_config_test.go index d16887be7..85edbb467 100644 --- a/mongodb-community-operator/test/e2e/replica_set_mongod_config/replica_set_mongod_config_test.go +++ b/mongodb-community-operator/test/e2e/replica_set_mongod_config/replica_set_mongod_config_test.go @@ -1,3 +1,5 @@ +//go:build community_e2e + package replica_set_mongod_config import ( diff --git a/mongodb-community-operator/test/e2e/replica_set_mongod_port_change_with_arbiters/replica_set_mongod_port_change_with_arbiters_test.go b/mongodb-community-operator/test/e2e/replica_set_mongod_port_change_with_arbiters/replica_set_mongod_port_change_with_arbiters_test.go index c9c2cc2ba..4796a5833 100644 --- a/mongodb-community-operator/test/e2e/replica_set_mongod_port_change_with_arbiters/replica_set_mongod_port_change_with_arbiters_test.go +++ b/mongodb-community-operator/test/e2e/replica_set_mongod_port_change_with_arbiters/replica_set_mongod_port_change_with_arbiters_test.go @@ -1,3 +1,5 @@ +//go:build community_e2e + package replica_set_mongod_config import ( diff --git a/mongodb-community-operator/test/e2e/replica_set_mongod_readiness/replica_set_mongod_readiness_test.go b/mongodb-community-operator/test/e2e/replica_set_mongod_readiness/replica_set_mongod_readiness_test.go index 0af26f217..6ae9319c2 100644 --- a/mongodb-community-operator/test/e2e/replica_set_mongod_readiness/replica_set_mongod_readiness_test.go +++ b/mongodb-community-operator/test/e2e/replica_set_mongod_readiness/replica_set_mongod_readiness_test.go @@ -1,3 +1,5 @@ +//go:build community_e2e + package replica_set_mongod_readiness import ( diff --git a/mongodb-community-operator/test/e2e/replica_set_mount_connection_string/replica_set_mount_connection_string_test.go b/mongodb-community-operator/test/e2e/replica_set_mount_connection_string/replica_set_mount_connection_string_test.go index 2fd1b0305..e9483c764 100644 --- a/mongodb-community-operator/test/e2e/replica_set_mount_connection_string/replica_set_mount_connection_string_test.go +++ b/mongodb-community-operator/test/e2e/replica_set_mount_connection_string/replica_set_mount_connection_string_test.go @@ -1,3 +1,5 @@ +//go:build community_e2e + package replica_set_mount_connection_string import ( diff --git a/mongodb-community-operator/test/e2e/replica_set_multiple/replica_set_multiple_test.go b/mongodb-community-operator/test/e2e/replica_set_multiple/replica_set_multiple_test.go index 2047792e8..79954ae5d 100644 --- a/mongodb-community-operator/test/e2e/replica_set_multiple/replica_set_multiple_test.go +++ b/mongodb-community-operator/test/e2e/replica_set_multiple/replica_set_multiple_test.go @@ -1,3 +1,5 @@ +//go:build community_e2e + package replica_set_multiple import ( diff --git a/mongodb-community-operator/test/e2e/replica_set_operator_upgrade/replica_set_operator_upgrade_test.go b/mongodb-community-operator/test/e2e/replica_set_operator_upgrade/replica_set_operator_upgrade_test.go index 0625d70f5..e453cd0c7 100644 --- a/mongodb-community-operator/test/e2e/replica_set_operator_upgrade/replica_set_operator_upgrade_test.go +++ b/mongodb-community-operator/test/e2e/replica_set_operator_upgrade/replica_set_operator_upgrade_test.go @@ -1,3 +1,5 @@ +//go:build community_e2e + package replica_set_operator_upgrade import ( diff --git a/mongodb-community-operator/test/e2e/replica_set_recovery/replica_set_recovery_test.go b/mongodb-community-operator/test/e2e/replica_set_recovery/replica_set_recovery_test.go index e4ddfff8d..e7197f3eb 100644 --- a/mongodb-community-operator/test/e2e/replica_set_recovery/replica_set_recovery_test.go +++ b/mongodb-community-operator/test/e2e/replica_set_recovery/replica_set_recovery_test.go @@ -1,3 +1,5 @@ +//go:build community_e2e + package replica_set_recovery import ( diff --git a/mongodb-community-operator/test/e2e/replica_set_remove_user/replica_set_remove_user_test.go b/mongodb-community-operator/test/e2e/replica_set_remove_user/replica_set_remove_user_test.go index e1e2b8caf..d96d6faf1 100644 --- a/mongodb-community-operator/test/e2e/replica_set_remove_user/replica_set_remove_user_test.go +++ b/mongodb-community-operator/test/e2e/replica_set_remove_user/replica_set_remove_user_test.go @@ -1,3 +1,5 @@ +//go:build community_e2e + package replica_set_remove_user import ( diff --git a/mongodb-community-operator/test/e2e/replica_set_scale/replica_set_scaling_test.go b/mongodb-community-operator/test/e2e/replica_set_scale/replica_set_scaling_test.go index dee0a66bf..80a858066 100644 --- a/mongodb-community-operator/test/e2e/replica_set_scale/replica_set_scaling_test.go +++ b/mongodb-community-operator/test/e2e/replica_set_scale/replica_set_scaling_test.go @@ -1,3 +1,5 @@ +//go:build community_e2e + package replica_set_scale_up import ( diff --git a/mongodb-community-operator/test/e2e/replica_set_scale_down/replica_set_scale_down_test.go b/mongodb-community-operator/test/e2e/replica_set_scale_down/replica_set_scale_down_test.go index 0063ca534..ad54e4675 100644 --- a/mongodb-community-operator/test/e2e/replica_set_scale_down/replica_set_scale_down_test.go +++ b/mongodb-community-operator/test/e2e/replica_set_scale_down/replica_set_scale_down_test.go @@ -1,3 +1,5 @@ +//go:build community_e2e + package replica_set_scale_down import ( diff --git a/mongodb-community-operator/test/e2e/replica_set_tls/replica_set_tls_test.go b/mongodb-community-operator/test/e2e/replica_set_tls/replica_set_tls_test.go index e5e6c1257..04c6c3556 100644 --- a/mongodb-community-operator/test/e2e/replica_set_tls/replica_set_tls_test.go +++ b/mongodb-community-operator/test/e2e/replica_set_tls/replica_set_tls_test.go @@ -1,3 +1,5 @@ +//go:build community_e2e + package replica_set_tls import ( diff --git a/mongodb-community-operator/test/e2e/replica_set_tls_recreate_mdbc/replica_set_tls_recreate_mdbc_test.go b/mongodb-community-operator/test/e2e/replica_set_tls_recreate_mdbc/replica_set_tls_recreate_mdbc_test.go index c29e6d5b1..dffa5a4cb 100644 --- a/mongodb-community-operator/test/e2e/replica_set_tls_recreate_mdbc/replica_set_tls_recreate_mdbc_test.go +++ b/mongodb-community-operator/test/e2e/replica_set_tls_recreate_mdbc/replica_set_tls_recreate_mdbc_test.go @@ -1,3 +1,5 @@ +//go:build community_e2e + package replica_set_tls import ( diff --git a/mongodb-community-operator/test/e2e/replica_set_tls_rotate/replica_set_tls_rotate_test.go b/mongodb-community-operator/test/e2e/replica_set_tls_rotate/replica_set_tls_rotate_test.go index 1a0efc6e0..057ac1723 100644 --- a/mongodb-community-operator/test/e2e/replica_set_tls_rotate/replica_set_tls_rotate_test.go +++ b/mongodb-community-operator/test/e2e/replica_set_tls_rotate/replica_set_tls_rotate_test.go @@ -1,3 +1,5 @@ +//go:build community_e2e + package replica_set_tls import ( diff --git a/mongodb-community-operator/test/e2e/replica_set_tls_rotate_delete_sts/replica_set_tls_rotate_delete_sts_test.go b/mongodb-community-operator/test/e2e/replica_set_tls_rotate_delete_sts/replica_set_tls_rotate_delete_sts_test.go index ab00a2cee..ef64817fe 100644 --- a/mongodb-community-operator/test/e2e/replica_set_tls_rotate_delete_sts/replica_set_tls_rotate_delete_sts_test.go +++ b/mongodb-community-operator/test/e2e/replica_set_tls_rotate_delete_sts/replica_set_tls_rotate_delete_sts_test.go @@ -1,3 +1,5 @@ +//go:build community_e2e + package replica_set_tls_rotate_delete_sts import ( diff --git a/mongodb-community-operator/test/e2e/replica_set_tls_upgrade/replica_set_tls_upgrade_test.go b/mongodb-community-operator/test/e2e/replica_set_tls_upgrade/replica_set_tls_upgrade_test.go index c602abcdb..ab738ff58 100644 --- a/mongodb-community-operator/test/e2e/replica_set_tls_upgrade/replica_set_tls_upgrade_test.go +++ b/mongodb-community-operator/test/e2e/replica_set_tls_upgrade/replica_set_tls_upgrade_test.go @@ -1,3 +1,5 @@ +//go:build community_e2e + package replica_set_tls import ( diff --git a/mongodb-community-operator/test/e2e/replica_set_x509/replica_set_x509_test.go b/mongodb-community-operator/test/e2e/replica_set_x509/replica_set_x509_test.go index 639666cc6..57c25f25b 100644 --- a/mongodb-community-operator/test/e2e/replica_set_x509/replica_set_x509_test.go +++ b/mongodb-community-operator/test/e2e/replica_set_x509/replica_set_x509_test.go @@ -1,3 +1,5 @@ +//go:build community_e2e + package replica_set_x509 import ( diff --git a/mongodb-community-operator/test/e2e/statefulset_arbitrary_config/statefulset_arbitrary_config_test.go b/mongodb-community-operator/test/e2e/statefulset_arbitrary_config/statefulset_arbitrary_config_test.go index b12d78421..c0531f0c9 100644 --- a/mongodb-community-operator/test/e2e/statefulset_arbitrary_config/statefulset_arbitrary_config_test.go +++ b/mongodb-community-operator/test/e2e/statefulset_arbitrary_config/statefulset_arbitrary_config_test.go @@ -1,3 +1,5 @@ +//go:build community_e2e + package statefulset_arbitrary_config_update import ( diff --git a/mongodb-community-operator/test/e2e/statefulset_arbitrary_config_update/statefulset_arbitrary_config_update_test.go b/mongodb-community-operator/test/e2e/statefulset_arbitrary_config_update/statefulset_arbitrary_config_update_test.go index 62447f63c..7fff0cf45 100644 --- a/mongodb-community-operator/test/e2e/statefulset_arbitrary_config_update/statefulset_arbitrary_config_update_test.go +++ b/mongodb-community-operator/test/e2e/statefulset_arbitrary_config_update/statefulset_arbitrary_config_update_test.go @@ -1,3 +1,5 @@ +//go:build community_e2e + package statefulset_arbitrary_config import ( diff --git a/mongodb-community-operator/test/e2e/statefulset_delete/statefulset_delete_test.go b/mongodb-community-operator/test/e2e/statefulset_delete/statefulset_delete_test.go index 5678a1a15..fbe7d70b4 100644 --- a/mongodb-community-operator/test/e2e/statefulset_delete/statefulset_delete_test.go +++ b/mongodb-community-operator/test/e2e/statefulset_delete/statefulset_delete_test.go @@ -1,3 +1,5 @@ +//go:build community_e2e + package statefulset_delete import ( diff --git a/mongodb-community-operator/test/e2e/util/mongotester/mongotester_test.go b/mongodb-community-operator/test/e2e/util/mongotester/mongotester_test.go index 91ca6489b..76fd8bb0c 100644 --- a/mongodb-community-operator/test/e2e/util/mongotester/mongotester_test.go +++ b/mongodb-community-operator/test/e2e/util/mongotester/mongotester_test.go @@ -1,3 +1,5 @@ +//go:build community_e2e + package mongotester import ( diff --git a/scripts/evergreen/unit-tests-golang.sh b/scripts/evergreen/unit-tests-golang.sh new file mode 100755 index 000000000..442133568 --- /dev/null +++ b/scripts/evergreen/unit-tests-golang.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +set -Eeou pipefail + +source scripts/dev/set_env_context.sh + +USE_RACE_SWITCH="" +if [[ "${USE_RACE:-"false"}" = "true" ]]; then + USE_RACE_SWITCH="-race" +fi + +rm golang-unit-result.xml cover.out 2>/dev/null || true + +# gotestsum is just a wrapper on go test -json adding output formatting and xml file +go tool gotestsum --junitfile golang-unit-result.xml --format-icons hivis -- -v ${USE_RACE_SWITCH} -coverprofile cover.out ./... diff --git a/scripts/evergreen/unit-tests-python.sh b/scripts/evergreen/unit-tests-python.sh new file mode 100755 index 000000000..da0707f4d --- /dev/null +++ b/scripts/evergreen/unit-tests-python.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +set -Eeou pipefail + +# e2e tests are also in python and we will need to ignore them as they are in the docker/mongodb-kubernetes-tests folder +# we also ignore generate_ssdlc_report_test.py as it's very slow +scripts/evergreen/run_python.sh -m pytest --junitxml=python-unit-result.xml --ignore=docker/mongodb-kubernetes-tests --ignore=generate_ssdlc_report_test.py +# additionally, we have one lib which we want to test which is in the =docker/mongodb-kubernetes-tests folder. +scripts/evergreen/run_python.sh -m pytest --junitxml=python-kubeobject-result.xml docker/mongodb-kubernetes-tests/kubeobject + diff --git a/scripts/evergreen/unit-tests-sbom.sh b/scripts/evergreen/unit-tests-sbom.sh new file mode 100755 index 000000000..71497becb --- /dev/null +++ b/scripts/evergreen/unit-tests-sbom.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +set -Eeou pipefail + +scripts/evergreen/run_python.sh -m pytest --junitxml=python-ssdlc-result.xml generate_ssdlc_report_test.py diff --git a/scripts/evergreen/unit-tests.sh b/scripts/evergreen/unit-tests.sh deleted file mode 100755 index 60fb081a4..000000000 --- a/scripts/evergreen/unit-tests.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env bash - -set -Eeou pipefail - -# shellcheck disable=SC2038 -# shellcheck disable=SC2016 -# TODO: MCK once we merge folder we need to update this -# This command iterates over all the dirs (excepting ./docker/mongodb-kubernetes-tests/*) that have go.mod in them -# and then `cd`s into those to run the go test command. -find . -name go.mod -not -path "./docker/mongodb-kubernetes-tests/*" -exec dirname "{}" \+ | xargs -L 1 /bin/bash -c ' -cd "$0" -echo "testing $0" -rm -f result.suite -if [ "$USE_RACE" = "true" ]; then - echo "running test with race enabled" - GO_TEST_CMD="go test -v -coverprofile cover.out \$(go list ./... | grep -v \"mongodb-community-operator/test/e2e\")" -else - echo "running test without race enabled" - GO_TEST_CMD="go test -v -coverprofile cover.out \$(go list ./... | grep -v \"mongodb-community-operator/test/e2e\")" -fi -echo "running $GO_TEST_CMD" -eval "$GO_TEST_CMD" | tee -a result.suite -'