|
1 | 1 | import copy |
2 | 2 | import logging |
3 | 3 | import os |
| 4 | +import re |
4 | 5 | import textwrap |
5 | 6 |
|
6 | 7 | import pytest |
@@ -210,6 +211,41 @@ def test_py_matrix_on_azure(py_recipe, jinja_env): |
210 | 211 | assert len(os.listdir(matrix_dir)) == 6 |
211 | 212 |
|
212 | 213 |
|
| 214 | +def test_stdlib_on_azure(stdlib_recipe, jinja_env): |
| 215 | + configure_feedstock.render_azure( |
| 216 | + jinja_env=jinja_env, |
| 217 | + forge_config=stdlib_recipe.config, |
| 218 | + forge_dir=stdlib_recipe.recipe, |
| 219 | + ) |
| 220 | + # this configuration should be run |
| 221 | + assert stdlib_recipe.config["azure"]["enabled"] |
| 222 | + matrix_dir = os.path.join(stdlib_recipe.recipe, ".ci_support") |
| 223 | + assert os.path.isdir(matrix_dir) |
| 224 | + # find stdlib-config in generated yaml files (plus version, on unix) |
| 225 | + with open(os.path.join(matrix_dir, "linux_64_.yaml")) as f: |
| 226 | + linux_lines = f.readlines() |
| 227 | + linux_content = "".join(linux_lines) |
| 228 | + # multiline pattern to ensure we don't match other stuff accidentally |
| 229 | + assert bool(re.match(r"(?s).*c_stdlib:\s*- sysroot", linux_content)) |
| 230 | + assert bool( |
| 231 | + re.match(r"(?s).*c_stdlib_version:\s*- ['\"]?2\.\d+", linux_content) |
| 232 | + ) |
| 233 | + with open(os.path.join(matrix_dir, "osx_64_.yaml")) as f: |
| 234 | + osx_lines = f.readlines() |
| 235 | + osx_content = "".join(osx_lines) |
| 236 | + assert bool( |
| 237 | + re.match(r"(?s).*c_stdlib:\s*- macosx_deployment_target", osx_content) |
| 238 | + ) |
| 239 | + assert bool( |
| 240 | + re.match(r"(?s).*c_stdlib_version:\s*- ['\"]?1\d\.\d+", osx_content) |
| 241 | + ) |
| 242 | + with open(os.path.join(matrix_dir, "win_64_.yaml")) as f: |
| 243 | + win_lines = f.readlines() |
| 244 | + win_content = "".join(win_lines) |
| 245 | + assert bool(re.match(r"(?s).*c_stdlib:\s*- vs", win_content)) |
| 246 | + # no stdlib-version expected on windows |
| 247 | + |
| 248 | + |
213 | 249 | def test_upload_on_branch_azure(upload_on_branch_recipe, jinja_env): |
214 | 250 | configure_feedstock.render_azure( |
215 | 251 | jinja_env=jinja_env, |
|
0 commit comments