-
Notifications
You must be signed in to change notification settings - Fork 83
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
test(sdk): Use -race Flag when testing #1026
Conversation
Makefile
Outdated
@@ -34,7 +34,7 @@ test-template: | |||
make -C ./app-service-template test | |||
|
|||
test-sdk: | |||
$(GO) test ./... -coverprofile=coverage.out ./... | |||
$(GO) test ./... -coverprofile=coverage.out ./... -race |
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.
This looks strange... with the double ./...
that was there before. In edgex-go it looks like this:
GOTESTFLAGS?=-race
.
.
.
GO111MODULE=on go test $(GOTESTFLAGS) -coverprofile=coverage.out ./...
Please use the edgex-go way of doing it.
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.
Also this should be added to the Makefile for the app-service-template.
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.
Ah I wondered what that was about @lenny-intel - should be good now thanks
a101583
to
c2abb10
Compare
app-service-template/Makefile
Outdated
@@ -59,7 +59,7 @@ docker: | |||
# The test-attribution-txt.sh scripts are required for upstreaming to EdgeX Foundry. | |||
# TODO: Remove bin folder and reference to script below if NOT upstreaming to EdgeX Foundry. | |||
test: | |||
$(GO) test -coverprofile=coverage.out ./... | |||
$(GO) test -coverprofile=coverage.out ./... --race |
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.
Still not consistent with edgex-go. Use variable and position of opinion. Please update to use:
GOTESTFLAGS?=-race
$(GO) test $(GOTESTFLAGS) -coverprofile=coverage.out ./...
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.
Includes naive fix for one race detected. Fixes #209 Signed-off-by: Alex Ullrich <[email protected]>
c2abb10
to
c046d6b
Compare
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.
LGTM
Includes naive fix for one race detected. Fixes edgexfoundry#209 Signed-off-by: Alex Ullrich <[email protected]>
Includes naive fix for one race detected.
Fixes #209
Signed-off-by: Alex Ullrich [email protected]
If your build fails due to your commit message not passing the build checks, please review the guidelines here: https://github.com/edgexfoundry/app-functions-sdk-go/blob/main/.github/CONTRIBUTING.md
PR Checklist
Please check if your PR fulfills the following requirements:
BREAKING CHANGE:
describing the break)no docs change
Testing Instructions
New Dependency Instructions (If applicable)