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

DM-46603: Reset expired visit ID calculation for Prompt Processing HSC tests #205

Merged
merged 1 commit into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions python/tester/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,10 @@ def make_compressed_date(date):
Notes
-----
The current implementation gives 4-digit results until September 2024.
The current implementation gives 4-digit results until September 2025.
If this generator is still needed after that, it will need to be tweaked.
"""
year = int(date[:4]) - 2023 # Always 1 digit, 0-1
year = int(date[:4]) - 2024 # Always 1 digit, 0-1
night_id = int(date[-4:]) # Always 4 digits up to 1231
compressed = year*1200 + night_id # Always 4 digits
limit = max_exposure["HSC"] // 10_000
Expand Down
8 changes: 4 additions & 4 deletions tests/test_tester_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,11 @@ def test_get_last_group_hsc(self):
s3 = boto3.resource("s3")
bucket = s3.Bucket(self.bucket_name)

last_group = get_last_group(bucket, "HSC", "20231102")
last_group = get_last_group(bucket, "HSC", "20241102")
self.assertEqual(last_group, "11020002")

# Test the case of no match
last_group = get_last_group(bucket, "HSC", "20240101")
last_group = get_last_group(bucket, "HSC", "20250101")
self.assertEqual(last_group, "13010000")

def test_exposure_id_hsc(self):
Expand Down Expand Up @@ -151,10 +151,10 @@ def test_group_id_hsc_limits(self):
s3 = boto3.resource("s3")
bucket = s3.Bucket(self.bucket_name)

group = get_last_group(bucket, "HSC", "20240930")
group = get_last_group(bucket, "HSC", "20250930")
self.assertEqual(group, "21300000")
with self.assertRaises(RuntimeError):
get_last_group(bucket, "HSC", "20241001")
get_last_group(bucket, "HSC", "20251001")


class TesterGoupIdTest(unittest.TestCase):
Expand Down
Loading