Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
c3fbc08
refactor(e2e): replace Ginkgo with e2e-framework v0.6.0
ZiyangLinScality Jan 14, 2026
e1abb60
test(e2e): enhance CRD installation tests and add framework utilities
ZiyangLinScality Jan 14, 2026
c356a2a
feat(e2e): add e2e test framework with Kind cluster support
ZiyangLinScality Jan 15, 2026
2a1ddc9
feat(e2e): add mock server for end-to-end testing
ZiyangLinScality Jan 15, 2026
441fa59
feat(e2e): integrate mock server client and deployment for end-to-end…
ZiyangLinScality Jan 15, 2026
25b4011
feat(e2e): add smoke test for ScalityUI and related components
ZiyangLinScality Jan 16, 2026
27eceff
feat: introduce ForceRefreshAnnotation constant and update controller…
ZiyangLinScality Jan 19, 2026
34a79ed
feat(e2e): add comprehensive tests for ScalityUIComponent reconciliat…
ZiyangLinScality Jan 19, 2026
7eacc74
feat(e2e): add pod lifecycle tests for ScalityUI components
ZiyangLinScality Jan 20, 2026
eb654f2
feat(controller): implement deletion handling and finalizer managemen…
ZiyangLinScality Jan 20, 2026
ad318c7
feat(e2e): add cascade garbage collection tests for ScalityUI components
ZiyangLinScality Jan 20, 2026
511e20a
feat(e2e): add namespace deletion test for ScalityUI components
ZiyangLinScality Jan 20, 2026
d833370
feat(e2e): add multi-namespace tests for ScalityUI components
ZiyangLinScality Jan 20, 2026
3132160
chore: update e2e test timeout and add E2E test workflow
ZiyangLinScality Jan 20, 2026
06a8d53
refactor(e2e): streamline volume and config map handling in cascade G…
ZiyangLinScality Jan 20, 2026
c817b82
chore: update test timeout and enhance GitHub Actions workflows
ZiyangLinScality Jan 22, 2026
d10357a
refactor(e2e): enhance build skipping logic for operator images
ZiyangLinScality Jan 22, 2026
7bee8c9
feat(e2e): enhance ScalityUI component tests with new context keys an…
ZiyangLinScality Jan 22, 2026
1c96247
refactor(e2e): optimize pod lifecycle tests by reducing sleep duration
ZiyangLinScality Jan 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,23 @@ jobs:
subject-digest: ${{ steps.build.outputs.digest }}
subject-name: ghcr.io/${{ github.repository }}
push-to-registry: true

- name: Output image info to summary
if: ${{ inputs.push-image }}
run: |
IMAGE_TAG="${{ inputs.version || github.sha }}"
IMAGE_FULL="ghcr.io/${{ github.repository }}:${IMAGE_TAG}"

echo "## Docker Image" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Image pushed to registry:" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
echo "${IMAGE_FULL}" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Pull command:" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`bash" >> $GITHUB_STEP_SUMMARY
echo "docker pull ${IMAGE_FULL}" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
42 changes: 41 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,46 @@ jobs:
build:
uses: ./.github/workflows/docker.yml
with:
push-image: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
push-image: true
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you want to push image on every PR ? I think is ok !

You can also allow running specific test suites with build tag

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, if we want to test the image which didn't merge yet

secrets:
GH_PAT: ${{ secrets.GH_PAT }}

e2e:
name: E2E Tests
runs-on: ubuntu-latest
needs: [build]
timeout-minutes: 20
permissions:
contents: read
packages: read

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Go with private modules
uses: ./.github/actions/setup-go-private
with:
go-version: ${{ env.GO_VERSION }}
gh-token: ${{ secrets.GH_PAT }}

- name: Login to Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Pull operator image
run: docker pull ghcr.io/${{ github.repository }}:${{ github.sha }}

- name: Install Kind
uses: helm/kind-action@v1
with:
install_only: true

- name: Run E2E tests
run: make test-e2e
env:
E2E_SKIP_OPERATOR_BUILD: "true"
E2E_OPERATOR_IMAGE: "ghcr.io/${{ github.repository }}:${{ github.sha }}"
18 changes: 14 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,20 @@ vet: ## Run go vet against code.
test: manifests generate fmt vet envtest ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test $$(go list ./... | grep -v /e2e) -coverprofile cover.out

# Utilize Kind or modify the e2e tests to load the image locally, enabling compatibility with other vendors.
.PHONY: test-e2e # Run the e2e tests against a Kind k8s instance that is spun up.
test-e2e:
go test ./test/e2e/ -v -ginkgo.v
# Run the e2e tests using e2e-framework (auto-creates Kind cluster)
# Note: Tests with 'disruptive' label (OperatorCrashRecovery, NoSpuriousUpdatesAfterRestart)
# restart the operator pod and should not run in parallel with other tests.
.PHONY: test-e2e
test-e2e: ## Run all e2e tests against a Kind cluster (auto-created)
go test ./test/e2e/... -v -timeout 20m
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

20m ? this is quite long no ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the max timeout, not actual duration. E2E tests need time for pod scheduling, image pulls, and operator recovery tests. Actual runs complete much faster(10m-11m).


.PHONY: test-e2e-safe
test-e2e-safe: ## Run only parallel-safe e2e tests (excludes operator restart tests)
go test ./test/e2e/... -v -timeout 15m -skip 'TestPodLifecycle_OperatorCrashRecovery|TestPodLifecycle_NoSpuriousUpdatesAfterRestart'

.PHONY: test-e2e-disruptive
test-e2e-disruptive: ## Run only disruptive e2e tests (operator restart tests)
go test ./test/e2e/... -v -timeout 10m -run 'TestPodLifecycle_OperatorCrashRecovery|TestPodLifecycle_NoSpuriousUpdatesAfterRestart'

.PHONY: lint
lint: golangci-lint ## Run golangci-lint linter
Expand Down
3 changes: 3 additions & 0 deletions api/v1alpha1/annotations.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package v1alpha1

const ForceRefreshAnnotation = "ui.scality.com/force-refresh"
6 changes: 6 additions & 0 deletions config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
resources:
- manager.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
images:
- name: controller
newName: ui-operator
newTag: e2e
68 changes: 37 additions & 31 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,21 @@ go 1.24.3
require (
github.com/go-logr/logr v1.4.2
github.com/onsi/ginkgo/v2 v2.22.0
github.com/onsi/gomega v1.34.2
github.com/onsi/gomega v1.35.1
github.com/scality/reconciler-framework v0.0.0-20250320235513-ca024f4ffacb
k8s.io/api v0.31.2
k8s.io/apimachinery v0.31.2
k8s.io/client-go v0.31.2
k8s.io/utils v0.0.0-20240902221715-702e33fdd3c3
sigs.k8s.io/controller-runtime v0.19.0
k8s.io/api v0.32.1
k8s.io/apiextensions-apiserver v0.32.0
k8s.io/apimachinery v0.32.1
k8s.io/client-go v0.32.1
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738
sigs.k8s.io/controller-runtime v0.20.0
sigs.k8s.io/e2e-framework v0.6.0
)

require (
cel.dev/expr v0.18.0 // indirect
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
github.com/antlr4-go/antlr/v4 v4.13.0 // indirect
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a // indirect
github.com/beorn7/perks v1.0.1 // indirect
Expand All @@ -43,22 +46,22 @@ require (
github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-logr/zapr v1.3.0 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.4 // indirect
github.com/go-openapi/swag v0.23.0 // indirect
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/cel-go v0.20.1 // indirect
github.com/google/btree v1.1.3 // indirect
github.com/google/cel-go v0.22.0 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/mux v1.8.1 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect
github.com/imdario/mergo v0.3.13 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jarcoal/httpmock v1.3.1 // indirect
github.com/josharian/intern v1.0.0 // indirect
Expand All @@ -67,11 +70,13 @@ require (
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mitchellh/hashstructure v1.1.0 // indirect
github.com/moby/locker v1.0.1 // indirect
github.com/moby/spdystream v0.5.0 // indirect
github.com/moby/term v0.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0 // indirect
github.com/oras-project/oras-go v0.1.0 // indirect
Expand All @@ -84,7 +89,8 @@ require (
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/spf13/cobra v1.8.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stoewer/go-strcase v1.2.0 // indirect
github.com/stoewer/go-strcase v1.3.0 // indirect
github.com/vladimirvivien/gexe v0.4.1 // indirect
github.com/x448/float16 v0.8.4 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 // indirect
go.opentelemetry.io/otel v1.28.0 // indirect
Expand All @@ -95,31 +101,31 @@ require (
go.opentelemetry.io/otel/trace v1.28.0 // indirect
go.opentelemetry.io/proto/otlp v1.3.1 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.26.0 // indirect
go.uber.org/zap v1.27.0 // indirect
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
golang.org/x/net v0.30.0 // indirect
golang.org/x/oauth2 v0.21.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.26.0 // indirect
golang.org/x/term v0.25.0 // indirect
golang.org/x/text v0.19.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/net v0.33.0 // indirect
golang.org/x/oauth2 v0.23.0 // indirect
golang.org/x/sync v0.10.0 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/term v0.27.0 // indirect
golang.org/x/text v0.21.0 // indirect
golang.org/x/time v0.7.0 // indirect
golang.org/x/tools v0.26.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240826202546-f6391c0de4c7 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240826202546-f6391c0de4c7 // indirect
google.golang.org/grpc v1.65.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
google.golang.org/protobuf v1.35.1 // indirect
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.31.0 // indirect
k8s.io/apiserver v0.31.0 // indirect
k8s.io/component-base v0.31.0 // indirect
k8s.io/apiserver v0.32.0 // indirect
k8s.io/component-base v0.32.1 // indirect
k8s.io/klog/v2 v2.130.1 // indirect
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f // indirect
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.0 // indirect
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.2 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
)
Loading
Loading