-
Notifications
You must be signed in to change notification settings - Fork 48
mount: also test against local mountinfo source code #68
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| /mount/go-local.* |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -6,15 +6,31 @@ CROSS ?= linux/arm linux/arm64 linux/ppc64le linux/s390x \ | |||||||||||||||||||||
| SUDO ?= sudo -n | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| .PHONY: all | ||||||||||||||||||||||
| all: lint test cross | ||||||||||||||||||||||
| all: clean lint test test-local cross | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| .PHONY: clean | ||||||||||||||||||||||
| clean: | ||||||||||||||||||||||
| $(RM) mount/go-local.* | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| .PHONY: test | ||||||||||||||||||||||
| test: RUN_VIA_SUDO = $(shell $(SUDO) true && echo -exec \"$(SUDO)\") | ||||||||||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would change this to
Suggested change
(and move up) to avoid repetition.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
You mean, move
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I mean, combine the two lines test: RUN_VIA_SUDO = $(shell $(SUDO) true && echo -exec \"$(SUDO)\")
....
test-local: RUN_VIA_SUDO = $(shell $(SUDO) true && echo -exec \"$(SUDO)\")into one test test-local: RUN_VIA_SUDO = $(shell $(SUDO) true && echo -exec \"$(SUDO)\")and move it up next to SUDO definition. |
||||||||||||||||||||||
| test: | ||||||||||||||||||||||
| test: test-local | ||||||||||||||||||||||
| for p in $(PACKAGES); do \ | ||||||||||||||||||||||
| (cd $$p && go test $(RUN_VIA_SUDO) -v .); \ | ||||||||||||||||||||||
| done | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| # test the mount module against the local mountinfo source code instead of the | ||||||||||||||||||||||
| # release specified in go.mod. This allows catching regressions / breaking | ||||||||||||||||||||||
| # changes in mountinfo. | ||||||||||||||||||||||
| .PHONY: test-local | ||||||||||||||||||||||
| test-local: RUN_VIA_SUDO = $(shell $(SUDO) true && echo -exec \"$(SUDO)\") | ||||||||||||||||||||||
| test-local: | ||||||||||||||||||||||
| echo 'replace github.com/moby/sys/mountinfo => ../mountinfo' | cat mount/go.mod - > mount/go-local.mod | ||||||||||||||||||||||
| cd mount \ | ||||||||||||||||||||||
| && go mod download -modfile=go-local.mod \ | ||||||||||||||||||||||
| && go test -modfile=go-local.mod $(RUN_VIA_SUDO) -v . | ||||||||||||||||||||||
|
Comment on lines
+29
to
+31
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
or
Suggested change
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure if understand this change;
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Took me a while to figure out why I originally suggested that :) This is because
This means that existing go.sum file is totally adequate, so copying or linking it is sufficient. You can even try to do |
||||||||||||||||||||||
| $(RM) mount/go-local.* | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| .PHONY: lint | ||||||||||||||||||||||
| lint: $(BINDIR)/golangci-lint | ||||||||||||||||||||||
| $(BINDIR)/golangci-lint version | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: no need to have
test-localhere astestdepends on it.