Skip to content

Commit

Permalink
tests: remove useless test files
Browse files Browse the repository at this point in the history
Since #983, we have the new smoke test, we can remove the
old smoke test files including nydusify and nydus.

Signed-off-by: Yadong Ding <ding_yadong@foxmail.com>
  • Loading branch information
Desiki-high committed Dec 14, 2023
1 parent 194641a commit 5507998
Show file tree
Hide file tree
Showing 14 changed files with 2 additions and 655 deletions.
39 changes: 1 addition & 38 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,6 @@ current_dir := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
env_go_path := $(shell go env GOPATH 2> /dev/null)
go_path := $(if $(env_go_path),$(env_go_path),"$(HOME)/go")

# Set the env DIND_CACHE_DIR to specify a cache directory for
# docker-in-docker container, used to cache data for docker pull,
# then mitigate the impact of docker hub rate limit, for example:
# env DIND_CACHE_DIR=/path/to/host/var-lib-docker make docker-nydusify-smoke
dind_cache_mount := $(if $(DIND_CACHE_DIR),-v $(DIND_CACHE_DIR):/var/lib/docker,)

# Functions

# Func: build golang target in docker
Expand Down Expand Up @@ -129,7 +123,7 @@ coverage: pre-coverage
# write unit teset coverage to codecov.json, used for Github CI
coverage-codecov:
TEST_WORKDIR_PREFIX=$(TEST_WORKDIR_PREFIX) ${CARGO} llvm-cov --codecov --output-path codecov.json --workspace $(EXCLUDE_PACKAGES) $(CARGO_COMMON) $(CARGO_BUILD_FLAGS) -- --skip integration --nocapture --test-threads=8

smoke-only:
make -C smoke test

Expand All @@ -141,37 +135,6 @@ smoke-benchmark:

smoke: release smoke-only

docker-nydus-smoke:
docker build -t nydus-smoke --build-arg RUST_TARGET=${RUST_TARGET_STATIC} misc/nydus-smoke
docker run --rm --privileged ${CARGO_BUILD_GEARS} \
-e TEST_WORKDIR_PREFIX=$(TEST_WORKDIR_PREFIX) \
-v ~/.cargo:/root/.cargo \
-v $(TEST_WORKDIR_PREFIX) \
-v ${current_dir}:/nydus-rs \
nydus-smoke

# TODO: Nydusify smoke has to be time consuming for a while since it relies on musl nydusd and nydus-image.
# So musl compilation must be involved.
# And docker-in-docker deployment involves image building?
docker-nydusify-smoke: docker-static
$(call build_golang,$(NYDUSIFY_PATH),make build-smoke)
docker build -t nydusify-smoke misc/nydusify-smoke
docker run --rm --privileged \
-e BACKEND_TYPE=$(BACKEND_TYPE) \
-e BACKEND_CONFIG=$(BACKEND_CONFIG) \
-v $(current_dir):/nydus-rs $(dind_cache_mount) nydusify-smoke TestSmoke

docker-nydusify-image-test: docker-static
$(call build_golang,$(NYDUSIFY_PATH),make build-smoke)
docker build -t nydusify-smoke misc/nydusify-smoke
docker run --rm --privileged \
-e BACKEND_TYPE=$(BACKEND_TYPE) \
-e BACKEND_CONFIG=$(BACKEND_CONFIG) \
-v $(current_dir):/nydus-rs $(dind_cache_mount) nydusify-smoke TestDockerHubImage

# Run integration smoke test in docker-in-docker container. It requires some special settings,
docker-smoke: docker-nydus-smoke docker-nydusify-smoke

contrib-build: nydusify ctr-remote nydus-overlayfs

contrib-release: nydusify-release ctr-remote-release \
Expand Down
5 changes: 1 addition & 4 deletions contrib/nydusify/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ release:
plugin:
@CGO_ENABLED=0 ${PROXY} GOOS=linux GOARCH=${GOARCH} go build -ldflags '-s -w -extldflags "-static"' -o nydus-hook-plugin ./plugin

test: build build-smoke
test: build
@go vet $(PACKAGES)
golangci-lint run
@go test -covermode=atomic -coverprofile=coverage.out -count=1 -v -timeout 20m -race ./pkg/... ./cmd/...
Expand All @@ -37,6 +37,3 @@ coverage: test
clean:
rm -f cmd/nydusify
rm -f coverage.out

build-smoke:
${PROXY} go test -race -v -c -o ./nydusify-smoke ./tests
233 changes: 0 additions & 233 deletions contrib/nydusify/tests/e2e_test.go

This file was deleted.

54 changes: 0 additions & 54 deletions contrib/nydusify/tests/image_test.go

This file was deleted.

Loading

0 comments on commit 5507998

Please sign in to comment.