Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 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
6 changes: 3 additions & 3 deletions gen3-integration-tests/services/gen3workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ def _perform_s3_action(
##### /storage endpoint #####
#############################

def get_storage_info(self, user: str = "main_account", expected_status=200) -> Dict:
"""Makes a GET request to the `/storage/info` endpoint."""
storage_url = f"{self.BASE_URL}{self.SERVICE_URL}/storage/info"
def setup_storage(self, user: str = "main_account", expected_status=200) -> Dict:
"""Makes a GET request to the `/storage/setup` endpoint."""
storage_url = f"{self.BASE_URL}{self.SERVICE_URL}/storage/setup"
headers = (
{
"Authorization": f"bearer {self._get_access_token(user)}",
Expand Down
17 changes: 9 additions & 8 deletions gen3-integration-tests/tests/test_gen3_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ def _nextflow_parse_completed_line(log_line):
return task_info


@pytest.mark.skip(reason="Until https://github.com/uc-cdis/gen3-code-vigil/pull/484 is merged")
@pytest.mark.skipif(
"funnel" not in pytest.deployed_services,
reason="funnel service is not running on this environment",
Expand All @@ -80,18 +79,20 @@ def setup_class(cls):
cls.invalid_user = "dummy_one"
cls.s3_folder_name = "integration-tests"
cls.s3_file_name = "test-input.txt"
# Ensure the bucket is emptied before running the tests
cls.gen3_workflow.cleanup_user_bucket()

cls.s3_storage_config = WorkflowStorageConfig.from_dict(
cls.gen3_workflow.get_storage_info(user=cls.valid_user, expected_status=200)
cls.gen3_workflow.setup_storage(user=cls.valid_user, expected_status=200)
)

######################## Test /storage/info endpoint ########################
# Ensure the bucket is emptied before running the tests (must run after
# `storage_setup` so the user has access to empty the bucket)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

i will rename this before merging

Suggested change
# `storage_setup` so the user has access to empty the bucket)
# `setup_storage` so the user has access to empty the bucket)

cls.gen3_workflow.cleanup_user_bucket()

######################## Test /storage/setup endpoint ########################

def test_get_storage_info_without_token(self):
"""Test GET /storage/info without an access token."""
self.gen3_workflow.get_storage_info(user=None, expected_status=401)
def test_setup_storage_without_token(self):
"""Test GET /storage/setup without an access token."""
self.gen3_workflow.setup_storage(user=None, expected_status=401)

######################## Test /s3/ endpoint ########################

Expand Down
Loading