diff options
| author | Lucas de Castro Borges <lucas@gnuabordo.com.br> | 2025-02-14 14:26:38 -0300 |
|---|---|---|
| committer | Lucas de Castro Borges <lucas@gnuabordo.com.br> | 2025-02-14 14:26:38 -0300 |
| commit | 294bc6ecabf14c09c9bc8644704921dcf97cb44e (patch) | |
| tree | 279b1e0bab53901a1647ac63c1c724f0f789a663 /buildscripts/tests/test_burn_in_tests.py | |
| parent | 70be7c27a251621187a1de533462ae2bb1e3bd39 (diff) | |
| parent | 1e917fd798aa25b7066d4b414b51184f13d5a092 (diff) | |
Update upstream source from tag 'upstream/6.0.10'debian/6.0.10-1
Update to upstream version '6.0.10'
with Debian dir 2d176fa254eee97b139f712fec5709641335a8c3
Diffstat (limited to 'buildscripts/tests/test_burn_in_tests.py')
| -rw-r--r-- | buildscripts/tests/test_burn_in_tests.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/buildscripts/tests/test_burn_in_tests.py b/buildscripts/tests/test_burn_in_tests.py index c51f8c60ecf..369131eff60 100644 --- a/buildscripts/tests/test_burn_in_tests.py +++ b/buildscripts/tests/test_burn_in_tests.py @@ -4,12 +4,14 @@ from __future__ import absolute_import import collections import datetime +from io import StringIO import os import sys import subprocess import unittest from mock import Mock, patch, MagicMock +import yaml import buildscripts.burn_in_tests as under_test from buildscripts.ciconfig.evergreen import parse_evergreen_file, VariantTask @@ -556,3 +558,19 @@ class TestLocalFileChangeDetector(unittest.TestCase): self.assertIn(file_list[2], found_tests) self.assertNotIn(file_list[1], found_tests) self.assertEqual(2, len(found_tests)) + + +class TestYamlBurnInExecutor(unittest.TestCase): + @patch('sys.stdout', new_callable=StringIO) + def test_found_tasks_should_be_reported_as_yaml(self, stdout): + n_tasks = 5 + n_tests = 3 + tests_by_task = create_tests_by_task_mock(n_tasks, n_tests) + + yaml_executor = under_test.YamlBurnInExecutor() + yaml_executor.execute(tests_by_task) + + yaml_raw = stdout.getvalue() + results = yaml.safe_load(yaml_raw) + self.assertEqual(n_tasks, len(results["discovered_tasks"])) + self.assertEqual(n_tests, len(results["discovered_tasks"][0]["test_list"])) |
