Skip to content
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-1542] Add a possibility to pass a project that hosts Cloud Spanner instance. #8404

Merged
merged 1 commit into from Apr 29, 2019

Conversation

tvalentyn
Copy link
Contributor

@tvalentyn tvalentyn commented Apr 25, 2019

The PR Adds a possibility to pass a project that hosts Cloud Spanner instance to Cloud Spanner IO ITs. This is useful in test scenarios when Cloud Spanner instance lives in a different project than the one where test pipeline is executed.

If new option is not specified, the test keeps the existing behavior.

Post-Commit Tests Status (on master branch)

Lang SDK Apex Dataflow Flink Gearpump Samza Spark
Go Build Status --- --- --- --- --- ---
Java 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 --- --- ---

Pre-Commit Tests Status (on master branch)

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

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

@tvalentyn
Copy link
Contributor Author

tvalentyn commented Apr 25, 2019

R: @kennknowles, @chamikaramj

@tvalentyn tvalentyn force-pushed the spanner_it branch 2 times, most recently from 2a04c99 to 122b074 Compare April 26, 2019 19:22
@tvalentyn
Copy link
Contributor Author

Run Java PostCommit

@tvalentyn tvalentyn changed the title Add a possibility to pass a project that hosts Cloud Spanner instance. [BEAM-1542] Add a possibility to pass a project that hosts Cloud Spanner instance. Apr 29, 2019
@tvalentyn
Copy link
Contributor Author

@kennknowles, @chamikaramj could you help with the merge? Thank you.

Copy link
Contributor

@chamikaramj chamikaramj left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks.

@chamikaramj chamikaramj merged commit 6567f16 into apache:master Apr 29, 2019
@@ -61,6 +62,12 @@

/** Pipeline options for this test. */
public interface SpannerTestPipelineOptions extends TestPipelineOptions {
@Description("Project that hosts Spanner instance")
@Nullable
String getInstanceProjectId();
Copy link
Member

Choose a reason for hiding this comment

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

I am very slightly concerned, because pipeline options are a global namespace and this option does not have "spanner" in the name.

Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like this is only for integration tests ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. Do pipeline options defined in ITs pollute the global namespace, @kennknowles ?
If so, there are other options in this and other tests that this concern applies to.

Copy link
Member

Choose a reason for hiding this comment

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

As long as the PipelineOption interface isn't being registered via a ServiceLoader automatically, a call to PipelineOptionsFactory.resetCache() after each test in a @TearDown method will remove the pollution of the namespace. If it is being registered via serviceloader then people have to be careful around name choices/classpaths.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We call

PipelineOptionsFactory.register(SpannerTestPipelineOptions.class);

But I think, we don't have a registrar for these options, such as, say:

@tvalentyn tvalentyn deleted the spanner_it branch October 23, 2019 00:48
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.

None yet

5 participants