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

Make connector acceptance test gradle plugin work for destinations #22609

Merged
merged 7 commits into from
Feb 24, 2023
Merged
Changes from 3 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 @@ -19,7 +19,7 @@ class AirbyteConnectorAcceptanceTestPlugin implements Plugin<Project> {
'-w', "$targetMountDirectory",
'-e', "AIRBYTE_SAT_CONNECTOR_DIR=${project.projectDir.absolutePath}",
'airbyte/connector-acceptance-test:dev',
'-p', 'integration_tests.acceptance',
'--acceptance-test-config', targetMountDirectory,
Copy link
Contributor

Choose a reason for hiding this comment

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

are you sure this isn't a red herring? I don't follow why this fixes the issue

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For example with #22393 the acceptance tests run correctly when called this way but fail with “could not find module integration_tests.acceptance” with the old call.

I’m not sure why though, that’s why I pinged you on this.

Copy link
Contributor

@sherifnada sherifnada Feb 17, 2023

Choose a reason for hiding this comment

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

Ah I think I see the problem.

-p integration_tets.acceptance tells the running pytest process (CAT in this case) to look at a file integration_tests/acceptance.py to configure tests.

In this situation the working directory is always set to the connector's directory. Python connectors always have a integration_tests/acceptance.py file, so this works for them. Even the java connectors which implement CAT also have that directory with an acceptance.py file (eg see postgres).

That directory is important because it allows the user to configure setup/teardown actions e.g: create a database and tear it down.

I think the correct way to handle this would be to create an integration_tests/acceptance.py directory for the connector in question, or maybe conditionally add this flag depending on whether that directory exists.

I think the --acceptance-test-config arg is unnecessary. By default SAT looks for an acceptance-test-config.yaml in the working directory (which is always set to the connector dir) so I think we can remove this arg.

]
commandLine args
}
Expand Down