You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Stores were thoroughly tested before refactoring django-twined from another app. However, now, those tests are commented out and need to be brought up to scratch with the rest of the unit tests.
Also, stores require an integration test for various syncing purposes and we should use terraform to correctly hook up buckets for integration testing of the stores.
Note
I did a manual test of the stores, step-by-step evaluating what files appear and when, and when their metadata gets synced. The management command try_sync.py I used to do that is here:
fromuuidimportuuid4fromdjango.core.management.baseimportBaseCommandfromoctue.resourcesimportDatafilefromprojects.tasks.trialimportMyOnDemandTaskfromicecreamimporticclassCommand(BaseCommand):
"""A management command to invoke on-demand and subscriber tasks manually Intended for use while experimenting in a live environment to see if it works """defhandle(self, *args, **options):
# An already existing filebucket_name="test-lake-mast-timeseries"path="77bff006-ca05-4384-a8a6-ff86e712d6ac.txt"datafile=Datafile(f"gs://{bucket_name}/{path}", id="77bff006-ca05-4384-a8a6-ff86e712d6ac")
ic(datafile)
ic(datafile.id)
ic(datafile.labels)
ic(datafile.tags)
# Update metadatadatafile.labels= ["stuff", "two"]
datafile.update_metadata()
ic(datafile.labels)
ic(datafile.tags)
ic(datafile.path_in_bucket)
# A new file that shouldn't exist yet (we need to specify id, labels and tags then get metadata, all without creating a filecreating_path="whatever.txt"creating_id=str(uuid4())
ic(creating_id)
creating_df=Datafile(f"gs://{bucket_name}/{creating_path}", id=creating_id)
ic(creating_df)
# Now check - the creating_path should not be on gcs# Checked - correctic(creating_df.metadata())
# Now check - the creating_path should not be on gcs# Checked - correctcreating_df.tags= {"a": "b"}
ic(creating_df.metadata())
# Now check - the creating_path should not be on gcs# Checked - correctcreating_df.labels= ["a", "b"]
ic(creating_df.metadata())
# Now check - the creating_path should not be on gcs# Checked - correct
The text was updated successfully, but these errors were encountered:
thclark
added
tech-debt
Technical debt (tidy up, refactoring, restructuring, caused by laziness now)
test
Implement or update unit tests
labels
Oct 3, 2022
Feature request
Current state
Stores were thoroughly tested before refactoring django-twined from another app. However, now, those tests are commented out and need to be brought up to scratch with the rest of the unit tests.
Also, stores require an integration test for various syncing purposes and we should use terraform to correctly hook up buckets for integration testing of the stores.
Note
I did a manual test of the stores, step-by-step evaluating what files appear and when, and when their metadata gets synced. The management command
try_sync.py
I used to do that is here:The text was updated successfully, but these errors were encountered: