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

Remove sessions cleaning for data workflows tests #1788

Merged
merged 1 commit into from
May 30, 2024
Merged
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
14 changes: 0 additions & 14 deletions tests/tests_integration/test_api/test_data_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,16 +221,6 @@ def workflow_execution_list(
return cognite_client.workflows.executions.list(workflow_version_ids=add_multiply_workflow.as_id(), limit=5)


@pytest.fixture()
def clean_created_sessions(cognite_client: CogniteClient) -> None:
existing_active_sessions = cognite_client.iam.sessions.list(status="active", limit=-1)
yield None
current_sessions = cognite_client.iam.sessions.list(status="active", limit=-1)
existing_ids = {session.id for session in existing_active_sessions}
to_revoked = [session.id for session in current_sessions if session.id not in existing_ids]
cognite_client.iam.sessions.revoke(to_revoked)


class TestWorkflows:
def test_upsert_delete(self, cognite_client: CogniteClient) -> None:
workflow = WorkflowUpsert(
Expand Down Expand Up @@ -388,9 +378,6 @@ def test_retrieve_non_existing_workflow_execution(self, cognite_client: CogniteC

assert non_existing is None

# Each trigger creates a new execution, so we need to clean up after each test to avoid
# running out of quota
@pytest.mark.usefixtures("clean_created_sessions")
def test_trigger_retrieve_detailed_update_update_task(
self,
cognite_client: CogniteClient,
Expand All @@ -411,7 +398,6 @@ def test_trigger_retrieve_detailed_update_update_task(
async_task = cognite_client.workflows.tasks.update(async_task.id, "completed")
assert async_task.status == "completed"

@pytest.mark.usefixtures("clean_created_sessions")
def test_trigger_cancel_retry_workflow(
self, cognite_client: CogniteClient, add_multiply_workflow: WorkflowVersion
) -> None:
Expand Down