def test_update_table_job_from_other_buildsysten(all_job_priorities_stored): # We already have a TaskCluster job like this in the DB # The DB entry should be changed to '*' data = { 'build_system_type': 'buildbot', 'platform': 'linux64', 'platform_option': 'opt', 'testtype': 'reftest-e10s-2' } # Before calling update_table the priority is only for TaskCluster assert len(JobPriority.objects.filter( buildsystem='taskcluster', buildtype=data['platform_option'], platform=data['platform'], testtype=data['testtype'], )) == 1 # We are checking that only 1 job was updated ret_val = _update_table([data]) assert ret_val == (0, 0, 1) assert len(JobPriority.objects.filter( buildsystem='*', buildtype=data['platform_option'], platform=data['platform'], testtype=data['testtype'], )) == 1
def test_update_table_job_from_other_buildsysten(all_job_priorities_stored): # We already have a TaskCluster job like this in the DB # The DB entry should be changed to '*' data = { 'build_system_type': 'buildbot', 'platform': 'linux64', 'platform_option': 'opt', 'testtype': 'reftest-e10s-2', } # Before calling update_table the priority is only for TaskCluster assert (len( JobPriority.objects.filter( buildsystem='taskcluster', buildtype=data['platform_option'], platform=data['platform'], testtype=data['testtype'], )) == 1) # We are checking that only 1 job was updated ret_val = _update_table([data]) assert ret_val == (0, 0, 1) assert (len( JobPriority.objects.filter( buildsystem='*', buildtype=data['platform_option'], platform=data['platform'], testtype=data['testtype'], )) == 1)
def test_update_table_no_new_jobs(initial_values, two_weeks, job_priority_list, jp_index_fixture, sanitized_data): ''' We test that once a table has information about job priorities future calls with the same data will not change the table ''' # By doing this we won't need DB access initial_values.return_value = jp_index_fixture, 1, two_weeks assert _update_table(sanitized_data) == (0, 0, 0)
def test_update_table_empty_table(initial_values, jp_save, sanitized_data): ''' We test that starting from an empty table ''' # This set of values is when we're bootstrapping the service (aka empty table) initial_values.return_value = {}, 5, None jp_save.return_value = None # Since we don't want to write to the DB assert _update_table(sanitized_data) == (3, 0, 0)