Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid out directory, when listing test files #3229

Merged
merged 1 commit into from
Jan 16, 2019
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
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ HYPERKIT_FILES := ./cmd/drivers/hyperkit
STORAGE_PROVISIONER_FILES := ./cmd/storage-provisioner
KVM_DRIVER_FILES := ./cmd/drivers/kvm/

MINIKUBE_TEST_FILES := ./...
MINIKUBE_TEST_FILES := ./cmd/... ./pkg/...

MINIKUBE_BUILD_TAGS := container_image_ostree_stub containers_image_openpgp
MINIKUBE_INTEGRATION_BUILD_TAGS := integration $(MINIKUBE_BUILD_TAGS)
Expand Down Expand Up @@ -93,7 +93,7 @@ out/minikube-windows-amd64.exe: out/minikube-windows-amd64
cp out/minikube-windows-amd64 out/minikube-windows-amd64.exe

out/minikube.d: pkg/minikube/assets/assets.go
$(MAKEDEPEND) out/minikube-$(GOOS)-$(GOARCH) $(ORG) $(MINIKUBEFILES) $^ > $@
$(MAKEDEPEND) out/minikube-$(GOOS)-$(GOARCH) $(ORG) $^ $(MINIKUBEFILES) > $@

-include out/minikube.d
out/minikube-%-$(GOARCH): pkg/minikube/assets/assets.go
Expand Down Expand Up @@ -188,7 +188,7 @@ integration-versioned: out/minikube

.PHONY: test
out/test.d: pkg/minikube/assets/assets.go
$(MAKEDEPEND) -t test $(ORG) $(MINIKUBE_TEST_FILES) $^ > $@
$(MAKEDEPEND) -t test $(ORG) $^ $(MINIKUBE_TEST_FILES) > $@

-include out/test.d
test:
Expand Down Expand Up @@ -262,7 +262,7 @@ out/minikube-installer.exe: out/minikube-windows-amd64.exe
rm -rf out/windows_tmp

out/docker-machine-driver-hyperkit.d:
$(MAKEDEPEND) out/docker-machine-driver-hyperkit $(ORG) $(HYPERKIT_FILES) $^ > $@
$(MAKEDEPEND) out/docker-machine-driver-hyperkit $(ORG) $^ $(HYPERKIT_FILES) > $@

-include out/docker-machine-driver-hyperkit.d
out/docker-machine-driver-hyperkit:
Expand All @@ -289,7 +289,7 @@ $(ISO_BUILD_IMAGE): deploy/iso/minikube-iso/Dockerfile
@echo "$(@) successfully built"

out/storage-provisioner.d:
$(MAKEDEPEND) out/storage-provisioner $(ORG) $(STORAGE_PROVISIONER_FILES) $^ > $@
$(MAKEDEPEND) out/storage-provisioner $(ORG) $^ $(STORAGE_PROVISIONER_FILES) > $@

-include out/storage-provisioner.d
out/storage-provisioner:
Expand All @@ -314,7 +314,7 @@ release-minikube: out/minikube checksum
gsutil cp out/minikube-$(GOOS)-$(GOARCH).sha256 $(MINIKUBE_UPLOAD_LOCATION)/$(MINIKUBE_VERSION)/minikube-$(GOOS)-$(GOARCH).sha256

out/docker-machine-driver-kvm2.d:
$(MAKEDEPEND) out/docker-machine-driver-kvm2 $(ORG) $(KVM_DRIVER_FILES) $^ > $@
$(MAKEDEPEND) out/docker-machine-driver-kvm2 $(ORG) $^ $(KVM_DRIVER_FILES) > $@

-include out/docker-machine-driver-kvm2.d
out/docker-machine-driver-kvm2:
Expand Down
12 changes: 6 additions & 6 deletions makedepend.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# Generate go dependencies, for make. Uses `go list".
# Usage: makedepend.sh [-t] output package path [extra]
# Generate go dependencies, for make. Uses `go list`.
# Usage: makedepend.sh [-t] output package extra path...

PATH_FORMAT='{{ .ImportPath }}{{"\n"}}{{join .Deps "\n"}}'
FILE_FORMAT='{{ range $file := .GoFiles }} {{$.Dir}}/{{$file}}{{"\n"}}{{end}}'
Expand All @@ -28,14 +28,14 @@ fi

out=$1
pkg=$2
path=$3
extra=$4
extra=$3
paths="$4 $5 $6"

# check for mandatory parameters
test -n "$out$pkg$path" || exit 1
test -n "$out$pkg$paths" || exit 1

echo "$out: $extra\\"
go list -f "$PATH_FORMAT" $path |
go list -f "$PATH_FORMAT" $paths |
grep "$pkg" |
xargs go list -f "$FILE_FORMAT" |
sed -e "s|^ ${GOPATH}| \$(GOPATH)|;s/$/ \\\\/"
Expand Down
2 changes: 1 addition & 1 deletion test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ echo "Running go tests..."
cd ${GOPATH}/src/${REPO_PATH}
rm -f out/$COV_FILE || true
echo "mode: count" > out/$COV_FILE
for pkg in $(go list -f '{{ if .TestGoFiles }} {{.ImportPath}} {{end}}' ./...); do
for pkg in $(go list -f '{{ if .TestGoFiles }} {{.ImportPath}} {{end}}' ./cmd/... ./pkg/...); do
go test -tags "container_image_ostree_stub containers_image_openpgp" -v $pkg -covermode=count -coverprofile=out/$COV_TMP_FILE
# tail -n +2 skips the first line of the file
# for coverprofile the first line is the `mode: count` line which we only want once in our file
Expand Down