Skip to content

Commit

Permalink
Fix raw failures of cdash_build_testing_date_UnitTests.py at start of…
Browse files Browse the repository at this point in the history
… the hour

The tests that used the actual time were fragile and would break if run at
HH:59 or HH:1.  The updated unit tests will just be skipped if they fall at
these boundries.
  • Loading branch information
bartlettroscoe committed Feb 19, 2019
1 parent 64a7ba1 commit 4e8cf7d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/ci_support/cdash_build_testing_date_UnitTests.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ def test_today_dayIncr_minus_3(self):

def test_right_now_previous_day(self):
nowUtc = datetime.datetime.utcnow()
if nowUtc.minute+1 >= 60:
return # Skip the test if ran at 59 minutes after hour!
testingDayStartTime = str(nowUtc.hour)+":"+str(nowUtc.minute+1)
cmndArgs = [
"--cdash-project-start-time='"+testingDayStartTime+"'",
Expand All @@ -217,6 +219,8 @@ def test_right_now_previous_day(self):

def test_right_now_next_day(self):
nowUtc = datetime.datetime.utcnow()
if nowUtc.minute-1 < 0:
return # Skip the test if ran at 0 minutes after the hour
testingDayStartTime = str(nowUtc.hour)+":"+str(nowUtc.minute-1)
cmndArgs = [
"--cdash-project-start-time='"+testingDayStartTime+"'",
Expand Down

0 comments on commit 4e8cf7d

Please sign in to comment.