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

Fix s3_datasets and s3_datasets_shares tests #1325

Merged
merged 4 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all 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 @@ -192,6 +192,7 @@ def check_target_role_access_policy(self) -> None:
version_id, policy_document = IAM.get_managed_policy_default_version(
self.target_environment.AwsAccountId, self.target_environment.region, share_resource_policy_name
)
logger.info(f'Policy... {policy_document}')
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: is this leftover form debugging or want to keep for logging?


s3_statement_index = SharePolicyService._get_statement_by_sid(
policy_document, f'{IAM_S3_ACCESS_POINTS_STATEMENT_SID}S3'
Expand Down
Copy link
Contributor

Choose a reason for hiding this comment

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

I see in conftest there is def share_item_folder which includes defining ShareObjectItem(...) with parameter S3AccessPointName which no longer exists

This fixture is not used anywhere in the tests and all tests pass but I imagine this is part of the improvements to conftests to come later

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ def share(
itemUri=table.tableUri,
itemType=ShareableType.Table.value,
itemName=table.GlueTableName,
GlueDatabaseName=table.GlueDatabaseName,
GlueTableName=table.GlueTableName,
status=ShareItemStatus.Share_Approved.value,
)
session.add(share_item)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from dataall.core.organizations.db.organization_models import Organization
from dataall.modules.s3_datasets.db.dataset_repositories import DatasetRepository
from dataall.modules.s3_datasets.db.dataset_models import DatasetStorageLocation, DatasetTable, S3Dataset
from dataall.modules.datasets_base.db.dataset_models import DatasetLock
from dataall.modules.datasets_base.db.dataset_models import DatasetLock, DatasetBase
from tests.core.stacks.test_stack import update_stack_query

from dataall.modules.datasets_base.services.datasets_enums import ConfidentialityClassification
Expand Down Expand Up @@ -352,6 +352,7 @@ def test_delete_dataset(client, dataset, env_fixture, org_fixture, db, module_mo
with db.scoped_session() as session:
session.query(DatasetLock).delete()
session.query(S3Dataset).delete()
session.query(DatasetBase).delete()
session.commit()
deleted_dataset = dataset(org=org_fixture, env=env_fixture, name='dataset1', owner=user.username, group=group.name)
response = client.query(
Expand Down Expand Up @@ -381,7 +382,7 @@ def test_delete_dataset(client, dataset, env_fixture, org_fixture, db, module_mo
username=user.username,
groups=[group.name],
)
assert response.data.getDataset is None
assert response.data.getDataset == None

response = client.query(
"""
Expand Down
Empty file.
Loading
Loading