You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/03/03 17:51:57 UTC
[GitHub] [beam] riteshghorse opened a new pull request #17003: [BEAM-13893] improved coverage of jobopts package
riteshghorse opened a new pull request #17003:
URL: https://github.com/apache/beam/pull/17003
Improved coverage of jobopts package. Part of effort to improve code coverage of Go SDK.
------------------------
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
- [ ] [**Choose reviewer(s)**](https://beam.apache.org/contribute/#make-your-change) 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](https://www.apache.org/licenses/icla.pdf).
See the [Contributor Guide](https://beam.apache.org/contribute) for more tips on [how to make review process smoother](https://beam.apache.org/contribute/#make-reviewers-job-easier).
To check the build health, please visit [https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md](https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md)
GitHub Actions Tests Status (on master branch)
------------------------------------------------------------------------------------------------
[![Build python source distribution and wheels](https://github.com/apache/beam/workflows/Build%20python%20source%20distribution%20and%20wheels/badge.svg?branch=master&event=schedule)](https://github.com/apache/beam/actions?query=workflow%3A%22Build+python+source+distribution+and+wheels%22+branch%3Amaster+event%3Aschedule)
[![Python tests](https://github.com/apache/beam/workflows/Python%20tests/badge.svg?branch=master&event=schedule)](https://github.com/apache/beam/actions?query=workflow%3A%22Python+Tests%22+branch%3Amaster+event%3Aschedule)
[![Java tests](https://github.com/apache/beam/workflows/Java%20Tests/badge.svg?branch=master&event=schedule)](https://github.com/apache/beam/actions?query=workflow%3A%22Java+Tests%22+branch%3Amaster+event%3Aschedule)
See [CI.md](https://github.com/apache/beam/blob/master/CI.md) for more information about GitHub Actions CI.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] codecov[bot] edited a comment on pull request #17003: [BEAM-13893] improved coverage of jobopts package
Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #17003:
URL: https://github.com/apache/beam/pull/17003#issuecomment-1058323430
# [Codecov](https://codecov.io/gh/apache/beam/pull/17003?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#17003](https://codecov.io/gh/apache/beam/pull/17003?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (69b7070) into [master](https://codecov.io/gh/apache/beam/commit/06e7c201dbdd8fe37d308b0bad2b1684e85e1dc7?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (06e7c20) will **increase** coverage by `0.05%`.
> The diff coverage is `100.00%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/17003/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/beam/pull/17003?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #17003 +/- ##
==========================================
+ Coverage 73.83% 73.88% +0.05%
==========================================
Files 664 669 +5
Lines 87272 87502 +230
==========================================
+ Hits 64434 64648 +214
- Misses 21735 21743 +8
- Partials 1103 1111 +8
```
| Flag | Coverage Δ | |
|---|---|---|
| go | `49.40% <100.00%> (+0.40%)` | :arrow_up: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/beam/pull/17003?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [sdks/go/pkg/beam/options/jobopts/options.go](https://codecov.io/gh/apache/beam/pull/17003/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9nby9wa2cvYmVhbS9vcHRpb25zL2pvYm9wdHMvb3B0aW9ucy5nbw==) | `87.27% <100.00%> (ø)` | |
| [sdks/go/pkg/beam/core/runtime/exec/plan.go](https://codecov.io/gh/apache/beam/pull/17003/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9nby9wa2cvYmVhbS9jb3JlL3J1bnRpbWUvZXhlYy9wbGFuLmdv) | `48.61% <0.00%> (-8.80%)` | :arrow_down: |
| [sdks/go/pkg/beam/core/runtime/harness/harness.go](https://codecov.io/gh/apache/beam/pull/17003/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9nby9wa2cvYmVhbS9jb3JlL3J1bnRpbWUvaGFybmVzcy9oYXJuZXNzLmdv) | `11.26% <0.00%> (-1.43%)` | :arrow_down: |
| [sdks/go/pkg/beam/runners/direct/buffer.go](https://codecov.io/gh/apache/beam/pull/17003/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9nby9wa2cvYmVhbS9ydW5uZXJzL2RpcmVjdC9idWZmZXIuZ28=) | `77.46% <0.00%> (ø)` | |
| [sdks/go/pkg/beam/core/runtime/exec/pardo.go](https://codecov.io/gh/apache/beam/pull/17003/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9nby9wa2cvYmVhbS9jb3JlL3J1bnRpbWUvZXhlYy9wYXJkby5nbw==) | `50.45% <0.00%> (ø)` | |
| [sdks/go/pkg/beam/core/graph/window/windows.go](https://codecov.io/gh/apache/beam/pull/17003/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9nby9wa2cvYmVhbS9jb3JlL2dyYXBoL3dpbmRvdy93aW5kb3dzLmdv) | `82.60% <0.00%> (ø)` | |
| [sdks/go/pkg/beam/core/graph/window/fn.go](https://codecov.io/gh/apache/beam/pull/17003/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9nby9wa2cvYmVhbS9jb3JlL2dyYXBoL3dpbmRvdy9mbi5nbw==) | `53.84% <0.00%> (ø)` | |
| [sdks/go/pkg/beam/core/graph/window/strategy.go](https://codecov.io/gh/apache/beam/pull/17003/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9nby9wa2cvYmVhbS9jb3JlL2dyYXBoL3dpbmRvdy9zdHJhdGVneS5nbw==) | `0.00% <0.00%> (ø)` | |
| [sdks/go/pkg/beam/options/jobopts/stringSlice.go](https://codecov.io/gh/apache/beam/pull/17003/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9nby9wa2cvYmVhbS9vcHRpb25zL2pvYm9wdHMvc3RyaW5nU2xpY2UuZ28=) | `71.42% <0.00%> (ø)` | |
| ... and [6 more](https://codecov.io/gh/apache/beam/pull/17003/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/17003?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/17003?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [06e7c20...69b7070](https://codecov.io/gh/apache/beam/pull/17003?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] codecov[bot] edited a comment on pull request #17003: [BEAM-13893] improved coverage of jobopts package
Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #17003:
URL: https://github.com/apache/beam/pull/17003#issuecomment-1058323430
# [Codecov](https://codecov.io/gh/apache/beam/pull/17003?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#17003](https://codecov.io/gh/apache/beam/pull/17003?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (69b7070) into [master](https://codecov.io/gh/apache/beam/commit/06e7c201dbdd8fe37d308b0bad2b1684e85e1dc7?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (06e7c20) will **increase** coverage by `0.05%`.
> The diff coverage is `100.00%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/17003/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/beam/pull/17003?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #17003 +/- ##
==========================================
+ Coverage 73.83% 73.88% +0.05%
==========================================
Files 664 669 +5
Lines 87272 87502 +230
==========================================
+ Hits 64434 64648 +214
- Misses 21735 21743 +8
- Partials 1103 1111 +8
```
| Flag | Coverage Δ | |
|---|---|---|
| go | `49.40% <100.00%> (+0.40%)` | :arrow_up: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/beam/pull/17003?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [sdks/go/pkg/beam/options/jobopts/options.go](https://codecov.io/gh/apache/beam/pull/17003/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9nby9wa2cvYmVhbS9vcHRpb25zL2pvYm9wdHMvb3B0aW9ucy5nbw==) | `87.27% <100.00%> (ø)` | |
| [sdks/go/pkg/beam/core/runtime/exec/plan.go](https://codecov.io/gh/apache/beam/pull/17003/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9nby9wa2cvYmVhbS9jb3JlL3J1bnRpbWUvZXhlYy9wbGFuLmdv) | `48.61% <0.00%> (-8.80%)` | :arrow_down: |
| [sdks/go/pkg/beam/core/runtime/harness/harness.go](https://codecov.io/gh/apache/beam/pull/17003/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9nby9wa2cvYmVhbS9jb3JlL3J1bnRpbWUvaGFybmVzcy9oYXJuZXNzLmdv) | `11.26% <0.00%> (-1.43%)` | :arrow_down: |
| [sdks/go/pkg/beam/runners/direct/buffer.go](https://codecov.io/gh/apache/beam/pull/17003/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9nby9wa2cvYmVhbS9ydW5uZXJzL2RpcmVjdC9idWZmZXIuZ28=) | `77.46% <0.00%> (ø)` | |
| [sdks/go/pkg/beam/core/runtime/exec/pardo.go](https://codecov.io/gh/apache/beam/pull/17003/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9nby9wa2cvYmVhbS9jb3JlL3J1bnRpbWUvZXhlYy9wYXJkby5nbw==) | `50.45% <0.00%> (ø)` | |
| [sdks/go/pkg/beam/core/graph/window/strategy.go](https://codecov.io/gh/apache/beam/pull/17003/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9nby9wa2cvYmVhbS9jb3JlL2dyYXBoL3dpbmRvdy9zdHJhdGVneS5nbw==) | `0.00% <0.00%> (ø)` | |
| [sdks/go/pkg/beam/core/graph/window/windows.go](https://codecov.io/gh/apache/beam/pull/17003/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9nby9wa2cvYmVhbS9jb3JlL2dyYXBoL3dpbmRvdy93aW5kb3dzLmdv) | `82.60% <0.00%> (ø)` | |
| [sdks/go/pkg/beam/options/jobopts/stringSlice.go](https://codecov.io/gh/apache/beam/pull/17003/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9nby9wa2cvYmVhbS9vcHRpb25zL2pvYm9wdHMvc3RyaW5nU2xpY2UuZ28=) | `71.42% <0.00%> (ø)` | |
| [sdks/go/pkg/beam/core/graph/window/fn.go](https://codecov.io/gh/apache/beam/pull/17003/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9nby9wa2cvYmVhbS9jb3JlL2dyYXBoL3dpbmRvdy9mbi5nbw==) | `53.84% <0.00%> (ø)` | |
| ... and [6 more](https://codecov.io/gh/apache/beam/pull/17003/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/17003?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/17003?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [06e7c20...69b7070](https://codecov.io/gh/apache/beam/pull/17003?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] riteshghorse commented on a change in pull request #17003: [BEAM-13893] improved coverage of jobopts package
Posted by GitBox <gi...@apache.org>.
riteshghorse commented on a change in pull request #17003:
URL: https://github.com/apache/beam/pull/17003#discussion_r818965402
##########
File path: sdks/go/pkg/beam/options/jobopts/options_test.go
##########
@@ -0,0 +1,122 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package jobopts
+
+import (
+ "context"
+ "reflect"
+ "strings"
+ "testing"
+
+ "github.com/apache/beam/sdks/v2/go/pkg/beam/core"
+)
+
+func TestGetEndpoint(t *testing.T) {
+ address := "localhost:8099"
+ Endpoint = &address
+ if v, err := GetEndpoint(); err == nil {
Review comment:
Make sense.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] codecov[bot] edited a comment on pull request #17003: [BEAM-13893] improved coverage of jobopts package
Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #17003:
URL: https://github.com/apache/beam/pull/17003#issuecomment-1058323430
# [Codecov](https://codecov.io/gh/apache/beam/pull/17003?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#17003](https://codecov.io/gh/apache/beam/pull/17003?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (cc7a89a) into [master](https://codecov.io/gh/apache/beam/commit/06e7c201dbdd8fe37d308b0bad2b1684e85e1dc7?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (06e7c20) will **increase** coverage by `0.00%`.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/17003/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/beam/pull/17003?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #17003 +/- ##
=======================================
Coverage 73.83% 73.83%
=======================================
Files 664 666 +2
Lines 87272 87334 +62
=======================================
+ Hits 64434 64483 +49
- Misses 21735 21748 +13
Partials 1103 1103
```
| Flag | Coverage Δ | |
|---|---|---|
| go | `49.07% <ø> (+0.07%)` | :arrow_up: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/beam/pull/17003?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [sdks/go/pkg/beam/options/jobopts/options.go](https://codecov.io/gh/apache/beam/pull/17003/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9nby9wa2cvYmVhbS9vcHRpb25zL2pvYm9wdHMvb3B0aW9ucy5nbw==) | `80.00% <0.00%> (ø)` | |
| [sdks/go/pkg/beam/options/jobopts/stringSlice.go](https://codecov.io/gh/apache/beam/pull/17003/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9nby9wa2cvYmVhbS9vcHRpb25zL2pvYm9wdHMvc3RyaW5nU2xpY2UuZ28=) | `71.42% <0.00%> (ø)` | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/17003?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/17003?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [06e7c20...cc7a89a](https://codecov.io/gh/apache/beam/pull/17003?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] riteshghorse commented on pull request #17003: [BEAM-13893] improved coverage of jobopts package
Posted by GitBox <gi...@apache.org>.
riteshghorse commented on pull request #17003:
URL: https://github.com/apache/beam/pull/17003#issuecomment-1058322869
R: @jrmccluskey @damccorm
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] youngoli merged pull request #17003: [BEAM-13893] improved coverage of jobopts package
Posted by GitBox <gi...@apache.org>.
youngoli merged pull request #17003:
URL: https://github.com/apache/beam/pull/17003
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] codecov[bot] edited a comment on pull request #17003: [BEAM-13893] improved coverage of jobopts package
Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #17003:
URL: https://github.com/apache/beam/pull/17003#issuecomment-1058323430
# [Codecov](https://codecov.io/gh/apache/beam/pull/17003?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#17003](https://codecov.io/gh/apache/beam/pull/17003?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (cc7a89a) into [master](https://codecov.io/gh/apache/beam/commit/06e7c201dbdd8fe37d308b0bad2b1684e85e1dc7?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (06e7c20) will **increase** coverage by `0.00%`.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/17003/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/beam/pull/17003?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #17003 +/- ##
=======================================
Coverage 73.83% 73.83%
=======================================
Files 664 666 +2
Lines 87272 87334 +62
=======================================
+ Hits 64434 64483 +49
- Misses 21735 21748 +13
Partials 1103 1103
```
| Flag | Coverage Δ | |
|---|---|---|
| go | `49.07% <ø> (+0.07%)` | :arrow_up: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/beam/pull/17003?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [sdks/go/pkg/beam/options/jobopts/stringSlice.go](https://codecov.io/gh/apache/beam/pull/17003/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9nby9wa2cvYmVhbS9vcHRpb25zL2pvYm9wdHMvc3RyaW5nU2xpY2UuZ28=) | `71.42% <0.00%> (ø)` | |
| [sdks/go/pkg/beam/options/jobopts/options.go](https://codecov.io/gh/apache/beam/pull/17003/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9nby9wa2cvYmVhbS9vcHRpb25zL2pvYm9wdHMvb3B0aW9ucy5nbw==) | `80.00% <0.00%> (ø)` | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/17003?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/17003?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [06e7c20...cc7a89a](https://codecov.io/gh/apache/beam/pull/17003?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] riteshghorse commented on pull request #17003: [BEAM-13893] improved coverage of jobopts package
Posted by GitBox <gi...@apache.org>.
riteshghorse commented on pull request #17003:
URL: https://github.com/apache/beam/pull/17003#issuecomment-1058568396
R: @youngoli
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] codecov[bot] edited a comment on pull request #17003: [BEAM-13893] improved coverage of jobopts package
Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #17003:
URL: https://github.com/apache/beam/pull/17003#issuecomment-1058323430
# [Codecov](https://codecov.io/gh/apache/beam/pull/17003?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#17003](https://codecov.io/gh/apache/beam/pull/17003?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (21e4eb5) into [master](https://codecov.io/gh/apache/beam/commit/06e7c201dbdd8fe37d308b0bad2b1684e85e1dc7?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (06e7c20) will **increase** coverage by `0.00%`.
> The diff coverage is `n/a`.
> :exclamation: Current head 21e4eb5 differs from pull request most recent head cc7a89a. Consider uploading reports for the commit cc7a89a to get more accurate results
[![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/17003/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/beam/pull/17003?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #17003 +/- ##
=======================================
Coverage 73.83% 73.83%
=======================================
Files 664 666 +2
Lines 87272 87334 +62
=======================================
+ Hits 64434 64483 +49
- Misses 21735 21748 +13
Partials 1103 1103
```
| Flag | Coverage Δ | |
|---|---|---|
| go | `49.07% <ø> (+0.07%)` | :arrow_up: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/beam/pull/17003?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [sdks/go/pkg/beam/options/jobopts/options.go](https://codecov.io/gh/apache/beam/pull/17003/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9nby9wa2cvYmVhbS9vcHRpb25zL2pvYm9wdHMvb3B0aW9ucy5nbw==) | `80.00% <0.00%> (ø)` | |
| [sdks/go/pkg/beam/options/jobopts/stringSlice.go](https://codecov.io/gh/apache/beam/pull/17003/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9nby9wa2cvYmVhbS9vcHRpb25zL2pvYm9wdHMvc3RyaW5nU2xpY2UuZ28=) | `71.42% <0.00%> (ø)` | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/17003?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/17003?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [06e7c20...cc7a89a](https://codecov.io/gh/apache/beam/pull/17003?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] youngoli merged pull request #17003: [BEAM-13893] improved coverage of jobopts package
Posted by GitBox <gi...@apache.org>.
youngoli merged pull request #17003:
URL: https://github.com/apache/beam/pull/17003
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] youngoli commented on a change in pull request #17003: [BEAM-13893] improved coverage of jobopts package
Posted by GitBox <gi...@apache.org>.
youngoli commented on a change in pull request #17003:
URL: https://github.com/apache/beam/pull/17003#discussion_r821099752
##########
File path: sdks/go/pkg/beam/options/jobopts/options_test.go
##########
@@ -0,0 +1,122 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package jobopts
+
+import (
+ "context"
+ "reflect"
+ "strings"
+ "testing"
+
+ "github.com/apache/beam/sdks/v2/go/pkg/beam/core"
+)
+
+func TestGetEndpoint(t *testing.T) {
+ address := "localhost:8099"
+ Endpoint = &address
+ v, err := GetEndpoint()
+ if err != nil {
+ t.Fatalf("unexpected error GetEndpoint(): %v", err)
+ }
+ if v != address {
+ t.Errorf("GetEndpoint() = %v, want %v", v, address)
+ }
+}
+
+func TestGetEndpoint_Bad(t *testing.T) {
+ address := ""
+ Endpoint = &address
+ expectedErr := "no job service endpoint specified. Use --endpoint=<endpoint>"
Review comment:
If you're going to test the error, I would strongly recommend against string comparison. I recommend creating a custom error type and returning that, and then in the test do type assertion to see if it matches that type. (Example here: https://quii.gitbook.io/learn-go-with-tests/questions-and-answers/error-types)
In this case, it doesn't even have to be a custom struct. You can just do something like `type missingFlagError error`. Then return the error as that new type and type assert here.
(As an aside, I think it's strange that this one function specifically returns an error while all the others just return the empty values, but it's too late to change that now.)
##########
File path: sdks/go/pkg/beam/options/jobopts/options_test.go
##########
@@ -0,0 +1,122 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package jobopts
+
+import (
+ "context"
+ "reflect"
+ "strings"
+ "testing"
+
+ "github.com/apache/beam/sdks/v2/go/pkg/beam/core"
+)
+
+func TestGetEndpoint(t *testing.T) {
+ address := "localhost:8099"
+ Endpoint = &address
+ v, err := GetEndpoint()
+ if err != nil {
+ t.Fatalf("unexpected error GetEndpoint(): %v", err)
+ }
+ if v != address {
+ t.Errorf("GetEndpoint() = %v, want %v", v, address)
+ }
+}
+
+func TestGetEndpoint_Bad(t *testing.T) {
+ address := ""
+ Endpoint = &address
+ expectedErr := "no job service endpoint specified. Use --endpoint=<endpoint>"
+ if _, err := GetEndpoint(); err == nil {
+ t.Errorf("GetEndpoint() executed incorrectly, expected error: %v", expectedErr)
+ }
+}
+
+func TestGetJobName(t *testing.T) {
+ tests := []struct {
+ jobname string
+ wantName string
+ }{
+ {
+ "",
+ "go-job-",
+ },
+ {
+ "go-job-example",
+ "go-job-example",
+ },
+ }
+ for _, test := range tests {
+ JobName = &test.jobname
+ if got := GetJobName(); !strings.Contains(got, test.wantName) {
+ t.Errorf("GetJobName() = %v, want %v", got, test.wantName)
+ }
+ }
+}
+
+func TestGetEnvironamentUrn(t *testing.T) {
+ tests := []struct {
+ env string
+ urn string
+ }{
Review comment:
Since this is for coverage I think you should test each type of possible env to use as input. Or at the very least, add "DOCKER" there (since I see only "docker" and "loopback" are actually documented in the flag description).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] damccorm commented on pull request #17003: [BEAM-13893] improved coverage of jobopts package
Posted by GitBox <gi...@apache.org>.
damccorm commented on pull request #17003:
URL: https://github.com/apache/beam/pull/17003#issuecomment-1058356060
> Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control
I'm considering getting rid of that message - thoughts on the current experience? I could always add a label (something like `pr-bot-disabled`) instead. The advantage of keeping it is that it nudges people towards using the new experience.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] codecov[bot] edited a comment on pull request #17003: [BEAM-13893] improved coverage of jobopts package
Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #17003:
URL: https://github.com/apache/beam/pull/17003#issuecomment-1058323430
# [Codecov](https://codecov.io/gh/apache/beam/pull/17003?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#17003](https://codecov.io/gh/apache/beam/pull/17003?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (21e4eb5) into [master](https://codecov.io/gh/apache/beam/commit/06e7c201dbdd8fe37d308b0bad2b1684e85e1dc7?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (06e7c20) will **increase** coverage by `0.00%`.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/17003/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/beam/pull/17003?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #17003 +/- ##
=======================================
Coverage 73.83% 73.83%
=======================================
Files 664 666 +2
Lines 87272 87334 +62
=======================================
+ Hits 64434 64483 +49
- Misses 21735 21748 +13
Partials 1103 1103
```
| Flag | Coverage Δ | |
|---|---|---|
| go | `49.07% <ø> (+0.07%)` | :arrow_up: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/beam/pull/17003?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [sdks/go/pkg/beam/options/jobopts/stringSlice.go](https://codecov.io/gh/apache/beam/pull/17003/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9nby9wa2cvYmVhbS9vcHRpb25zL2pvYm9wdHMvc3RyaW5nU2xpY2UuZ28=) | `71.42% <0.00%> (ø)` | |
| [sdks/go/pkg/beam/options/jobopts/options.go](https://codecov.io/gh/apache/beam/pull/17003/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9nby9wa2cvYmVhbS9vcHRpb25zL2pvYm9wdHMvb3B0aW9ucy5nbw==) | `80.00% <0.00%> (ø)` | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/17003?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/17003?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [06e7c20...21e4eb5](https://codecov.io/gh/apache/beam/pull/17003?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] riteshghorse commented on a change in pull request #17003: [BEAM-13893] improved coverage of jobopts package
Posted by GitBox <gi...@apache.org>.
riteshghorse commented on a change in pull request #17003:
URL: https://github.com/apache/beam/pull/17003#discussion_r818965402
##########
File path: sdks/go/pkg/beam/options/jobopts/options_test.go
##########
@@ -0,0 +1,122 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package jobopts
+
+import (
+ "context"
+ "reflect"
+ "strings"
+ "testing"
+
+ "github.com/apache/beam/sdks/v2/go/pkg/beam/core"
+)
+
+func TestGetEndpoint(t *testing.T) {
+ address := "localhost:8099"
+ Endpoint = &address
+ if v, err := GetEndpoint(); err == nil {
Review comment:
Makes sense.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] riteshghorse commented on pull request #17003: [BEAM-13893] improved coverage of jobopts package
Posted by GitBox <gi...@apache.org>.
riteshghorse commented on pull request #17003:
URL: https://github.com/apache/beam/pull/17003#issuecomment-1058374294
> > Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control
>
> I'm considering getting rid of that message - thoughts on the current experience? I could always add a label (something like `pr-bot-disabled`) instead. The advantage of keeping it is that it nudges people towards using the new experience.
I don't mind getting that message. It makes folks aware that such bot exists (I wanted to try the bot but the habit of tagging reviewers kicked in earlier:P).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] codecov[bot] commented on pull request #17003: [BEAM-13893] improved coverage of jobopts package
Posted by GitBox <gi...@apache.org>.
codecov[bot] commented on pull request #17003:
URL: https://github.com/apache/beam/pull/17003#issuecomment-1058323430
# [Codecov](https://codecov.io/gh/apache/beam/pull/17003?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#17003](https://codecov.io/gh/apache/beam/pull/17003?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (21e4eb5) into [master](https://codecov.io/gh/apache/beam/commit/06e7c201dbdd8fe37d308b0bad2b1684e85e1dc7?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (06e7c20) will **increase** coverage by `0.00%`.
> The diff coverage is `n/a`.
[![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/17003/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/beam/pull/17003?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #17003 +/- ##
=======================================
Coverage 73.83% 73.83%
=======================================
Files 664 666 +2
Lines 87272 87334 +62
=======================================
+ Hits 64434 64483 +49
- Misses 21735 21748 +13
Partials 1103 1103
```
| Flag | Coverage Δ | |
|---|---|---|
| go | `49.07% <ø> (+0.07%)` | :arrow_up: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/beam/pull/17003?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [sdks/go/pkg/beam/options/jobopts/options.go](https://codecov.io/gh/apache/beam/pull/17003/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9nby9wa2cvYmVhbS9vcHRpb25zL2pvYm9wdHMvb3B0aW9ucy5nbw==) | `80.00% <0.00%> (ø)` | |
| [sdks/go/pkg/beam/options/jobopts/stringSlice.go](https://codecov.io/gh/apache/beam/pull/17003/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9nby9wa2cvYmVhbS9vcHRpb25zL2pvYm9wdHMvc3RyaW5nU2xpY2UuZ28=) | `71.42% <0.00%> (ø)` | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/17003?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/17003?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [06e7c20...21e4eb5](https://codecov.io/gh/apache/beam/pull/17003?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] github-actions[bot] commented on pull request #17003: [BEAM-13893] improved coverage of jobopts package
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #17003:
URL: https://github.com/apache/beam/pull/17003#issuecomment-1058323266
Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] jrmccluskey commented on a change in pull request #17003: [BEAM-13893] improved coverage of jobopts package
Posted by GitBox <gi...@apache.org>.
jrmccluskey commented on a change in pull request #17003:
URL: https://github.com/apache/beam/pull/17003#discussion_r818952248
##########
File path: sdks/go/pkg/beam/options/jobopts/options_test.go
##########
@@ -0,0 +1,122 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package jobopts
+
+import (
+ "context"
+ "reflect"
+ "strings"
+ "testing"
+
+ "github.com/apache/beam/sdks/v2/go/pkg/beam/core"
+)
+
+func TestGetEndpoint(t *testing.T) {
+ address := "localhost:8099"
+ Endpoint = &address
+ if v, err := GetEndpoint(); err == nil {
Review comment:
This is such a small nit, but I think the cleaner way to handle this is
```
v, err := GetEndpoint()
if err != nil {
t.Fatalf("unexpected error GetEndpoint(): %v", err)
}
if v != address {
t.Errorf("GetEndpoint() = %v, want %v", v, address)
}
```
It flows a little more and reads easier at a glance to me, especially when that pattern is applied to a more involved test.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] riteshghorse commented on a change in pull request #17003: [BEAM-13893] improved coverage of jobopts package
Posted by GitBox <gi...@apache.org>.
riteshghorse commented on a change in pull request #17003:
URL: https://github.com/apache/beam/pull/17003#discussion_r823854482
##########
File path: sdks/go/pkg/beam/options/jobopts/options_test.go
##########
@@ -0,0 +1,122 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package jobopts
+
+import (
+ "context"
+ "reflect"
+ "strings"
+ "testing"
+
+ "github.com/apache/beam/sdks/v2/go/pkg/beam/core"
+)
+
+func TestGetEndpoint(t *testing.T) {
+ address := "localhost:8099"
+ Endpoint = &address
+ v, err := GetEndpoint()
+ if err != nil {
+ t.Fatalf("unexpected error GetEndpoint(): %v", err)
+ }
+ if v != address {
+ t.Errorf("GetEndpoint() = %v, want %v", v, address)
+ }
+}
+
+func TestGetEndpoint_Bad(t *testing.T) {
+ address := ""
+ Endpoint = &address
+ expectedErr := "no job service endpoint specified. Use --endpoint=<endpoint>"
Review comment:
Done
##########
File path: sdks/go/pkg/beam/options/jobopts/options_test.go
##########
@@ -0,0 +1,122 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package jobopts
+
+import (
+ "context"
+ "reflect"
+ "strings"
+ "testing"
+
+ "github.com/apache/beam/sdks/v2/go/pkg/beam/core"
+)
+
+func TestGetEndpoint(t *testing.T) {
+ address := "localhost:8099"
+ Endpoint = &address
+ v, err := GetEndpoint()
+ if err != nil {
+ t.Fatalf("unexpected error GetEndpoint(): %v", err)
+ }
+ if v != address {
+ t.Errorf("GetEndpoint() = %v, want %v", v, address)
+ }
+}
+
+func TestGetEndpoint_Bad(t *testing.T) {
+ address := ""
+ Endpoint = &address
+ expectedErr := "no job service endpoint specified. Use --endpoint=<endpoint>"
+ if _, err := GetEndpoint(); err == nil {
+ t.Errorf("GetEndpoint() executed incorrectly, expected error: %v", expectedErr)
+ }
+}
+
+func TestGetJobName(t *testing.T) {
+ tests := []struct {
+ jobname string
+ wantName string
+ }{
+ {
+ "",
+ "go-job-",
+ },
+ {
+ "go-job-example",
+ "go-job-example",
+ },
+ }
+ for _, test := range tests {
+ JobName = &test.jobname
+ if got := GetJobName(); !strings.Contains(got, test.wantName) {
+ t.Errorf("GetJobName() = %v, want %v", got, test.wantName)
+ }
+ }
+}
+
+func TestGetEnvironamentUrn(t *testing.T) {
+ tests := []struct {
+ env string
+ urn string
+ }{
Review comment:
Done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] codecov[bot] edited a comment on pull request #17003: [BEAM-13893] improved coverage of jobopts package
Posted by GitBox <gi...@apache.org>.
codecov[bot] edited a comment on pull request #17003:
URL: https://github.com/apache/beam/pull/17003#issuecomment-1058323430
# [Codecov](https://codecov.io/gh/apache/beam/pull/17003?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#17003](https://codecov.io/gh/apache/beam/pull/17003?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (cc7a89a) into [master](https://codecov.io/gh/apache/beam/commit/06e7c201dbdd8fe37d308b0bad2b1684e85e1dc7?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (06e7c20) will **increase** coverage by `0.00%`.
> The diff coverage is `n/a`.
> :exclamation: Current head cc7a89a differs from pull request most recent head 69b7070. Consider uploading reports for the commit 69b7070 to get more accurate results
[![Impacted file tree graph](https://codecov.io/gh/apache/beam/pull/17003/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/beam/pull/17003?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #17003 +/- ##
=======================================
Coverage 73.83% 73.83%
=======================================
Files 664 666 +2
Lines 87272 87334 +62
=======================================
+ Hits 64434 64483 +49
- Misses 21735 21748 +13
Partials 1103 1103
```
| Flag | Coverage Δ | |
|---|---|---|
| go | `49.07% <ø> (+0.07%)` | :arrow_up: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/beam/pull/17003?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [sdks/go/pkg/beam/options/jobopts/stringSlice.go](https://codecov.io/gh/apache/beam/pull/17003/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9nby9wa2cvYmVhbS9vcHRpb25zL2pvYm9wdHMvc3RyaW5nU2xpY2UuZ28=) | `71.42% <0.00%> (ø)` | |
| [sdks/go/pkg/beam/options/jobopts/options.go](https://codecov.io/gh/apache/beam/pull/17003/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9nby9wa2cvYmVhbS9vcHRpb25zL2pvYm9wdHMvb3B0aW9ucy5nbw==) | `80.00% <0.00%> (ø)` | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/beam/pull/17003?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/beam/pull/17003?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [06e7c20...69b7070](https://codecov.io/gh/apache/beam/pull/17003?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org