fix erroring tests #19

Closed
poblahblahblah opened this Issue Nov 26, 2012 · 4 comments

Comments

Projects
None yet
2 participants
@poblahblahblah
Collaborator

poblahblahblah commented Nov 26, 2012

we should probably fix the tests that are erroring out

@ghost ghost assigned porcupie Nov 26, 2012

@porcupie

This comment has been minimized.

Show comment Hide comment
@porcupie

porcupie Nov 28, 2012

Collaborator

Just keeping some notes on investigation. Having trouble reproducing spec failures that are seen in failed builds. This spec fails intermittently for me on Mac OS X, ruby 1.9.3:

Failures:

  1) CallList verify oncall auto-assignment generates oncall assignments correctly for the first time
     Failure/Error: @call_list.oncall_assignments.size.should be == AppConfig.oncall_assignments_gen['from_now'] + 1
       expected: == 5
            got:    6
     # ./spec/models/call_list_spec.rb:111:in `block (3 levels) in <top (required)>'

Finished in 4.52 seconds
30 examples, 1 failure

Failed examples:

rspec ./spec/models/call_list_spec.rb:105 # CallList verify oncall auto-assignment generates oncall assignments correctly for the first time
Collaborator

porcupie commented Nov 28, 2012

Just keeping some notes on investigation. Having trouble reproducing spec failures that are seen in failed builds. This spec fails intermittently for me on Mac OS X, ruby 1.9.3:

Failures:

  1) CallList verify oncall auto-assignment generates oncall assignments correctly for the first time
     Failure/Error: @call_list.oncall_assignments.size.should be == AppConfig.oncall_assignments_gen['from_now'] + 1
       expected: == 5
            got:    6
     # ./spec/models/call_list_spec.rb:111:in `block (3 levels) in <top (required)>'

Finished in 4.52 seconds
30 examples, 1 failure

Failed examples:

rspec ./spec/models/call_list_spec.rb:105 # CallList verify oncall auto-assignment generates oncall assignments correctly for the first time
@porcupie

This comment has been minimized.

Show comment Hide comment
@porcupie

porcupie Nov 28, 2012

Collaborator

Ah! I was using poblahblahblah/ringring instead of darrendao/ringring. Now I have this failing spec:

Failures:

  1) Call Lists POST /call_lists creates and displays call list with correct oncall cycle time
     Failure/Error: page.should have_content('1:23')
       expected there to be content "1:23" in "Ringring\n  \n    \n      RingRing\n    \n    \n    \n      Home\n        Users Management\n        Call Lists\n        \n          Logged in as admin\n          Logout\n        \n      \n    \n    \nCall list was successfully created.\n\n  Basic Info\n    Twilio List ID: 795\n    Name: calllist3\n    Phonetic Name: \n    Owners: admin\n    Email: \n  \n    Edit Call List\n  \n  \n\n  Current Oncalls\n    \n      \n   Empty\n\n\n    \n    \n      View All Oncall Assignments\n      Add Oncall Assignment\n        \n    \n    \n      \n  User: admin |  -----------------------\n  From: \n  To: \n  Retry: \n   \n\n   function get_time_zone_offset(date) {\n     var gmt_offset = -date.getTimezoneOffset( )/60;\n     return gmt_offset;\n   }\n   function get_timezone(date) {\n     var i = get_time_zone_offset(date);\n     var timezone = (i >= 0 ? '+' : '-') + ('0' + Math.abs(i).toString()).slice(-2) + '00'\n     return timezone\n   }\n\n   $('.timefield').datetimepicker({ \n                  stepMinute: 5,\n                  hour: 8,\n                  timeFormat: 'hh:mm',\n                  //timeFormat: 'hh:mm z',\n                  //showTimezone: true,\n                  timezoneList: my_timezone,\n                  timezone: get_timezone(new Date()) \n   });\n\n \n  \n  \n  Oncall Calendar\n    \n\n\n//<![CDATA[\n\n$(document).ready(function(){\n  var date = new Date();\n  var d = date.getDate();\n  var m = date.getMonth();\n  var y = date.getFullYear();\n\n  $('#calendar').fullCalendar({\n    header: {\n            left: 'prev,next today',\n            center: 'title',\n            right: 'month,basicWeek,basicDay'\n    },\n    editable: true,\n    theme: true,\n\n    selectable: true,\n    selectHelper: true,\n    select: function(start, end, allDay) {\n      $('.nyroModal').nmCall();\n      // $('#oncall_assignment_starts_at').val(start.format('m/d/Y 08:00 O'));\n      $('#oncall_assignment_starts_at').val(start.format('m/d/Y 08:00'));\n      $('#oncall_assignment_ends_at').val(end.format('m/d/Y 08:00'));\n    },\n\n    //http://arshaw.com/fullcalendar/docs/event_ui/eventDrop/\n    eventDrop: function(event, dayDelta, minuteDelta, allDay, revertFunc){\n        updateEvent(event);\n    },\n\n    // http://arshaw.com/fullcalendar/docs/event_ui/eventResize/\n    eventResize: function(event, dayDelta, minuteDelta, revertFunc){\n        updateEvent(event);\n    },\n\n    eventClick: function(event, jsEvent, view) {\n        if(event.url) {\n           jsEvent.preventDefault();\n           $.nmManual(event.url);\n        }                    \n    }, \n    \n    eventSources: [{\n        url: 'http://www.example.com/call_lists/calllist3/oncall_assignments',\n        color: 'blue',\n        textColor: 'white',\n        ignoreTimezone: true\n      },\n      {\n        url: '/call_lists/members_vacations?id=1',\n        color: 'lightblue',\n        textColor: 'black',\n        ignoreTimezone: true,\n        editable: false\n      }\n    ]\n  });\n\n  addCalButton(\"left\", \"Export iCal\", \"export_ical\");\n  $(\"#export_ical\").click(function () { \n    location.href = \"/call_list_calendars/ical?id=1\";\n  });\n\n});\n\nfunction updateEvent(the_event) {\n  $.ajax({\n    type: \"PUT\",\n    url: the_event.url + \".js\",\n    data: { oncall_assignment: { oncall: the_event.title,\n                             starts_at: \"\" + the_event.start,\n                             ends_at: \"\" + the_event.end\n                           }\n          }\n  }).done(function( msg ) {\n    //alert(\"Updated successfully\");\n  });\n}\n\nfunction addCalButton(where, text, id) {\n    var my_button = '<span class=\"fc-header-space\"></span>' +\n                    '<span id=\"' + id + '\" class=\"fc-button ui-state-disabled\"><span class=\"fc-button-inner\">' + text +'</span></span>';\n    $(\"td.fc-header-\" + where).append(my_button);\n    $(\"#\" + id).button();\n}\n\n\n//]]>\n\n  \n    Tip: You can add and modify oncall assignments by directly clicking/dragging on the calendar.\n  \n\n\n\nCall Escalations\n\n  Empty\n\n\n  \n  User: admin |  -----------------------\n  Retry: \n  | Done\n\n\n\n  Add Entry\n\n\n\n\nBusiness Hours\n  Mon from 08:00:00 AM MST\n  to 06:00:00 PM MST\n  Tue from 08:00:00 AM MST\n  to 06:00:00 PM MST\n  Wed from 08:00:00 AM MST\n  to 06:00:00 PM MST\n  Thu from 08:00:00 AM MST\n  to 06:00:00 PM MST\n  Fri from 08:00:00 AM MST\n  to 06:00:00 PM MST\n\nSmart Contact Specs\n\n\nDuring business hour\nEmpty\n\n\nDuring off hour\nEmpty\n\n\n\n\n  \n  Hour Type: business_houroff_hour\n  Contact Type: group_emailmember_emailsmember_smsoncall_emailsoncall_sms\n  | Done\n\n\n\n  Add Entry\n  View Smart Contacts\n\n\n\n\nMembers\n\n  \n\n\n    \n    admin | admin@example.com |  |\n     \n    Remove\n  \n\n\n  \n  User: admin |   Oncall candidate?\n  \n  | Done\n\n\n\n  Add Member\n\n\n\n\n//<![CDATA[\n\n$(document).ready(function(){\n   $('#call_escalations').sortable({\n       axis: 'y',\n       dropOnEmpty: false,\n       cursor: 'crosshair',\n       items: 'li',\n       opacity: 0.4,\n       scroll: true,\n       update: function(){\n          $.ajax({\n              type: 'post',\n              data: $('#call_escalations').sortable('serialize'),\n              dataType: 'script',\n              complete: function(request){\n                 $('#call_escalations').effect('highlight');\n              },\n              url : \"/call_lists/1/call_escalations/sort\"\n          })\n       }\n   });\n\n\n  $('#call_list_memberships').sortable({\n       axis: 'y',\n       dropOnEmpty: false,\n       cursor: 'crosshair',\n       items: 'li',\n       opacity: 0.4,\n       scroll: true,\n       update: function(){\n          $.ajax({\n              type: 'post',\n              data: $('#call_list_memberships').sortable('serialize'),\n              dataType: 'script',\n              complete: function(request){\n                 $('#call_list_memberships').effect('highlight');\n              },\n              url : \"/call_lists/1/call_list_memberships/sort\"\n          })\n       }\n  });\n\n  $('#showcalendar').click(function() {\n    $('#oncall_calendar').toggle();\n    $('#calendar').fullCalendar( 'today' );\n  });\n\n  $('.nyroModal').nyroModal();\n\n});\n\n//]]>\n\n\n    \n  \n"
     # ./spec/requests/call_lists_spec.rb:40:in `block (3 levels) in <top (required)>'

Finished in 4.71 seconds
30 examples, 1 failure

Failed examples:

rspec ./spec/requests/call_lists_spec.rb:31 # Call Lists POST /call_lists creates and displays call list with correct oncall cycle time


Collaborator

porcupie commented Nov 28, 2012

Ah! I was using poblahblahblah/ringring instead of darrendao/ringring. Now I have this failing spec:

Failures:

  1) Call Lists POST /call_lists creates and displays call list with correct oncall cycle time
     Failure/Error: page.should have_content('1:23')
       expected there to be content "1:23" in "Ringring\n  \n    \n      RingRing\n    \n    \n    \n      Home\n        Users Management\n        Call Lists\n        \n          Logged in as admin\n          Logout\n        \n      \n    \n    \nCall list was successfully created.\n\n  Basic Info\n    Twilio List ID: 795\n    Name: calllist3\n    Phonetic Name: \n    Owners: admin\n    Email: \n  \n    Edit Call List\n  \n  \n\n  Current Oncalls\n    \n      \n   Empty\n\n\n    \n    \n      View All Oncall Assignments\n      Add Oncall Assignment\n        \n    \n    \n      \n  User: admin |  -----------------------\n  From: \n  To: \n  Retry: \n   \n\n   function get_time_zone_offset(date) {\n     var gmt_offset = -date.getTimezoneOffset( )/60;\n     return gmt_offset;\n   }\n   function get_timezone(date) {\n     var i = get_time_zone_offset(date);\n     var timezone = (i >= 0 ? '+' : '-') + ('0' + Math.abs(i).toString()).slice(-2) + '00'\n     return timezone\n   }\n\n   $('.timefield').datetimepicker({ \n                  stepMinute: 5,\n                  hour: 8,\n                  timeFormat: 'hh:mm',\n                  //timeFormat: 'hh:mm z',\n                  //showTimezone: true,\n                  timezoneList: my_timezone,\n                  timezone: get_timezone(new Date()) \n   });\n\n \n  \n  \n  Oncall Calendar\n    \n\n\n//<![CDATA[\n\n$(document).ready(function(){\n  var date = new Date();\n  var d = date.getDate();\n  var m = date.getMonth();\n  var y = date.getFullYear();\n\n  $('#calendar').fullCalendar({\n    header: {\n            left: 'prev,next today',\n            center: 'title',\n            right: 'month,basicWeek,basicDay'\n    },\n    editable: true,\n    theme: true,\n\n    selectable: true,\n    selectHelper: true,\n    select: function(start, end, allDay) {\n      $('.nyroModal').nmCall();\n      // $('#oncall_assignment_starts_at').val(start.format('m/d/Y 08:00 O'));\n      $('#oncall_assignment_starts_at').val(start.format('m/d/Y 08:00'));\n      $('#oncall_assignment_ends_at').val(end.format('m/d/Y 08:00'));\n    },\n\n    //http://arshaw.com/fullcalendar/docs/event_ui/eventDrop/\n    eventDrop: function(event, dayDelta, minuteDelta, allDay, revertFunc){\n        updateEvent(event);\n    },\n\n    // http://arshaw.com/fullcalendar/docs/event_ui/eventResize/\n    eventResize: function(event, dayDelta, minuteDelta, revertFunc){\n        updateEvent(event);\n    },\n\n    eventClick: function(event, jsEvent, view) {\n        if(event.url) {\n           jsEvent.preventDefault();\n           $.nmManual(event.url);\n        }                    \n    }, \n    \n    eventSources: [{\n        url: 'http://www.example.com/call_lists/calllist3/oncall_assignments',\n        color: 'blue',\n        textColor: 'white',\n        ignoreTimezone: true\n      },\n      {\n        url: '/call_lists/members_vacations?id=1',\n        color: 'lightblue',\n        textColor: 'black',\n        ignoreTimezone: true,\n        editable: false\n      }\n    ]\n  });\n\n  addCalButton(\"left\", \"Export iCal\", \"export_ical\");\n  $(\"#export_ical\").click(function () { \n    location.href = \"/call_list_calendars/ical?id=1\";\n  });\n\n});\n\nfunction updateEvent(the_event) {\n  $.ajax({\n    type: \"PUT\",\n    url: the_event.url + \".js\",\n    data: { oncall_assignment: { oncall: the_event.title,\n                             starts_at: \"\" + the_event.start,\n                             ends_at: \"\" + the_event.end\n                           }\n          }\n  }).done(function( msg ) {\n    //alert(\"Updated successfully\");\n  });\n}\n\nfunction addCalButton(where, text, id) {\n    var my_button = '<span class=\"fc-header-space\"></span>' +\n                    '<span id=\"' + id + '\" class=\"fc-button ui-state-disabled\"><span class=\"fc-button-inner\">' + text +'</span></span>';\n    $(\"td.fc-header-\" + where).append(my_button);\n    $(\"#\" + id).button();\n}\n\n\n//]]>\n\n  \n    Tip: You can add and modify oncall assignments by directly clicking/dragging on the calendar.\n  \n\n\n\nCall Escalations\n\n  Empty\n\n\n  \n  User: admin |  -----------------------\n  Retry: \n  | Done\n\n\n\n  Add Entry\n\n\n\n\nBusiness Hours\n  Mon from 08:00:00 AM MST\n  to 06:00:00 PM MST\n  Tue from 08:00:00 AM MST\n  to 06:00:00 PM MST\n  Wed from 08:00:00 AM MST\n  to 06:00:00 PM MST\n  Thu from 08:00:00 AM MST\n  to 06:00:00 PM MST\n  Fri from 08:00:00 AM MST\n  to 06:00:00 PM MST\n\nSmart Contact Specs\n\n\nDuring business hour\nEmpty\n\n\nDuring off hour\nEmpty\n\n\n\n\n  \n  Hour Type: business_houroff_hour\n  Contact Type: group_emailmember_emailsmember_smsoncall_emailsoncall_sms\n  | Done\n\n\n\n  Add Entry\n  View Smart Contacts\n\n\n\n\nMembers\n\n  \n\n\n    \n    admin | admin@example.com |  |\n     \n    Remove\n  \n\n\n  \n  User: admin |   Oncall candidate?\n  \n  | Done\n\n\n\n  Add Member\n\n\n\n\n//<![CDATA[\n\n$(document).ready(function(){\n   $('#call_escalations').sortable({\n       axis: 'y',\n       dropOnEmpty: false,\n       cursor: 'crosshair',\n       items: 'li',\n       opacity: 0.4,\n       scroll: true,\n       update: function(){\n          $.ajax({\n              type: 'post',\n              data: $('#call_escalations').sortable('serialize'),\n              dataType: 'script',\n              complete: function(request){\n                 $('#call_escalations').effect('highlight');\n              },\n              url : \"/call_lists/1/call_escalations/sort\"\n          })\n       }\n   });\n\n\n  $('#call_list_memberships').sortable({\n       axis: 'y',\n       dropOnEmpty: false,\n       cursor: 'crosshair',\n       items: 'li',\n       opacity: 0.4,\n       scroll: true,\n       update: function(){\n          $.ajax({\n              type: 'post',\n              data: $('#call_list_memberships').sortable('serialize'),\n              dataType: 'script',\n              complete: function(request){\n                 $('#call_list_memberships').effect('highlight');\n              },\n              url : \"/call_lists/1/call_list_memberships/sort\"\n          })\n       }\n  });\n\n  $('#showcalendar').click(function() {\n    $('#oncall_calendar').toggle();\n    $('#calendar').fullCalendar( 'today' );\n  });\n\n  $('.nyroModal').nyroModal();\n\n});\n\n//]]>\n\n\n    \n  \n"
     # ./spec/requests/call_lists_spec.rb:40:in `block (3 levels) in <top (required)>'

Finished in 4.71 seconds
30 examples, 1 failure

Failed examples:

rspec ./spec/requests/call_lists_spec.rb:31 # Call Lists POST /call_lists creates and displays call list with correct oncall cycle time


@porcupie

This comment has been minimized.

Show comment Hide comment
@porcupie

porcupie Nov 29, 2012

Collaborator

I would bet that this is a Timezone issue - possibly passing on our own boxes (likely system time set to Pacific TZ and rails using UTC) whereas Travis might be running on a system with a different timezone. Getting closer to green though, last build only had 1 failure and seemed related to TZ offset

Collaborator

porcupie commented Nov 29, 2012

I would bet that this is a Timezone issue - possibly passing on our own boxes (likely system time set to Pacific TZ and rails using UTC) whereas Travis might be running on a system with a different timezone. Getting closer to green though, last build only had 1 failure and seemed related to TZ offset

@porcupie

This comment has been minimized.

Show comment Hide comment
@porcupie

porcupie Nov 29, 2012

Collaborator

I think I fixed this with commit d1c5656, so closing this for now. We can always open up a new ticket if the issue reoccurs or we want to go over the Timezone issue in ruby/rails in more detail (very common to have issues with Time since ruby is a bit schizophrenic there)

Collaborator

porcupie commented Nov 29, 2012

I think I fixed this with commit d1c5656, so closing this for now. We can always open up a new ticket if the issue reoccurs or we want to go over the Timezone issue in ruby/rails in more detail (very common to have issues with Time since ruby is a bit schizophrenic there)

@porcupie porcupie closed this Nov 29, 2012

@porcupie porcupie closed this Nov 29, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment