Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,6 @@ jobs:

- name: Run clippy lints
run: cargo clippy --all-features -- -D warnings

- name: Check Rust-native e2e harness
run: make e2e-check
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/target
/e2e/target
.e2e-cache
/vendor
.idea
.DS_Store
Expand Down
65 changes: 56 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,17 @@
# See the License for the specific language governing permissions and
# limitations under the License.

.PHONY: pre-commit fmt fmt-check clippy test build docker-build-operator docker-build-console-web docker-build-all help console-lint console-fmt console-fmt-check
.PHONY: pre-commit fmt fmt-check clippy test build help
.PHONY: docker-build-operator docker-build-console-web docker-build-all
.PHONY: console-lint console-fmt console-fmt-check
.PHONY: e2e-check e2e-live-create e2e-live-run e2e-live-update e2e-live-delete

# Default target
IMAGE_REPO ?= rustfs/operator
IMAGE_TAG ?= dev
CONSOLE_WEB_IMAGE_REPO ?= rustfs/console-web
CONSOLE_WEB_IMAGE_TAG ?= dev

# 默认目标
help:
@echo "RustFS Operator Makefile"
@echo ""
Expand All @@ -31,10 +39,15 @@ help:
@echo " make console-lint - 前端 ESLint 检查 (console-web)"
@echo " make console-fmt - 前端 Prettier 自动格式化 (console-web)"
@echo " make console-fmt-check - 前端 Prettier 格式检查 (console-web)"
@echo " make e2e-check - Check Rust-native e2e harness (fmt + test + clippy)"
@echo " make e2e-live-create - Clean dedicated storage, recreate live Kind environment and load e2e image"
@echo " make e2e-live-run - Run all live suites (smoke/operator/console) in the existing live environment"
@echo " make e2e-live-update - Rebuild image and update the live environment (load + rollout)"
@echo " make e2e-live-delete - Delete live Kind environment and clean dedicated storage"

# 提交前检查:Rust (fmt-check + clippy + test) + 前端 (lint + 格式检查)
pre-commit: fmt-check clippy test console-lint console-fmt-check
@echo "pre-commit: 所有检查通过"
# pre-commit checks: Rust main crate + e2e harness + frontend (lint + format checks)
pre-commit: fmt-check clippy test e2e-check console-lint console-fmt-check
@echo "pre-commit: all checks passed"

# 自动格式化
fmt:
Expand Down Expand Up @@ -68,14 +81,48 @@ console-fmt-check:
build:
cargo build --release

# Rust-native e2e harness (live-first, dedicated Kind)
E2E_MANIFEST ?= e2e/Cargo.toml
E2E_BIN ?= cargo run --manifest-path $(E2E_MANIFEST) --bin rustfs-e2e --
E2E_TEST_THREADS ?= 1

# Rust-native e2e harness checks (non-live; ignored live tests remain opt-in)
e2e-check:
cargo fmt --manifest-path $(E2E_MANIFEST) --all --check
cargo test --manifest-path $(E2E_MANIFEST)
cargo clippy --manifest-path $(E2E_MANIFEST) --all-targets -- -D warnings

# 4-command live workflow. Keep helper steps inline so the public Make surface stays small.
e2e-live-create:
docker build --network host -t rustfs/operator:e2e .
docker build --network host -t rustfs/console-web:e2e -f console-web/Dockerfile console-web
RUSTFS_E2E_LIVE=1 $(E2E_BIN) kind-delete || true
RUSTFS_E2E_LIVE=1 $(E2E_BIN) kind-create
RUSTFS_E2E_LIVE=1 $(E2E_BIN) kind-load-images

e2e-live-run:
RUSTFS_E2E_LIVE=1 $(E2E_BIN) assert-context
RUSTFS_E2E_LIVE=1 $(E2E_BIN) deploy-dev
RUSTFS_E2E_LIVE=1 cargo test --manifest-path $(E2E_MANIFEST) --test smoke -- --ignored --test-threads=$(E2E_TEST_THREADS) --nocapture
RUSTFS_E2E_LIVE=1 cargo test --manifest-path $(E2E_MANIFEST) --test operator -- --ignored --test-threads=$(E2E_TEST_THREADS) --nocapture
RUSTFS_E2E_LIVE=1 cargo test --manifest-path $(E2E_MANIFEST) --test console -- --ignored --test-threads=$(E2E_TEST_THREADS) --nocapture
@echo "configured live e2e suites passed."

e2e-live-update:
docker build --network host -t rustfs/operator:e2e .
docker build --network host -t rustfs/console-web:e2e -f console-web/Dockerfile console-web
RUSTFS_E2E_LIVE=1 $(E2E_BIN) assert-context
RUSTFS_E2E_LIVE=1 $(E2E_BIN) kind-load-images
RUSTFS_E2E_LIVE=1 $(E2E_BIN) rollout-dev

e2e-live-delete:
RUSTFS_E2E_LIVE=1 $(E2E_BIN) kind-delete


# 构建 Docker 镜像(operator:含 controller + console API;console-web:前端静态资源)
IMAGE_REPO ?= rustfs/operator
IMAGE_TAG ?= dev
docker-build-operator:
docker build -t $(IMAGE_REPO):$(IMAGE_TAG) .

CONSOLE_WEB_IMAGE_REPO ?= rustfs/console-web
CONSOLE_WEB_IMAGE_TAG ?= dev
docker-build-console-web:
docker build -t $(CONSOLE_WEB_IMAGE_REPO):$(CONSOLE_WEB_IMAGE_TAG) -f console-web/Dockerfile console-web

Expand Down
Loading
Loading