Skip to content

Conversation

@daria-malkova
Copy link
Contributor

[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:

  • Choose reviewer(s) and mention them in a comment (R: @username).
  • Format the pull request title like [BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replace BEAM-XXX with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

ValidatesRunner compliance status (on master branch)

Lang ULR Dataflow Flink Samza Spark Twister2
Go --- Build Status Build Status Build Status Build Status ---
Java Build Status Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Python --- Build Status
Build Status
Build Status
Build Status
Build Status
Build Status Build Status ---
XLang Build Status Build Status Build Status Build Status Build Status ---

Examples testing status on various runners

Lang ULR Dataflow Flink Samza Spark Twister2
Go --- --- --- --- --- --- ---
Java --- Build Status
Build Status
Build Status
--- --- --- --- ---
Python --- --- --- --- --- --- ---
XLang --- --- --- --- --- --- ---

Post-Commit SDK/Transform Integration Tests Status (on master branch)

Go Java Python
Build Status Build Status Build Status
Build Status
Build Status

Pre-Commit Tests Status (on master branch)

--- Java Python Go Website Whitespace Typescript
Non-portable Build Status
Build Status
Build Status
Build Status
Build Status
Build Status Build Status Build Status Build Status
Portable --- Build Status Build Status --- --- ---

See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests

See CI.md for more information about GitHub Actions CI.

@daria-malkova
Copy link
Contributor Author

daria-malkova commented Dec 6, 2021

@daria-malkova daria-malkova force-pushed the BEAM-13343-support-go-unit-tests branch from 3836593 to 43d0a24 Compare December 6, 2021 12:28
Copy link
Contributor

@KhaninArtur KhaninArtur left a 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

@daria-malkova daria-malkova force-pushed the BEAM-13343-support-go-unit-tests branch 2 times, most recently from a02a295 to e72f3a7 Compare December 7, 2021 08:13
@daria-malkova daria-malkova force-pushed the BEAM-13343-support-go-unit-tests branch from e72f3a7 to 61fb10d Compare December 7, 2021 18:54
Comment on lines 134 to 145
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@daria-malkova daria-malkova force-pushed the BEAM-13343-support-go-unit-tests branch from 6a5a2d6 to 6c87b92 Compare December 8, 2021 12:47
daria-malkova added 2 commits December 8, 2021 15:51
# 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
@daria-malkova daria-malkova force-pushed the BEAM-13343-support-go-unit-tests branch from 12dac8b to d1b5af7 Compare December 8, 2021 13:04
daria-malkova and others added 2 commits December 9, 2021 11:12
ENTRYPOINT ["/opt/playground/backend/server_go_backend"]


ENTRYPOINT ["/opt/playground/backend/server_go_backend"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add an empty string.

Comment on lines +91 to +96
// Check if unit test
isUnitTest := false
valResult, ok := validationResults.Load(validators.UnitTestValidatorName)
if ok && valResult.(bool) {
isUnitTest = true
}
Copy link
Contributor

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"
Copy link
Contributor

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?

Copy link
Member

@pabloem pabloem left a 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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
valResult, ok := validationResults.Load(validators.UnitTestValidatorName)
validateIsUnitTest, ok := validationResults.Load(validators.UnitTestValidatorName)

"testing"
)

func TestMain(m *testing.M) {
Copy link
Member

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?)

Copy link
Contributor Author

@daria-malkova daria-malkova Dec 13, 2021

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

@pabloem pabloem merged commit 1d55577 into apache:master Dec 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants