Test case to demonstrate disk usage update for work dir outputs is broken with celery_extended.

This commit is contained in:
John Chilton
2022-06-11 11:06:59 -04:00
committed by mvdbeek
parent 23edd14526
commit cf49d9e7fa
2 changed files with 34 additions and 0 deletions
+7
View File
@@ -1074,6 +1074,13 @@ class BaseDatasetPopulator(BasePopulator):
assert "id" in role, role
return role["id"]
def total_disk_usage(self) -> float:
response = self._get("users/current")
response.raise_for_status()
user_object = response.json()
assert "total_disk_usage" in user_object
return user_object["total_disk_usage"]
def create_role(self, user_ids: list, description: Optional[str] = None) -> dict:
using_requirement("admin")
payload = {
@@ -0,0 +1,27 @@
from galaxy_test.base.populators import DatasetPopulator
from galaxy_test.driver.integration_util import IntegrationTestCase
class TestDiskUsageUpdateDefault(IntegrationTestCase):
dataset_populator: DatasetPopulator
framework_tool_and_types = True
def setUp(self):
super().setUp()
self.dataset_populator = DatasetPopulator(self.galaxy_interactor)
def test_run_work_dir_glob(self, history_id):
# Run a tool with a work dir glob and ensure content and disk usage is updated.
self.dataset_populator.new_dataset(history_id, content="fwd1Test", wait=True)
initial_disk_usage = self.dataset_populator.total_disk_usage()
response = self.dataset_populator.run_tool("from_work_dir_glob", {}, history_id, assert_ok=True)
self.dataset_populator.wait_for_job(job_id=response["jobs"][0]["id"])
final_disk_usage = self.dataset_populator.total_disk_usage()
assert final_disk_usage == initial_disk_usage + 3
class TestDiskUsageCeleryExtended(TestDiskUsageUpdateDefault):
@classmethod
def handle_galaxy_config_kwds(cls, config):
super().handle_galaxy_config_kwds(config)
config["metadata_strategy"] = "celery_extended"