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

supply a source id for schema discovery in connector integration tests #17662

Merged
merged 2 commits into from
Oct 6, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ public abstract class AbstractSourceConnectorTest {
private static final String JOB_ID = String.valueOf(0L);
private static final int JOB_ATTEMPT = 0;

private static final UUID SOURCE_ID = UUID.randomUUID();

private static final String CPU_REQUEST_FIELD_NAME = "cpuRequest";
private static final String CPU_LIMIT_FIELD_NAME = "cpuLimit";
private static final String MEMORY_REQUEST_FIELD_NAME = "memoryRequest";
Expand Down Expand Up @@ -162,7 +164,8 @@ protected UUID runDiscover() throws Exception {
final UUID toReturn = new DefaultDiscoverCatalogWorker(
mConfigRepository,
new AirbyteIntegrationLauncher(JOB_ID, JOB_ATTEMPT, getImageName(), processFactory, workerConfigs.getResourceRequirements()))
.run(new StandardDiscoverCatalogInput().withConnectionConfiguration(getConfig()), jobRoot).getDiscoverCatalogId();
.run(new StandardDiscoverCatalogInput().withSourceId(SOURCE_ID.toString()).withConnectionConfiguration(getConfig()), jobRoot)
.getDiscoverCatalogId();
verify(mConfigRepository).writeActorCatalogFetchEvent(lastPersistedCatalog.capture(), any(), any(), any());
return toReturn;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ public ConnectorJobOutput run(final StandardDiscoverCatalogInput discoverSchemaI
}

final UUID catalogId =
configRepository.writeActorCatalogFetchEvent(catalog.get(), UUID.fromString(discoverSchemaInput.getSourceId()),
configRepository.writeActorCatalogFetchEvent(catalog.get(),
// NOTE: sourceId is marked required in the OpenAPI config but the code generator doesn't enforce it, so we check again here.
discoverSchemaInput.getSourceId() == null ? null : UUID.fromString(discoverSchemaInput.getSourceId()),
discoverSchemaInput.getConnectorVersion(),
discoverSchemaInput.getConfigHash());
return new ConnectorJobOutput().withOutputType(OutputType.DISCOVER_CATALOG_ID).withDiscoverCatalogId(catalogId);
Expand Down