-
Notifications
You must be signed in to change notification settings - Fork 4.5k
[BEAM-13343][Playground] Support go unit tests #16138
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
[BEAM-13343][Playground] Support go unit tests #16138
Conversation
3836593 to
43d0a24
Compare
KhaninArtur
left a comment
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
Just be sure that this one goes after (and says that it depends on) Java unit tests in the tasks list of PRs to review
a02a295 to
e72f3a7
Compare
e72f3a7 to
61fb10d
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.
Could we combine this one?
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.
Done
6a5a2d6 to
6c87b92
Compare
# Conflicts: # playground/backend/internal/code_processing/code_processing.go # playground/backend/internal/setup_tools/builder/setup_builder.go # playground/backend/internal/setup_tools/builder/setup_builder_test.go
12dac8b to
d1b5af7
Compare
Co-authored-by: Aydar Zainutdinov <aydar.zaynutdinov@akvelon.com>
| ENTRYPOINT ["/opt/playground/backend/server_go_backend"] | ||
|
|
||
|
|
||
| ENTRYPOINT ["/opt/playground/backend/server_go_backend"] |
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.
add an empty string.
| // Check if unit test | ||
| isUnitTest := false | ||
| valResult, ok := validationResults.Load(validators.UnitTestValidatorName) | ||
| if ok && valResult.(bool) { | ||
| isUnitTest = true | ||
| } |
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.
Maybe wrap it like a separate method?
| const ( | ||
| nameBinGo = "go" | ||
| fmtArgs = "fmt" | ||
| goName = "go" |
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.
maybe goFileExtension instead of goName?
pabloem
left a comment
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. Left two comments.
| } | ||
| // Check if unit test | ||
| isUnitTest := false | ||
| valResult, ok := validationResults.Load(validators.UnitTestValidatorName) |
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.
| valResult, ok := validationResults.Load(validators.UnitTestValidatorName) | |
| validateIsUnitTest, ok := validationResults.Load(validators.UnitTestValidatorName) |
| "testing" | ||
| ) | ||
|
|
||
| func TestMain(m *testing.M) { |
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.
Can you add documentation to this file to explain that it defines some common methods for validators? (I was confused looking for a test within it, but there aren't any tests in it, right?)
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.
Thanks, Pablo, I've added this to PR #16206
[BEAM-13343] Add cmd for running go unit tests
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
R: @username).[BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replaceBEAM-XXXwith the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.CHANGES.mdwith noteworthy changes.See the Contributor Guide for more tips on how to make review process smoother.
ValidatesRunnercompliance status (on master branch)Examples testing status on various runners
Post-Commit SDK/Transform Integration Tests Status (on master branch)
Pre-Commit Tests Status (on master branch)
See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.
GitHub Actions Tests Status (on master branch)
See CI.md for more information about GitHub Actions CI.