[
https://issues.apache.org/jira/browse/BEAM-8586?focusedWorklogId=346913&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-346913
]
ASF GitHub Bot logged work on BEAM-8586:
----------------------------------------
Author: ASF GitHub Bot
Created on: 20/Nov/19 18:16
Start Date: 20/Nov/19 18:16
Worklog Time Spent: 10m
Work Description: 11moon11 commented on pull request #10061: [BEAM-8586]
[SQL] Fix MongoDb integration tests
URL: https://github.com/apache/beam/pull/10061#discussion_r348667820
##########
File path:
sdks/java/extensions/sql/src/test/java/org/apache/beam/sdk/extensions/sql/meta/provider/mongodb/MongoDbReadWriteIT.java
##########
@@ -87,24 +104,51 @@
private static final String collection = "collection";
private static MongoDBPipelineOptions options;
+ @ClassRule public static final TemporaryFolder MONGODB_LOCATION = new
TemporaryFolder();
+
+ private static final MongodStarter mongodStarter =
MongodStarter.getDefaultInstance();
+ private static MongodExecutable mongodExecutable;
+ private static MongodProcess mongodProcess;
+ private static MongoClient client;
+
@Rule public final TestPipeline writePipeline = TestPipeline.create();
@Rule public final TestPipeline readPipeline = TestPipeline.create();
@BeforeClass
public static void setUp() throws Exception {
+ int port = NetworkTestHelper.getAvailableLocalPort();
+ LOG.info("Starting MongoDB embedded instance on {}", port);
+ IMongodConfig mongodConfig =
+ new MongodConfigBuilder()
+ .version(Version.Main.PRODUCTION)
+ .configServer(false)
+ .replication(new Storage(MONGODB_LOCATION.getRoot().getPath(),
null, 0))
+ .net(new Net("localhost", port, Network.localhostIsIPv6()))
+ .cmdOptions(
+ new MongoCmdOptionsBuilder()
+ .syncDelay(10)
+ .useNoPrealloc(true)
+ .useSmallFiles(true)
+ .useNoJournal(true)
+ .verbose(false)
+ .build())
+ .build();
+ mongodExecutable = mongodStarter.prepare(mongodConfig);
+ mongodProcess = mongodExecutable.start();
+ client = new MongoClient("localhost", port);
+
PipelineOptionsFactory.register(MongoDBPipelineOptions.class);
options =
TestPipeline.testingPipelineOptions().as(MongoDBPipelineOptions.class);
+ options.setMongoDBHostName("localhost");
+ options.setMongoDBPort(port);
Review comment:
Yes, it's not an option anymore to pass pipeline options anymore. Updated
the JavaDoc string and got rid of pipeline options.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 346913)
Time Spent: 1h 10m (was: 1h)
> [SQL] Add a server for MongoDb Integration Test
> -----------------------------------------------
>
> Key: BEAM-8586
> URL: https://issues.apache.org/jira/browse/BEAM-8586
> Project: Beam
> Issue Type: Test
> Components: dsl-sql
> Reporter: Kirill Kozlov
> Priority: Minor
> Time Spent: 1h 10m
> Remaining Estimate: 0h
>
> We need to pass pipeline options with server information to the
> MongoDbReadWriteIT.
> For now that test is ignored and excluded from the build.gradle file.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)