|
41 | 41 | from easybuild.base.rest import RestClient |
42 | 42 | from easybuild.framework.easyconfig.tools import categorize_files_by_type |
43 | 43 | from easybuild.tools.build_log import EasyBuildError |
44 | | -from easybuild.tools.config import build_option, module_classes |
| 44 | +from easybuild.tools.config import build_option, module_classes, update_build_option |
45 | 45 | from easybuild.tools.configobj import ConfigObj |
46 | 46 | from easybuild.tools.filetools import read_file, write_file |
47 | 47 | from easybuild.tools.github import GITHUB_EASYCONFIGS_REPO, GITHUB_EASYBLOCKS_REPO, GITHUB_MERGEABLE_STATE_CLEAN |
@@ -1051,6 +1051,27 @@ def test_pr_test_report(self): |
1051 | 1051 | regex = re.compile(pattern, re.M) |
1052 | 1052 | self.assertTrue(regex.search(stdout), "Pattern '%s' should be found in: %s" % (regex.pattern, stdout)) |
1053 | 1053 |
|
| 1054 | + # also test combination of --from-pr and --include-easyblocks-from-pr |
| 1055 | + update_build_option('include_easyblocks_from_pr', ['6789']) |
| 1056 | + |
| 1057 | + self.mock_stderr(True) |
| 1058 | + self.mock_stdout(True) |
| 1059 | + post_pr_test_report('1234', gh.GITHUB_EASYCONFIGS_REPO, test_report, "OK!", init_session_state, True) |
| 1060 | + stderr, stdout = self.get_stderr(), self.get_stdout() |
| 1061 | + self.mock_stderr(False) |
| 1062 | + self.mock_stdout(False) |
| 1063 | + |
| 1064 | + self.assertEqual(stderr, '') |
| 1065 | + |
| 1066 | + patterns = [ |
| 1067 | + r"^\[DRY RUN\] Adding comment to easybuild-easyconfigs issue #1234: 'Test report by @easybuild_test", |
| 1068 | + r"^See https://gist.github.com/DRY_RUN for a full test report.'", |
| 1069 | + r"Using easyblocks from PR\(s\) https://github.com/easybuilders/easybuild-easyblocks/pull/6789", |
| 1070 | + ] |
| 1071 | + for pattern in patterns: |
| 1072 | + regex = re.compile(pattern, re.M) |
| 1073 | + self.assertTrue(regex.search(stdout), "Pattern '%s' should be found in: %s" % (regex.pattern, stdout)) |
| 1074 | + |
1054 | 1075 | def test_create_test_report(self): |
1055 | 1076 | """Test create_test_report function.""" |
1056 | 1077 | logfile = os.path.join(self.test_prefix, 'log.txt') |
|
0 commit comments