-
Notifications
You must be signed in to change notification settings - Fork 911
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
Rename host tests to functional tests #3782
Conversation
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
Makefile
Outdated
@@ -262,32 +257,31 @@ build-tests: | |||
|
|||
unit-test: clean-test-results | |||
@printf $(COLOR) "Run unit tests..." | |||
@go test $(UNIT_TEST_DIRS) -timeout=$(TEST_TIMEOUT) $(TEST_TAG) -race | tee -a test.log | |||
@go test $(TEST_DIRS) -timeout=$(TEST_TIMEOUT) -tags=unittest -race | tee -a test.log |
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.
Why did you add unittest
build tag? I don't like the idea of mixing dir and tag based approaches.
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.
What about I change everything to use build tag?
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.
I remove the unit test build tag and still use dir to filter tests. The problem is golang only support negative filtering. If I want to use the tag to filter integration test, I need to add !intergrationtest
tag to all unit tests. I am not sure if there is other way around.
@@ -22,7 +22,9 @@ | |||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
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.
These files need to be renamed too. You can do it later.
@@ -262,32 +260,31 @@ build-tests: | |||
|
|||
unit-test: clean-test-results | |||
@printf $(COLOR) "Run unit tests..." | |||
@go test $(UNIT_TEST_DIRS) -timeout=$(TEST_TIMEOUT) $(TEST_TAG) -race | tee -a test.log | |||
@go test $(UNIT_TEST_DIRS) -timeout=$(TEST_TIMEOUT) $(TEST_DIRS) -race | tee -a test.log |
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.
@go test $(UNIT_TEST_DIRS) -timeout=$(TEST_TIMEOUT) $(TEST_DIRS) -race | tee -a test.log | |
@go test $(UNIT_TEST_DIRS) -timeout=$(TEST_TIMEOUT) $(TEST_DIRS) $(TEST_TAG) -race | tee -a test.log |
TEST_TAG
is to pass custom test tags as parameter if needed.
@@ -296,27 +293,23 @@ $(COVER_ROOT): | |||
unit-test-coverage: $(COVER_ROOT) | |||
@printf $(COLOR) "Run unit tests with coverage..." | |||
@echo "mode: atomic" > $(UNIT_COVER_PROFILE) | |||
@go test ./$(UNIT_TEST_DIRS) -timeout=$(TEST_TIMEOUT) -race -coverprofile=$(UNIT_COVER_PROFILE) || exit 1; | |||
@go test ./$(UNIT_TEST_DIRS) -timeout=$(TEST_TIMEOUT) -race -tags=unittest -coverprofile=$(UNIT_COVER_PROFILE) || exit 1; |
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.
@go test ./$(UNIT_TEST_DIRS) -timeout=$(TEST_TIMEOUT) -race -tags=unittest -coverprofile=$(UNIT_COVER_PROFILE) || exit 1; | |
@go test ./$(UNIT_TEST_DIRS) -timeout=$(TEST_TIMEOUT) -race -coverprofile=$(UNIT_COVER_PROFILE) || exit 1; |
What changed?
Rename host tests to functional tests
Why?
Categorize persistence integration tests and functional tests.
How did you test it?
Potential risks
Is hotfix candidate?