def test_build_graph(self, fetch_allthethings_data): """Test if the graph has the correct format.""" fetch_allthethings_data.return_value = MOCK_ALLTHETHINGS builders = list_builders(repo_name='repo') builders.sort() expected = { 'debug': { 'platform1': { 'tests': ['mochitest-1'], 'Platform1 repo leak test build': ['Platform1 repo debug test mochitest-1'] } }, 'opt': { 'platform1': { 'tests': ['mochitest-1', 'tp5o'], 'Platform1 repo build': [ 'Platform1 repo opt test mochitest-1', 'Platform1 repo talos tp5o' ] } } } self.assertEquals(build_tests_per_platform_graph(builders), expected)
def test_build_graph(self, fetch_allthethings_data): """Test if the graph has the correct format.""" fetch_allthethings_data.return_value = ALLTHETHINGS builders = list_builders( repo_name='try') # XXX: why are we only choosing try? new_graph = build_tests_per_platform_graph(builders) assert new_graph == GRAPH_RESULT
def load_graph(generateNew=False): global BUILDERS_GRAPH if generateNew is True or not os.path.isfile(GRAPH_JSON_FILENAME): BUILDERS_GRAPH = build_tests_per_platform_graph(builders=list_builders()) else: with open(GRAPH_JSON_FILENAME) as data_file: BUILDERS_GRAPH = json.load(data_file) save_graph_to_json(BUILDERS_GRAPH)
def test_build_graph(self, fetch_allthethings_data): """Test if the graph has the correct format.""" fetch_allthethings_data.return_value = MOCK_ALLTHETHINGS builders = list_builders(repo_name='repo') builders.sort() expected = { 'debug': { 'platform1': { 'tests': ['mochitest-1'], 'Platform1 repo leak test build': [ 'Platform1 repo debug test mochitest-1'] } }, 'opt': { 'platform1': { 'tests': ['mochitest-1', 'tp5o'], 'Platform1 repo build': [ 'Platform1 repo opt test mochitest-1', 'Platform1 repo talos tp5o'] } } } self.assertEquals(build_tests_per_platform_graph(builders), expected)
"""This script writes a mapping from platforms to tests that run in it to graph.json.""" import ujson as json from mozci.platforms import build_tests_per_platform_graph, _filter_builders_matching from mozci.sources.allthethings import fetch_allthethings_data from mozci.utils.transfer import path_to_file if __name__ == '__main__': with open(path_to_file('graph.json'), 'w') as f: builders = _filter_builders_matching(fetch_allthethings_data()['builders'], " try ") graph = build_tests_per_platform_graph(builders) json.dump(graph, f, sort_keys=True, indent=4, separators=(',', ': '))
"""This script writes a mapping from platforms to tests that run in it to graph.json.""" import json from mozci.platforms import build_tests_per_platform_graph, list_builders from mozci.utils.transfer import path_to_file if __name__ == '__main__': with open(path_to_file('graph.json'), 'w') as f: graph = build_tests_per_platform_graph(builders=list_builders( repo_name='try')) json.dump(graph, f, sort_keys=True, indent=4, separators=(',', ': '))
"""This script writes a mapping from platforms to tests that run in it to graph.json.""" import json from mozci.platforms import build_tests_per_platform_graph, list_builders from mozci.utils.transfer import path_to_file if __name__ == '__main__': with open(path_to_file('graph.json'), 'w') as f: graph = build_tests_per_platform_graph( builders=list_builders()) json.dump(graph, f, sort_keys=True, indent=4, separators=(',', ': '))
def test_build_graph(self, fetch_allthethings_data): """Test if the graph has the correct format.""" fetch_allthethings_data.return_value = ALLTHETHINGS builders = list_builders(repo_name='try') # XXX: why are we only choosing try? new_graph = build_tests_per_platform_graph(builders) assert new_graph == GRAPH_RESULT
"""This script writes a mapping from platforms to tests that run in it to graph.json.""" import json from mozci.platforms import build_tests_per_platform_graph, _filter_builders_matching from mozci.sources.allthethings import fetch_allthethings_data from mozci.utils.transfer import path_to_file if __name__ == '__main__': with open(path_to_file('graph.json'), 'w') as f: builders = _filter_builders_matching( fetch_allthethings_data()['builders'], " try ") graph = build_tests_per_platform_graph(builders) json.dump(graph, f, sort_keys=True, indent=4, separators=(',', ': '))
from mozci.platforms import ( build_tests_per_platform_graph, list_builders ) import json print json.dumps( build_tests_per_platform_graph( list_builders(repo_name='try') ), indent=4, sort_keys=True )
"""This script writes a mapping from platforms to tests that run in it to graph.json.""" import json from mozci.platforms import build_tests_per_platform_graph, list_builders from mozci.utils.transfer import path_to_file if __name__ == '__main__': with open(path_to_file('graph.json'), 'w') as f: graph = build_tests_per_platform_graph(builders=list_builders()) json.dump(graph, f, sort_keys=True, indent=4, separators=(',', ': '))