-
Notifications
You must be signed in to change notification settings - Fork 29
fix(tests): resolves false-positive failures in FAST tests (defer failure expectations) #587
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
aaronsteers
merged 16 commits into
main
from
aj/test--remove-expected-to-fail-tests-from-fast-standard-tests-(resolves-false-positive-failures)
Jun 11, 2025
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
c4e6ddb
test: remove expected-to-fail tests from fast standard tests (resolve…
aaronsteers c932315
Update airbyte_cdk/test/standard_tests/connector_base.py
aaronsteers a760cf7
Merge branch 'main' into aj/test--remove-expected-to-fail-tests-from-…
aaronsteers 0ef7a33
fix conditions for failure, add "with_()" and "without_()" morph methods
aaronsteers 52bcc85
Merge branch 'main' into aj/test--remove-expected-to-fail-tests-from-…
aaronsteers c754895
Update airbyte_cdk/test/standard_tests/models/scenario.py
aaronsteers 41b0db1
don't skip failure conditions
aaronsteers 5eefef7
fix: classmethod override
aaronsteers 76aa0e7
format-fix
aaronsteers 344a495
tri-state ExpectedOutcome
aaronsteers 1ac503a
Update airbyte_cdk/test/entrypoint_wrapper.py
aaronsteers 845b800
fix circular import issue
aaronsteers 0fc90b4
restore older arg as deprecated
aaronsteers 6bc4e33
commit prev wip
aaronsteers 4191d10
format fix
aaronsteers 2434501
fix: legacy default expectation behavior
aaronsteers File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Copyright (c) 2025 Airbyte, Inc., all rights reserved. | ||
"""Models used for standard tests.""" | ||
|
||
from airbyte_cdk.test.models.outcome import ExpectedOutcome | ||
from airbyte_cdk.test.models.scenario import ConnectorTestScenario | ||
|
||
__all__ = [ | ||
"ConnectorTestScenario", | ||
"ExpectedOutcome", | ||
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Copyright (c) 2024 Airbyte, Inc., all rights reserved. | ||
"""Run acceptance tests in PyTest. | ||
|
||
These tests leverage the same `acceptance-test-config.yml` configuration files as the | ||
acceptance tests in CAT, but they run in PyTest instead of CAT. This allows us to run | ||
the acceptance tests in the same local environment as we are developing in, speeding | ||
up iteration cycles. | ||
""" | ||
|
||
from __future__ import annotations | ||
|
||
from enum import Enum, auto | ||
|
||
|
||
class ExpectedOutcome(Enum): | ||
"""Enum to represent the expected outcome of a test scenario. | ||
|
||
Class supports comparisons to a boolean or None. | ||
""" | ||
|
||
EXPECT_EXCEPTION = auto() | ||
EXPECT_SUCCESS = auto() | ||
ALLOW_ANY = auto() | ||
|
||
@classmethod | ||
def from_status_str(cls, status: str | None) -> ExpectedOutcome: | ||
"""Convert a status string to an ExpectedOutcome.""" | ||
if status is None: | ||
return ExpectedOutcome.ALLOW_ANY | ||
|
||
try: | ||
return { | ||
"succeed": ExpectedOutcome.EXPECT_SUCCESS, | ||
"failed": ExpectedOutcome.EXPECT_EXCEPTION, | ||
}[status] | ||
except KeyError as ex: | ||
raise ValueError(f"Invalid status '{status}'. Expected 'succeed' or 'failed'.") from ex | ||
|
||
@classmethod | ||
def from_expecting_exception_bool(cls, expecting_exception: bool | None) -> ExpectedOutcome: | ||
"""Convert a boolean indicating whether an exception is expected to an ExpectedOutcome.""" | ||
if expecting_exception is None: | ||
# Align with legacy behavior where default would be 'False' (no exception expected) | ||
return ExpectedOutcome.EXPECT_SUCCESS | ||
|
||
return ( | ||
ExpectedOutcome.EXPECT_EXCEPTION | ||
if expecting_exception | ||
else ExpectedOutcome.EXPECT_SUCCESS | ||
) | ||
|
||
def expect_exception(self) -> bool: | ||
"""Return whether the expectation is that an exception should be raised.""" | ||
return self == ExpectedOutcome.EXPECT_EXCEPTION | ||
|
||
def expect_success(self) -> bool: | ||
"""Return whether the expectation is that the test should succeed without exceptions.""" | ||
return self == ExpectedOutcome.EXPECT_SUCCESS |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.