Skip to content

live-tests: add regression tests suite #35837

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

Merged
merged 2 commits into from
Mar 7, 2024

Conversation

alafanechere
Copy link
Contributor

@alafanechere alafanechere commented Mar 5, 2024

What

Relates to https://github.com/airbytehq/airbyte-internal-issues/issues/6483
This PR boostraps a regression test suite.
It basically declares fixtures with execution results of commands on the control and target connectors version.
It implements a basic expected records test for demonstration, we will port CAT's expected record test later.
The test execution persists test artifact that can be useful for debugging test failures.

Recommended reading order

  1. airbyte-ci/connectors/live-tests/src/live_tests/regression_tests/conftest.py
  2. airbyte-ci/connectors/live-tests/src/live_tests/regression_tests/test_expected_records.py

Test output example

Screenshot 2024-03-05 at 20 26 51

Copy link

vercel bot commented Mar 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
airbyte-docs ⬜️ Ignored (Inspect) Visit Preview Mar 7, 2024 2:33pm

Copy link
Contributor Author

alafanechere commented Mar 5, 2024

@alafanechere alafanechere changed the title live-test: add regression tests suite live-tests: add regression tests suite Mar 5, 2024
@alafanechere alafanechere force-pushed the augustin/03-04-add_regression_tests branch from 34c6b5f to 99fc98f Compare March 5, 2024 21:18
@alafanechere alafanechere marked this pull request as ready for review March 5, 2024 21:20
@alafanechere alafanechere requested review from a team and clnoll March 5, 2024 21:20
@alafanechere alafanechere force-pushed the augustin/03-04-add_regression_tests branch from 95c6731 to 4e06bbd Compare March 5, 2024 21:51
@alafanechere alafanechere force-pushed the augustin/03-01-regression-test_declare_debug_mode branch from 90587ad to d78a92b Compare March 5, 2024 21:53
@alafanechere alafanechere force-pushed the augustin/03-04-add_regression_tests branch 2 times, most recently from 6699069 to db3029d Compare March 5, 2024 21:57
Base automatically changed from augustin/03-01-regression-test_declare_debug_mode to regression-tests-package March 6, 2024 00:24
@alafanechere alafanechere force-pushed the regression-tests-package branch 3 times, most recently from 0a4f755 to d9d08c7 Compare March 6, 2024 07:41
Base automatically changed from regression-tests-package to master March 6, 2024 13:18
Copy link
Contributor

@clnoll clnoll left a comment

Choose a reason for hiding this comment

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

Looks great @alafanechere! I only reviewed files changed in the last two commits because looks like the rest won't have a diff once the merge conflict is fixed.

One main comment, about the use of fixtures.

return ConnectorRunner(dagger_client, **spec_target_execution_inputs.to_dict())


@pytest.fixture
Copy link
Contributor

Choose a reason for hiding this comment

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

Declaring this (and execution results for other commands) as a pytest fixture has the effect of executing them before any tests run. Is there a reason you prefer to do it this way rather than getting the result as part of the test? I have a slight preference for the latter - to me, executing the calls feels like part of the test behavior, so should fail during execution of a specific test.

Also, will declaring these as fixtures end up running all commands, even if we only want to run a single test? Or will they be executed lazily?

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 its indeed a fair point of discussion.
As these fixtures are indeed lazily used on test request I found it useful to declare this logic in fixture.
IMO it avoids a lot of code duplication if we create multiple tests performing assertions on command execution results, and it makes sure the execution report is created.

Copy link
Contributor

@clnoll clnoll left a comment

Choose a reason for hiding this comment

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

Preemptively approving since we can address the fixture question whenever we'd like.

@alafanechere alafanechere force-pushed the augustin/03-04-add_regression_tests branch 2 times, most recently from 5f749cc to a837536 Compare March 7, 2024 09:49
@alafanechere alafanechere force-pushed the augustin/03-04-add_regression_tests branch from a837536 to f34082a Compare March 7, 2024 14:30
@alafanechere alafanechere merged commit 0965ebd into master Mar 7, 2024
@alafanechere alafanechere deleted the augustin/03-04-add_regression_tests branch March 7, 2024 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants