Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,7 @@ jobs:
- { modules: plugin/trino-mongodb }
- { modules: plugin/trino-mysql }
- { modules: plugin/trino-oracle }
- { modules: plugin/trino-oracle, profile: fte-tests }
Copy link
Member

Choose a reason for hiding this comment

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

please rebase on master and see a9aa9d0 to combine fte-tests together as normal module tests if they don't take very long to run.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated

Copy link
Member

Choose a reason for hiding this comment

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

So didn't it make sense to combine fte and non-fte tests?

Copy link
Member

Choose a reason for hiding this comment

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

Can be combined. It's 18m for normal test + 8min for FTE.

- { modules: plugin/trino-phoenix5 }
- { modules: plugin/trino-pinot }
- { modules: plugin/trino-postgresql }
Expand Down
52 changes: 52 additions & 0 deletions plugin/trino-oracle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,19 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>io.trino</groupId>
<artifactId>trino-exchange-filesystem</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>io.trino</groupId>
<artifactId>trino-exchange-filesystem</artifactId>
<type>test-jar</type>
<scope>test</scope>
</dependency>

<dependency>
<groupId>io.trino</groupId>
<artifactId>trino-main</artifactId>
Expand Down Expand Up @@ -208,4 +221,43 @@
<scope>test</scope>
</dependency>
</dependencies>

<profiles>
<profile>
<id>default</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes>
<exclude>**/Test*FailureRecoveryTest.java</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</profile>

<profile>
<id>fte-tests</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<includes>
<include>**/Test*FailureRecoveryTest.java</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ public OracleClient(
IdentifierMapping identifierMapping,
RemoteQueryModifier queryModifier)
{
super("\"", connectionFactory, queryBuilder, config.getJdbcTypesMappedToVarchar(), identifierMapping, queryModifier, false);
super("\"", connectionFactory, queryBuilder, config.getJdbcTypesMappedToVarchar(), identifierMapping, queryModifier, true);

this.synonymsEnabled = oracleConfig.isSynonymsEnabled();

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*
* Licensed 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 io.trino.plugin.oracle;

import com.google.common.collect.ImmutableMap;
import io.trino.operator.RetryPolicy;
import io.trino.plugin.exchange.filesystem.FileSystemExchangePlugin;
import io.trino.plugin.jdbc.BaseJdbcFailureRecoveryTest;
import io.trino.testing.QueryRunner;
import io.trino.tpch.TpchTable;

import java.util.List;
import java.util.Map;

import static io.trino.plugin.oracle.OracleQueryRunner.createOracleQueryRunner;
import static io.trino.plugin.oracle.TestingOracleServer.TEST_PASS;
import static io.trino.plugin.oracle.TestingOracleServer.TEST_USER;

public abstract class BaseOracleFailureRecoveryTest
extends BaseJdbcFailureRecoveryTest
{
public BaseOracleFailureRecoveryTest(RetryPolicy retryPolicy)
{
super(retryPolicy);
}

@Override
protected QueryRunner createQueryRunner(
List<TpchTable<?>> requiredTpchTables,
Map<String, String> configProperties,
Map<String, String> coordinatorProperties)
throws Exception
{
TestingOracleServer oracleServer = new TestingOracleServer();
return createOracleQueryRunner(
closeAfterClass(oracleServer),
configProperties,
coordinatorProperties,
ImmutableMap.<String, String>builder()
.put("connection-url", oracleServer.getJdbcUrl())
.put("connection-user", TEST_USER)
.put("connection-password", TEST_PASS)
.buildOrThrow(),
requiredTpchTables,
runner -> {
runner.installPlugin(new FileSystemExchangePlugin());
runner.loadExchangeManager("filesystem", ImmutableMap.of(
"exchange.base-directories", System.getProperty("java.io.tmpdir") + "/trino-local-file-system-exchange-manager"));
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@
import io.trino.Session;
import io.trino.plugin.tpch.TpchPlugin;
import io.trino.testing.DistributedQueryRunner;
import io.trino.testing.QueryRunner;
import io.trino.tpch.TpchTable;

import java.util.Map;
import java.util.function.Consumer;

import static io.airlift.testing.Closeables.closeAllSuppress;
import static io.trino.plugin.oracle.TestingOracleServer.TEST_PASS;
Expand All @@ -40,11 +42,25 @@ public static DistributedQueryRunner createOracleQueryRunner(
Map<String, String> connectorProperties,
Iterable<TpchTable<?>> tables)
throws Exception
{
return createOracleQueryRunner(server, extraProperties, Map.of(), connectorProperties, tables, queryRunner -> {});
}

public static DistributedQueryRunner createOracleQueryRunner(
TestingOracleServer server,
Map<String, String> extraProperties,
Map<String, String> coordinatorProperties,
Map<String, String> connectorProperties,
Iterable<TpchTable<?>> tables,
Consumer<QueryRunner> moreSetup)
throws Exception
{
DistributedQueryRunner queryRunner = null;
try {
queryRunner = DistributedQueryRunner.builder(createSession())
.setExtraProperties(extraProperties)
.setCoordinatorProperties(coordinatorProperties)
.setAdditionalSetup(moreSetup)
.build();

queryRunner.installPlugin(new TpchPlugin());
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Licensed 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 io.trino.plugin.oracle;

import io.trino.operator.RetryPolicy;

public class TestOracleQueryFailureRecoveryTest
extends BaseOracleFailureRecoveryTest
{
public TestOracleQueryFailureRecoveryTest()
{
super(RetryPolicy.QUERY);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Licensed 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 io.trino.plugin.oracle;

import io.trino.operator.RetryPolicy;

public class TestOracleTaskFailureRecoveryTest
extends BaseOracleFailureRecoveryTest
{
public TestOracleTaskFailureRecoveryTest()
{
super(RetryPolicy.TASK);
}
}