Skip to content
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

Skip cross account tests if no cross account credentials are provided #1321

Merged
merged 1 commit into from
Apr 30, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;

import static org.junit.Assume.assumeTrue;

@Slf4j
public class TestConsumer {
public final KCLAppConfig consumerConfig;
Expand Down Expand Up @@ -79,8 +81,9 @@ public TestConsumer(KCLAppConfig consumerConfig) throws Exception {

public void run() throws Exception {

// Skip cross account tests if no cross account credentials are provided
if (consumerConfig.isCrossAccount()) {
verifyCrossAccountCreds();
assumeTrue(consumerConfig.getCrossAccountCredentialsProvider() != null);
}

final StreamExistenceManager streamExistenceManager = new StreamExistenceManager(this.consumerConfig);
Expand Down Expand Up @@ -126,13 +129,6 @@ public void run() throws Exception {
}
}

private void verifyCrossAccountCreds() {
if (consumerConfig.getCrossAccountCredentialsProvider() == null) {
throw new RuntimeException("To run cross account integration tests, pass in an AWS profile with -D" +
KCLAppConfig.CROSS_ACCOUNT_PROFILE_PROPERTY);
}
}

private void cleanTestResources(StreamExistenceManager streamExistenceManager, LeaseTableManager leaseTableManager) throws Exception {
log.info("----------Before starting, Cleaning test environment----------");
log.info("----------Deleting all lease tables in account----------");
Expand Down
Loading