Skip to content

Commit

Permalink
[TEST] Add torchdata version to smoke tests (#2034)
Browse files Browse the repository at this point in the history
* Add torchdata version to smoke tests

* Debug failure

* Remove print statements

* Resolve PR comments

* Remove prints

Co-authored-by: Nayef Ahmed <nayef211@meta.com>
  • Loading branch information
Nayef211 and Nayef Ahmed authored Jan 27, 2023
1 parent 961dc67 commit e4d2b0f
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/smoke_tests/smoke_tests.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
"""Run smoke tests"""

import re

import torchdata
import torchtext
import torchtext.version # noqa: F401

NIGHTLY_ALLOWED_DELTA = 3


def validateTorchdataVersion():
from datetime import datetime

date_t_str = re.findall(r"dev\d+", torchdata.__version__)[0]
date_t_delta = datetime.now() - datetime.strptime(date_t_str[3:], "%Y%m%d")

if date_t_delta.days >= NIGHTLY_ALLOWED_DELTA:
raise RuntimeError(f"torchdata binary {torchdata.__version__} is more than {NIGHTLY_ALLOWED_DELTA} days old!")


validateTorchdataVersion()
print("torchtext version is ", torchtext.__version__)

0 comments on commit e4d2b0f

Please sign in to comment.