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

MINOR: fix mssql integration test #17923

Merged
merged 7 commits into from
Sep 20, 2024
Merged
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion ingestion/tests/integration/sql_server/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
@pytest.fixture(scope="module")
Copy link
Contributor

Choose a reason for hiding this comment

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

More a question on my end. Wouldn't scope=module make it so the fixture would be destroyed at the end of the last test in sql_server/test_lineage.py for example?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed. With containers a best practice is to have session (since its most expensive to setup) level fixtures for the containers and module level fixtures for data entities like databases or tables.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But for this case the data stays static throughout the tests so its fine like this.

def mssql_container(tmp_path_factory):
container = SqlServerContainer(
"mcr.microsoft.com/mssql/server:2017-latest", dbname="AdventureWorks"
"mcr.microsoft.com/mssql/server:2017-CU31-GDR2-ubuntu-18.04", dbname="AdventureWorks"
)
data_dir = tmp_path_factory.mktemp("data")
shutil.copy(
Expand Down
Loading