Skip to content

Commit

Permalink
Integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JayGreeeen committed Nov 25, 2024
1 parent ea6d5a9 commit c8f3010
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@
import static com.expediagroup.beekeeper.cleanup.monitoring.DeletedMetadataReporter.METRIC_NAME;
import static com.expediagroup.beekeeper.core.model.HousekeepingStatus.DELETED;
import static com.expediagroup.beekeeper.core.model.HousekeepingStatus.DISABLED;
import static com.expediagroup.beekeeper.core.model.HousekeepingStatus.SCHEDULED;
import static com.expediagroup.beekeeper.core.model.LifecycleEventType.EXPIRED;
import static com.expediagroup.beekeeper.core.model.LifecycleEventType.UNREFERENCED;
import static com.expediagroup.beekeeper.integration.CommonTestVariables.AWS_REGION;
import static com.expediagroup.beekeeper.integration.CommonTestVariables.DATABASE_NAME_VALUE;
import static com.expediagroup.beekeeper.integration.CommonTestVariables.LONG_CLEANUP_DELAY_VALUE;
Expand Down Expand Up @@ -386,7 +384,7 @@ public void testEventAddedToHistoryTable() throws TException, SQLException {
assertThat(metastoreClient.tableExists(DATABASE_NAME_VALUE, TABLE_NAME_VALUE)).isFalse();
assertThat(amazonS3.doesObjectExist(BUCKET, UNPARTITIONED_OBJECT_KEY)).isFalse();

List<BeekeeperHistory> beekeeperHistory = getBeekeeperHistory(UNREFERENCED);
List<BeekeeperHistory> beekeeperHistory = getBeekeeperHistory(EXPIRED);
BeekeeperHistory history = beekeeperHistory.get(0);
assertThat(history.getDatabaseName()).isEqualTo(DATABASE_NAME_VALUE);
assertThat(history.getTableName()).isEqualTo(TABLE_NAME_VALUE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@

import static com.expediagroup.beekeeper.cleanup.monitoring.BytesDeletedReporter.METRIC_NAME;
import static com.expediagroup.beekeeper.core.model.HousekeepingStatus.DELETED;
import static com.expediagroup.beekeeper.core.model.HousekeepingStatus.SCHEDULED;
import static com.expediagroup.beekeeper.core.model.LifecycleEventType.EXPIRED;
import static com.expediagroup.beekeeper.core.model.LifecycleEventType.UNREFERENCED;
import static com.expediagroup.beekeeper.integration.CommonTestVariables.AWS_REGION;
import static com.expediagroup.beekeeper.integration.CommonTestVariables.DATABASE_NAME_VALUE;
Expand Down Expand Up @@ -268,7 +266,7 @@ public void testEventAddedToHistoryTable() throws SQLException {
BeekeeperHistory history = beekeeperHistory.get(0);
assertThat(history.getDatabaseName()).isEqualTo(DATABASE_NAME_VALUE);
assertThat(history.getTableName()).isEqualTo(TABLE_NAME_VALUE);
assertThat(history.getLifecycleType()).isEqualTo(EXPIRED.toString());
assertThat(history.getLifecycleType()).isEqualTo(UNREFERENCED.toString());
assertThat(history.getHousekeepingStatus()).isEqualTo(DELETED.name());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import static org.testcontainers.containers.localstack.LocalStackContainer.Service.SQS;

import static com.expediagroup.beekeeper.core.model.HousekeepingStatus.SCHEDULED;
import static com.expediagroup.beekeeper.core.model.LifecycleEventType.EXPIRED;
import static com.expediagroup.beekeeper.core.model.LifecycleEventType.UNREFERENCED;
import static com.expediagroup.beekeeper.integration.CommonTestVariables.AWS_REGION;
import static com.expediagroup.beekeeper.integration.CommonTestVariables.CLEANUP_ATTEMPTS_VALUE;
Expand Down Expand Up @@ -159,7 +158,7 @@ public void unreferencedAlterPartitionEvent() throws SQLException, IOException,
public void unreferencedMultipleAlterPartitionEvent() throws IOException, SQLException, URISyntaxException {
List
.of(new AlterPartitionSqsMessage("s3://bucket/table/expiredTableLocation",
"s3://bucket/table/partitionLocation", "s3://bucket/table/unreferencedPartitionLocation", true, true),
"s3://bucket/table/partitionLocation", "s3://bucket/table/unreferencedPartitionLocation", true, true),
new AlterPartitionSqsMessage("s3://bucket/table/expiredTableLocation2",
"s3://bucket/table/partitionLocation2", "s3://bucket/table/partitionLocation", true, true))
.forEach(msg -> amazonSQS.sendMessage(sendMessageRequest(msg.getFormattedString())));
Expand Down Expand Up @@ -210,7 +209,7 @@ public void testEventAddedToHistoryTable() throws IOException, URISyntaxExceptio
BeekeeperHistory history = beekeeperHistory.get(0);
assertThat(history.getDatabaseName()).isEqualTo(DATABASE_NAME_VALUE);
assertThat(history.getTableName()).isEqualTo(TABLE_NAME_VALUE);
assertThat(history.getLifecycleType()).isEqualTo(EXPIRED.toString());
assertThat(history.getLifecycleType()).isEqualTo(UNREFERENCED.toString());
assertThat(history.getHousekeepingStatus()).isEqualTo(SCHEDULED.name());
}

Expand Down

0 comments on commit c8f3010

Please sign in to comment.