Skip to content

Commit

Permalink
Shift now timestamp and embargo period together for two tests
Browse files Browse the repository at this point in the history
test_raw_and_calexp_should_copy and test_raw_and_calexp_should_copy_yaml
have two, different now_time_embargo timestamps.

With the new API, it is more difficult to test with multiple
now_time_embargo timestamps in one call. Also we wouldn't use that
in pratical use case anyway.

So, use just the later timestamp, and shift the embargo
period for the raw datasets that used the earlier timestamp.

The amount of shifting is the difference between the two original
now_time_embargo timestamps:
2022-11-13T03:35:12.836981 - 2020-01-17T16:55:11.322700 =
89030401.514281 seconds, or 24730.66708730028 hr.

Instead of an embargo period of 0.1 hr, the new embargo period
is 0.1 + 24730.66708730028 hr.
  • Loading branch information
hsinfang committed Dec 5, 2024
1 parent 6c9416e commit 19b9816
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
10 changes: 3 additions & 7 deletions tests/test_move_embargo_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,15 +307,13 @@ def tearDown(self):
# potentially we won't need to test this in the future
# @KT - we were not planning on running multiple args from
# cli
@unittest.expectedFailure
def test_raw_and_calexp_should_copy(self):
"""
Test that move_embargo_args runs for the calexp datatype
and for the raw datatype at the same time
"""
# first raw, then calexp
# TODO: why two now timestamps?
now_time_embargo = ["2020-01-17T16:55:11.322700", "2022-11-13T03:35:12.836981"]
now_time_embargo = "2022-11-13T03:35:12.836981"
# IDs that should be moved to temp_to:
ids_copied = [
# 2020011700004,
Expand Down Expand Up @@ -348,7 +346,7 @@ def test_raw_and_calexp_should_copy(self):
"dataset_types": "raw",
"collections": "LATISS/raw/all",
"where": "instrument='LATISS'",
"embargo_hours": 0.1,
"embargo_hours": 24730.76708730028,
"is_raw": True,
},
{
Expand Down Expand Up @@ -541,15 +539,13 @@ def test_calexp_should_copy(self):
# desturiprefix="tests/data/",
)

@unittest.expectedFailure
def test_raw_and_calexp_should_copy_yaml(self):
"""
Test that move_embargo_args runs for the calexp datatype
and for the raw datatype at the same time
"""
# first raw, then calexp
# TODO: why two now timestamps?
now_time_embargo = ["2020-01-17T16:55:11.322700", "2022-11-13T03:35:12.836981"]
now_time_embargo = "2022-11-13T03:35:12.836981"
# IDs that should be moved to temp_to:
ids_copied = [
# 2020011700004,
Expand Down
2 changes: 1 addition & 1 deletion tests/yamls/config_all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
- dataset_types: "raw"
collections: "LATISS/raw/all"
where: "instrument='LATISS'"
embargo_hours: 0.1
embargo_hours: 24730.76708730028
is_raw: True
- dataset_types: "calexp"
collections: "LATISS/runs/AUXTEL_DRP_IMAGING_2022-11A/w_2022_46/PREOPS-1616/20221111T182132Z"
Expand Down

0 comments on commit 19b9816

Please sign in to comment.