Skip to content

Fixing after hooks for GCP resources #1560

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

Draft
wants to merge 1 commit into
base: release/0.23
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion src/e2e-test/features/gcs/sink/GCSSinkError.feature
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Feature: GCS sink - Verify GCS Sink plugin error scenarios
Then Open GCS sink properties
Then Replace input plugin property: "project" with value: "projectId"
Then Enter input plugin property: "referenceName" with value: "gcsReferenceName"
Then Enter GCS source property path "gcsInvalidBucketName"
Then Enter input plugin property: "path" with value: "gcsInvalidBucketName"
Then Select GCS property format "csv"
Then Click on the Validate button
Then Verify that the Plugin Property: "path" is displaying an in-line error message: "errorMessageInvalidBucketName"
Expand Down
4 changes: 2 additions & 2 deletions src/e2e-test/features/gcsmove/GCSMoveErrorScenarios.feature
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Feature: GCSMove - Validate GCSMove plugin error scenarios
When Expand Plugin group in the LHS plugins list: "Conditions and Actions"
When Select plugin: "GCS Move" from the plugins list as: "Conditions and Actions"
When Navigate to the properties page of plugin: "GCS Move"
Then Enter GCSMove property source path "gcsInvalidBucketName"
Then Enter input plugin property: "sourcePath" with value: "gcsInvalidBucketName"
Then Enter GCSMove property destination path
Then Verify GCS Move property "sourcePath" invalid bucket name error message is displayed for bucket "gcsInvalidBucketName"

Expand All @@ -30,5 +30,5 @@ Feature: GCSMove - Validate GCSMove plugin error scenarios
When Select plugin: "GCS Move" from the plugins list as: "Conditions and Actions"
When Navigate to the properties page of plugin: "GCS Move"
Then Enter GCSMove property source path "gcsCsvFile"
Then Enter GCSMove property destination path "gcsInvalidBucketName"
Then Enter input plugin property: "destPath" with value: "gcsInvalidBucketName"
Then Verify GCS Move property "destPath" invalid bucket name error message is displayed for bucket "gcsInvalidBucketName"
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,13 @@ public static void createBucketWithAvroTestFile() throws IOException, URISyntaxE

@After(order = 1, value = "@GCS_CSV_TEST or @GCS_TSV_TEST or @GCS_BLOB_TEST " +
"or @GCS_DELIMITED_TEST or @GCS_TEXT_TEST or @GCS_OUTPUT_FIELD_TEST or @GCS_DATATYPE_1_TEST or " +
"@GCS_DATATYPE_2_TEST or @GCS_READ_RECURSIVE_TEST or @GCS_DELETE_WILDCARD_TEST or @GCS_CSV_RANGE_TEST or" +
" @GCS_PARQUET_TEST or @GCS_AVRO_TEST or @GCS_DATATYPE_TEST or @GCS_AVRO_FILE")
"@GCS_DATATYPE_2_TEST or @GCS_READ_RECURSIVE_TEST or @GCS_DELETE_WILDCARD_TEST or @GCS_CSV_RANGE_TEST or " +
"@GCS_PARQUET_TEST or @GCS_AVRO_TEST or @GCS_DATATYPE_TEST or @GCS_AVRO_FILE or @GCS_CSV or " +
"@GCS_JSON_TEST")
public static void deleteSourceBucketWithFile() {
deleteGCSBucket(gcsSourceBucketName);
PluginPropertyUtils.removePluginProp("gcsSourceBucketName");
PluginPropertyUtils.removePluginProp("gcsSourcePath");
gcsSourceBucketName = StringUtils.EMPTY;
}

@After(order = 1, value = "@GCS_DELETE_MULTIPLE_BUCKETS_TEST")
Expand Down Expand Up @@ -211,7 +211,7 @@ public static void createTargetGCSBucketWithCSVFile() throws IOException, URISyn
BeforeActions.scenario.write("GCS target bucket name - " + gcsTargetBucketName);
}

@After(order = 1, value = "@GCS_SINK_TEST or @GCS_SINK_EXISTING_BUCKET_TEST")
@After(order = 1, value = "@GCS_SINK_TEST or @GCS_SINK_EXISTING_BUCKET_TEST or @GCS_SINK_MULTI_PART_UPLOAD")
public static void deleteTargetBucketWithFile() {
deleteGCSBucket(gcsTargetBucketName);
PluginPropertyUtils.removePluginProp("gcsTargetBucketName");
Expand All @@ -226,7 +226,8 @@ public static void setTempTargetBQTableName() {
BeforeActions.scenario.write("BQ Target table name - " + bqTargetTable);
}

@After(order = 1, value = "@BQ_SINK_TEST")
@After(order = 1, value = "@BQ_SINK_TEST or @BQ_UPSERT_SINK_TEST or @BQ_UPDATE_SINK_DEDUPE_TEST or " +
"@BQ_EXISTING_SINK_TEST or @BQ_UPSERT_DEDUPE_SINK_TEST or @BQ_INSERT_SINK_TEST")
public static void deleteTempTargetBQTable() throws IOException, InterruptedException {
try {
BigQueryClient.dropBqQuery(bqTargetTable);
Expand Down Expand Up @@ -270,7 +271,10 @@ public static void createTempSourceBQTable() throws IOException, InterruptedExce

@After(order = 1, value = "@BQ_SOURCE_TEST or @BQ_PARTITIONED_SOURCE_TEST or @BQ_SOURCE_DATATYPE_TEST or " +
"@BQ_INSERT_SOURCE_TEST or @BQ_UPDATE_SINK_TEST or @BQ_EXISTING_SOURCE_TEST or @BQ_EXISTING_SINK_TEST or " +
"@BQ_EXISTING_SOURCE_DATATYPE_TEST or @BQ_EXISTING_SINK_DATATYPE_TEST")
"@BQ_EXISTING_SOURCE_DATATYPE_TEST or @BQ_EXISTING_SINK_DATATYPE_TEST or @BQ_UPSERT_SOURCE_TEST or " +
"@BQ_NULL_MODE_SOURCE_TEST or @BQ_UPDATE_SOURCE_DEDUPE_TEST or @BQ_INSERT_INT_SOURCE_TEST or " +
"@BQ_TIME_SOURCE_TEST or @BQ_UPSERT_DEDUPE_SOURCE_TEST or @BQ_PRIMARY_RECORD_SOURCE_TEST or " +
"@BQ_SINGLE_SOURCE_BQMT_TEST")
public static void deleteTempSourceBQTable() throws IOException, InterruptedException {
BigQueryClient.dropBqQuery(bqSourceTable);
PluginPropertyUtils.removePluginProp("bqSourceTable");
Expand Down Expand Up @@ -394,7 +398,7 @@ private static void createSourceBQViewWithQueries(String bqCreateViewQueryFile)
}

private static String createGCSBucketWithFile(String filePath) throws IOException, URISyntaxException {
String bucketName = StorageClient.createBucket("00000000-e2e-" + UUID.randomUUID()).getName();
String bucketName = StorageClient.createBucket("cdf-e2e-test-" + UUID.randomUUID()).getName();
StorageClient.uploadObject(bucketName, filePath, filePath);
PluginPropertyUtils.addPluginProp("gcsSourceBucketName", bucketName);
PluginPropertyUtils.addPluginProp("gcsSourcePath", "gs://" + bucketName + "/" + filePath);
Expand Down Expand Up @@ -936,12 +940,18 @@ public static void createBucketWithMultipleTestFiles() throws IOException, URISy
gcsSourceBucketName = createGCSBucketWithMultipleFiles(PluginPropertyUtils.pluginProp("gcsMultipleFilesPath"));
}

@After(order = 1, value = "@GCS_MULTIPLE_FILES_TEST or @GCS_MULTIPLE_FILES_REGEX_TEST")
public static void deleteSourceBucketWithMultipleFile() {
deleteGCSBucket(gcsSourceBucketName);
PluginPropertyUtils.removePluginProp("gcsSourceBucketName");
PluginPropertyUtils.removePluginProp("gcsSourcePath");
}

@Before(order = 1, value = "@GCS_MULTIPLE_FILES_REGEX_TEST")
public static void createBucketWithMultipleTestFilesWithRegex () throws IOException, URISyntaxException {
gcsSourceBucketName = createGCSBucketWithMultipleFiles(PluginPropertyUtils.pluginProp(
"gcsMultipleFilesFilterRegexPath"));
PluginPropertyUtils.addPluginProp(" bqTargetTable", bqTargetTable);
BeforeActions.scenario.write("BQ Target Table " + bqTargetTable + " updated successfully");
PluginPropertyUtils.addPluginProp(" gcsSourceBucketName", gcsSourceBucketName);
}

@Before(order = 1, value = "@BQ_EXISTING_SOURCE_TEST")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public void verifyGCSMovePropertyInvalidBucketNameErrorMessageIsDisplayedForBuck
String bucketName) {
CdfStudioActions.clickValidateButton();
String expectedErrorMessage = PluginPropertyUtils.errorProp(E2ETestConstants.ERROR_MSG_GCS_INVALID_BUCKET_NAME)
.replace("BUCKET_NAME", "/" + PluginPropertyUtils.pluginProp(bucketName));
.replace("BUCKET_NAME", PluginPropertyUtils.pluginProp(bucketName));
String actualErrorMessage = PluginPropertyUtils.findPropertyErrorElement(property).getText();
Assert.assertEquals(expectedErrorMessage, actualErrorMessage);
}
Expand Down
Loading