forked from mirrors/gecko-dev
		
	 d793d59bb4
			
		
	
	
		d793d59bb4
		
	
	
	
	
		
			
			This makes it easier to diagnose why the integration test failed. Differential Revision: https://phabricator.services.mozilla.com/D94328
		
			
				
	
	
		
			58 lines
		
	
	
	
		
			1.6 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			58 lines
		
	
	
	
		
			1.6 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
| # Any copyright is dedicated to the public domain.
 | |
| # http://creativecommons.org/publicdomain/zero/1.0/
 | |
| 
 | |
| from __future__ import absolute_import, print_function, unicode_literals
 | |
| 
 | |
| import pytest
 | |
| from mozunit import main
 | |
| 
 | |
| pytestmark = pytest.mark.slow
 | |
| PARAMS = {
 | |
|     "backstop": True,
 | |
|     "head_repository": "https://hg.mozilla.org/integration/autoland",
 | |
|     "project": "autoland",
 | |
| }
 | |
| 
 | |
| 
 | |
| def test_generate_graph(optimized_task_graph):
 | |
|     """Simply tests that generating the graph does not fail."""
 | |
|     assert len(optimized_task_graph.tasks) > 0
 | |
| 
 | |
| 
 | |
| @pytest.mark.parametrize(
 | |
|     "func,min_expected",
 | |
|     (
 | |
|         pytest.param(
 | |
|             lambda t: t.kind == "build" and "fuzzing" in t.attributes["build_platform"],
 | |
|             5,
 | |
|             id="fuzzing builds",
 | |
|         ),
 | |
|     ),
 | |
| )
 | |
| def test_tasks_are_scheduled(optimized_task_graph, filter_tasks, func, min_expected):
 | |
|     """Ensure the specified tasks are scheduled on mozilla-central."""
 | |
|     tasks = [t.label for t in filter_tasks(optimized_task_graph, func)]
 | |
|     assert len(tasks) >= min_expected
 | |
| 
 | |
| 
 | |
| @pytest.mark.parametrize(
 | |
|     "func",
 | |
|     (
 | |
|         pytest.param(
 | |
|             lambda t: t.kind == "build" and "ccov" in t.attributes["build_platform"],
 | |
|             id="no ccov builds",
 | |
|         ),
 | |
|     ),
 | |
| )
 | |
| def test_tasks_are_not_scheduled(
 | |
|     optimized_task_graph, filter_tasks, print_dependents, func
 | |
| ):
 | |
|     """Ensure the specified tasks are not scheduled on autoland."""
 | |
|     tasks = [t.label for t in filter_tasks(optimized_task_graph, func)]
 | |
|     for t in tasks:
 | |
|         print_dependents(optimized_task_graph, t)
 | |
|     assert tasks == []
 | |
| 
 | |
| 
 | |
| if __name__ == "__main__":
 | |
|     main()
 |