Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
12 changes: 12 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ jobs:
ORACLE_USERNAME:cdapio-github-builds/ORACLE_USERNAME
ORACLE_PASSWORD:cdapio-github-builds/ORACLE_PASSWORD
ORACLE_PORT:cdapio-github-builds/ORACLE_PORT
MYSQL_HOST:cdapio-github-builds/MYSQL_HOST
MYSQL_USERNAME:cdapio-github-builds/MYSQL_USERNAME
MYSQL_PASSWORD:cdapio-github-builds/MYSQL_PASSWORD
MYSQL_PORT:cdapio-github-builds/MYSQL_PORT

- name: Run required e2e tests
if: github.event_name != 'workflow_dispatch' && github.event_name != 'push' && steps.filter.outputs.e2e-test == 'false'
Expand All @@ -92,6 +96,10 @@ jobs:
ORACLE_USERNAME: ${{ steps.secrets.outputs.ORACLE_USERNAME }}
ORACLE_PASSWORD: ${{ steps.secrets.outputs.ORACLE_PASSWORD }}
ORACLE_PORT: ${{ steps.secrets.outputs.ORACLE_PORT }}
MYSQL_HOST: ${{ steps.secrets.outputs.MYSQL_HOST }}
MYSQL_USERNAME: ${{ steps.secrets.outputs.MYSQL_USERNAME }}
MYSQL_PASSWORD: ${{ steps.secrets.outputs.MYSQL_PASSWORD }}
MYSQL_PORT: ${{ steps.secrets.outputs.MYSQL_PORT }}

- name: Run all e2e tests
if: github.event_name == 'workflow_dispatch' || github.event_name == 'push' || steps.filter.outputs.e2e-test == 'true'
Expand All @@ -101,6 +109,10 @@ jobs:
ORACLE_USERNAME: ${{ steps.secrets.outputs.ORACLE_USERNAME }}
ORACLE_PASSWORD: ${{ steps.secrets.outputs.ORACLE_PASSWORD }}
ORACLE_PORT: ${{ steps.secrets.outputs.ORACLE_PORT }}
MYSQL_HOST: ${{ steps.secrets.outputs.MYSQL_HOST }}
MYSQL_USERNAME: ${{ steps.secrets.outputs.MYSQL_USERNAME }}
MYSQL_PASSWORD: ${{ steps.secrets.outputs.MYSQL_PASSWORD }}
MYSQL_PORT: ${{ steps.secrets.outputs.MYSQL_PORT }}

- name: Upload report
uses: actions/upload-artifact@v3
Expand Down
24 changes: 12 additions & 12 deletions mysql-plugin/src/e2e-test/features/mysql/MySql.feature
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,26 @@ Feature: Mysql - Verify Mysql source data transfer
When Select plugin: "MySQL" from the plugins list as: "Sink"
Then Connect plugins: "MySQL" and "MySQL2" to establish connection
Then Navigate to the properties page of plugin: "MySQL"
Then Select dropdown plugin property: "select-jdbcPluginName" with option value: "driver"
Then Replace input plugin property: "host" with value: "host"
Then Replace input plugin property: "port" with value: "port"
Then Replace input plugin property: "user" with value: "username"
Then Replace input plugin property: "password" with value: "password"
Then Select dropdown plugin property: "select-jdbcPluginName" with option value: "driverName"
Then Replace input plugin property: "host" with value: "host" for Credentials and Authorization related fields
Then Replace input plugin property: "port" with value: "port" for Credentials and Authorization related fields
Then Replace input plugin property: "user" with value: "username" for Credentials and Authorization related fields
Then Replace input plugin property: "password" with value: "password" for Credentials and Authorization related fields
Then Enter input plugin property: "referenceName" with value: "sourceRef"
Then Replace input plugin property: "database" with value: "database"
Then Replace input plugin property: "database" with value: "databaseName"
Then Enter textarea plugin property: "importQuery" with value: "selectQuery"
Then Click on the Get Schema button
Then Verify the Output Schema matches the Expected Schema: "outputSchema"
Then Validate "MySQL" plugin properties
Then Close the Plugin Properties page
Then Navigate to the properties page of plugin: "MySQL2"
Then Select dropdown plugin property: "select-jdbcPluginName" with option value: "driver"
Then Replace input plugin property: "host" with value: "host"
Then Replace input plugin property: "port" with value: "port"
Then Replace input plugin property: "database" with value: "database"
Then Select dropdown plugin property: "select-jdbcPluginName" with option value: "driverName"
Then Replace input plugin property: "host" with value: "host" for Credentials and Authorization related fields
Then Replace input plugin property: "port" with value: "port" for Credentials and Authorization related fields
Then Replace input plugin property: "database" with value: "databaseName"
Then Replace input plugin property: "tableName" with value: "targetTable"
Then Replace input plugin property: "user" with value: "username"
Then Replace input plugin property: "password" with value: "password"
Then Replace input plugin property: "user" with value: "username" for Credentials and Authorization related fields
Then Replace input plugin property: "password" with value: "password" for Credentials and Authorization related fields
Then Enter input plugin property: "referenceName" with value: "targetRef"
Then Validate "MySQL2" plugin properties
Then Close the Plugin Properties page
Expand Down
10 changes: 4 additions & 6 deletions mysql-plugin/src/e2e-test/java/io/cdap/plugin/MysqlClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,13 @@
* MySQL client.
*/
public class MysqlClient {
private static final String host = PluginPropertyUtils.pluginProp("host");
private static final int port = Integer.parseInt(PluginPropertyUtils.pluginProp("port"));
private static final String database = PluginPropertyUtils.pluginProp("database");
private static final String database = PluginPropertyUtils.pluginProp("databaseName");

private static Connection getMysqlConnection() throws SQLException, ClassNotFoundException {
Class.forName("com.mysql.cj.jdbc.Driver");
String username = PluginPropertyUtils.pluginProp("username");
String password = PluginPropertyUtils.pluginProp("password");
return DriverManager.getConnection("jdbc:mysql://" + host + ":" + port + "/" + database, username, password);
return DriverManager.getConnection("jdbc:mysql://" + System.getenv("MYSQL_HOST") + ":" +
System.getenv("MYSQL_PORT") + "/" + database,
System.getenv("MYSQL_USERNAME"), System.getenv("MYSQL_PASSWORD"));
}

public static int countRecord(String table) throws SQLException, ClassNotFoundException {
Expand Down
12 changes: 6 additions & 6 deletions mysql-plugin/src/e2e-test/resources/pluginParameters.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
driver=mysql
host=34.105.111.83
username=dummy
password=dummy
database=sakila
port=3306
driverName=mysql
host=MYSQL_HOST
username=MYSQL_USERNAME
password=MYSQL_PASSWORD
databaseName=sakila
port=MYSQL_PORT
selectQuery=select * from ${table}
sourceRef=source
targetRef=target
Expand Down