-
Notifications
You must be signed in to change notification settings - Fork 4.5k
live-tests: implement debug mode #35786
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
live-tests: implement debug mode #35786
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @alafanechere and the rest of your teammates on |
648bfc4
to
1e7ad76
Compare
cf7cdb7
to
4e307d5
Compare
4e307d5
to
38154a8
Compare
7ad9c1f
to
54eb1ce
Compare
38154a8
to
f9f1668
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Just a few minor comments & questions, no blockers. Excited to get the first version out!
|
||
for stream in messages_by_type["records"] | messages_by_type["states"]: | ||
os.makedirs(f"{self._output_directory}/{stream}", exist_ok=True) | ||
def write(self, airbyte_messages: Iterable[AirbyteMessage]): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this is adapted from my first pass, but I'm concerned about holding everything in memory at once.
WDYT about having _get_messages_by_type
be a generator that returns a tuple of (AirbyteMessageType
, message_json
)?
I know it's late for you there so I'll try this out and see how it goes.
import dagger | ||
import sys | ||
|
||
DAGGER_EXEC_TIMEOUT = dagger.Timeout(60 * 60) # One hour |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WDYT about making this overridable, maybe via an environment variable? I think in some cases we'd be okay with it taking longer.
BASE_IN_CONTAINER_OUTPUT_DIRECTORY = "/tmp" | ||
IN_CONTAINER_OUTPUT_PATH = f"{BASE_IN_CONTAINER_OUTPUT_DIRECTORY}/raw_output.txt" | ||
RELATIVE_ERRORS_PATH = "errors.txt" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BASE_IN_CONTAINER_OUTPUT_DIRECTORY = "/tmp" | |
IN_CONTAINER_OUTPUT_PATH = f"{BASE_IN_CONTAINER_OUTPUT_DIRECTORY}/raw_output.txt" | |
RELATIVE_ERRORS_PATH = "errors.txt" |
No longer used.
def _connector_under_test_container(self) -> dagger.Container: | ||
return self.connector_under_test.container | ||
|
||
def get_full_command(self, command: Command): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: can we make all the methods except run
private?
def get_mitmproxy_dir_cache(self) -> dagger.CacheVolume: | ||
return self.dagger_client.cache_volume(self.MITMPROXY_IMAGE) | ||
|
||
async def get_proxy_container( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😍
# TODO merge ExecutionReport.save_to_disk and Backend.write? | ||
# Make backends use customizable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious to know what you have in mind here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I basically realized that to classes perform final writes to file system of artifact, could be better to have this centralized.
airbyte-ci/connectors/live-tests/src/live_tests/commons/connector_runner.py
Show resolved
Hide resolved
54eb1ce
to
3c1e213
Compare
59efbaa
to
5c2669c
Compare
90587ad
to
d78a92b
Compare
Co-authored-by: Catherine Noll <[email protected]>
What
Closes https://github.com/airbytehq/airbyte-internal-issues/issues/2858
Closes https://github.com/airbytehq/airbyte-internal-issues/issues/2853
This PR introduces a usable
debug
command under the newlive-tests
CLI.It also adds strong re-usable primitives that we will re-use in an upcoming
regression-test
command (which will use pytest).How
live-tests debug read \ --connector-image=airbyte/source-pokeapi:dev \ --connector-image=airbyte/source-pokeapi:latest \ --config-path=poke_config.json \ --catalog-path=configured_catalog.json
This command will run the selected connector command on the selected connector images and will dump the command output to files for further manual analysis.
An HTTP proxy is introduced to cache requests on the same connectors.
More details in the
README.md