Skip to content

Conversation

@tuliren
Copy link
Contributor

@tuliren tuliren commented Jan 23, 2022

What

  • Add new mode in the current source-e2e-test connector to allow users to specify arbitrary catalog with single or multiple streams.
  • Add a cloud variant of the testing source.
  • Resolve Create a mock source connector #9532.

TODOs

  • Add cloud variant.

UI

Single-stream continuous feed mode
Screen Shot 2022-01-23 at 11 13 23

Multi-stream continuous feed mode
Screen Shot 2022-01-23 at 11 13 30

Recommended reading order

  1. e2e-test.md
  2. spec.json
  3. ContinuousFeedSource.java
  4. ContinuousFeedConfig.java
  5. The rest

🚨 User Impact 🚨

  • None.
  • The legacy modes are not changed. They are simply filtered out in the cloud variant of this connector.

Pre-merge Checklist

Community member or Airbyter

  • Community member? Grant edit access to maintainers (instructions)
  • Secrets in the connector's spec are annotated with airbyte_secret
  • Unit & integration tests added and passing. Community members, please provide proof of success locally e.g: screenshot or copy-paste unit, integration, and acceptance test output. To run acceptance tests for a Python connector, follow instructions in the README. For java connectors run ./gradlew :airbyte-integrations:connectors:<name>:integrationTest.
  • Code reviews completed
  • Documentation updated
    • Connector's README.md
    • Connector's bootstrap.md. See description and examples
    • docs/SUMMARY.md
    • docs/integrations/<source or destination>/<name>.md including changelog. See changelog example
    • docs/integrations/README.md
    • airbyte-integrations/builds.md
  • PR name follows PR naming conventions

Airbyter

If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.

  • Create a non-forked branch based on this PR and test the below items on it
  • Build is successful
  • Credentials added to Github CI. Instructions.
  • /test connector=connectors/<name> command is passing.
  • New Connector version released on Dockerhub by running the /publish command described here
  • After the connector is published, connector added to connector index as described here
  • Seed specs have been re-generated by building the platform and committing the changes to the seed spec files, as described here
@github-actions github-actions bot added the area/connectors Connector related issues label Jan 23, 2022
@tuliren
Copy link
Contributor Author

tuliren commented Jan 23, 2022

/test connector=connectors/source-e2e-test

🕑 connectors/source-e2e-test https://github.com/airbytehq/airbyte/actions/runs/1735869155
❌ connectors/source-e2e-test https://github.com/airbytehq/airbyte/actions/runs/1735869155
🐛

@tuliren tuliren temporarily deployed to more-secrets January 23, 2022 12:20 Inactive
@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets January 23, 2022 12:20 Inactive
@tuliren
Copy link
Contributor Author

tuliren commented Jan 23, 2022

/test connector=connectors/source-e2e-test

🕑 connectors/source-e2e-test https://github.com/airbytehq/airbyte/actions/runs/1735916910
✅ connectors/source-e2e-test https://github.com/airbytehq/airbyte/actions/runs/1735916910
No Python unittests run

@tuliren tuliren temporarily deployed to more-secrets January 23, 2022 12:42 Inactive
@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets January 23, 2022 12:43 Inactive
@tuliren tuliren force-pushed the liren/mock-api-source branch from bb2b890 to dba33fe Compare January 23, 2022 19:56
@github-actions github-actions bot added the area/documentation Improvements or additions to documentation label Jan 23, 2022
@tuliren tuliren temporarily deployed to more-secrets January 23, 2022 19:57 Inactive
@tuliren
Copy link
Contributor Author

tuliren commented Jan 23, 2022

/test connector=connectors/source-e2e-test

🕑 connectors/source-e2e-test https://github.com/airbytehq/airbyte/actions/runs/1736866343
✅ connectors/source-e2e-test https://github.com/airbytehq/airbyte/actions/runs/1736866343
No Python unittests run

@tuliren tuliren requested review from edgao and subodh1810 January 23, 2022 20:01
@tuliren tuliren marked this pull request as ready for review January 23, 2022 20:01
@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets January 23, 2022 20:03 Inactive
@tuliren tuliren temporarily deployed to more-secrets January 23, 2022 20:07 Inactive
@tuliren tuliren linked an issue Jan 23, 2022 that may be closed by this pull request
@tuliren tuliren temporarily deployed to more-secrets January 23, 2022 21:27 Inactive
@tuliren
Copy link
Contributor Author

tuliren commented Jan 24, 2022

/test connector=connectors/source-e2e-test

🕑 connectors/source-e2e-test https://github.com/airbytehq/airbyte/actions/runs/1737549944
✅ connectors/source-e2e-test https://github.com/airbytehq/airbyte/actions/runs/1737549944
No Python unittests run

❌ connectors/source-e2e-test https://github.com/airbytehq/airbyte/actions/runs/1737549944
🐛

🕑 connectors/source-e2e-test https://github.com/airbytehq/airbyte/actions/runs/1737549944
✅ connectors/source-e2e-test https://github.com/airbytehq/airbyte/actions/runs/1737549944
No Python unittests run

@tuliren
Copy link
Contributor Author

tuliren commented Jan 24, 2022

/test connector=connectors/source-e2e-test-cloud

🕑 connectors/source-e2e-test-cloud https://github.com/airbytehq/airbyte/actions/runs/1737550109
✅ connectors/source-e2e-test-cloud https://github.com/airbytehq/airbyte/actions/runs/1737550109
No Python unittests run

@tuliren tuliren temporarily deployed to more-secrets January 24, 2022 01:07 Inactive
@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets January 24, 2022 01:08 Inactive
@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets January 24, 2022 01:08 Inactive
@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets January 24, 2022 01:23 Inactive
@tuliren
Copy link
Contributor Author

tuliren commented Jan 24, 2022

To unblock Subodh, I will publish and merge this PR now. But feel free to leave any comment or request changes. I will update the connector in a follow-up PR.

@tuliren
Copy link
Contributor Author

tuliren commented Jan 24, 2022

/publish connector=connectors/source-e2e-test

🕑 connectors/source-e2e-test https://github.com/airbytehq/airbyte/actions/runs/1738099825
✅ connectors/source-e2e-test https://github.com/airbytehq/airbyte/actions/runs/1738099825

@tuliren
Copy link
Contributor Author

tuliren commented Jan 24, 2022

/publish connector=connectors/source-e2e-test-cloud

🕑 connectors/source-e2e-test-cloud https://github.com/airbytehq/airbyte/actions/runs/1738099908
✅ connectors/source-e2e-test-cloud https://github.com/airbytehq/airbyte/actions/runs/1738099908

@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets January 24, 2022 04:44 Inactive
@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets January 24, 2022 04:44 Inactive
@tuliren tuliren self-assigned this Jan 24, 2022
@tuliren tuliren temporarily deployed to more-secrets January 24, 2022 04:55 Inactive
@tuliren tuliren merged commit b269b9f into master Jan 24, 2022
@tuliren tuliren deleted the liren/mock-api-source branch January 24, 2022 05:09

final SchemaStore schemaStore = new SchemaStore(true);
final Schema schema = schemaStore.loadSchemaJson(Jsons.serialize(stream.getStream().getJsonSchema()));
final Generator generator = new Generator(ContinuousFeedConstants.MOCK_JSON_CONFIG, schemaStore, random.get());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: I think this is equivalent to just passing new Random(seed), since you're not passing the threadlocal into a separate thread

Copy link
Contributor Author

@tuliren tuliren Jan 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Will do.

return endOfData();
}

if (messageIntervalMs.isPresent() && emittedMessages.get() != 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

checking my understanding: the iterator will be processed single-threadedly?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so. Looks like the read is handled in one thread only.

});
}

protected void assertRecordMessages(final List<AirbyteRecordMessage> recordMessages) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add a javadoc comment explaining what this method should do?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. Will do.

import java.util.concurrent.ThreadLocalRandom;

/**
* This acceptance test is mostly the same as {@code ContinuousFeedSourceAcceptanceTest}. The only
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could this just extend ContinuousFeedSourceAcceptanceTest and override getImageName?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is possible. However, I was not able to make gradle work with this set up. Will leave a TODO for now.

@@ -0,0 +1,67 @@
# End-to-End Testing Source Cloud Variant

This is the Cloud variant of the [E2E Test Source](https://docs.airbyte.io/integrations/sources/e2e-test). It only allows the "continuous feed" mode with finite number of record messages.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add an explanation of why this is necessary+separate from the non-cloud variant?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. Good point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/benchmark area/connectors Connector related issues area/documentation Improvements or additions to documentation

4 participants