Test workflow to open a PR to update Docker images
(
tmpdir_factory, tlcpackstaging_body, tlcpack_body, expected, expected_images
)
| 1225 | ), |
| 1226 | ) |
| 1227 | def test_open_docker_update_pr( |
| 1228 | tmpdir_factory, tlcpackstaging_body, tlcpack_body, expected, expected_images |
| 1229 | ): |
| 1230 | """Test workflow to open a PR to update Docker images""" |
| 1231 | tag_script = JENKINS_SCRIPT_ROOT / "open_docker_update_pr.py" |
| 1232 | |
| 1233 | git = TempGit(tmpdir_factory.mktemp("tmp_git_dir")) |
| 1234 | git.run("config", "user.name", "ci") |
| 1235 | git.run("config", "user.email", "email@example.com") |
| 1236 | images = [ |
| 1237 | "ci_arm", |
| 1238 | "ci_cortexm", |
| 1239 | "ci_cpu", |
| 1240 | "ci_gpu", |
| 1241 | "ci_lint", |
| 1242 | "ci_minimal", |
| 1243 | "ci_riscv", |
| 1244 | "ci_wasm", |
| 1245 | ] |
| 1246 | |
| 1247 | docker_data = {} |
| 1248 | for image in images: |
| 1249 | docker_data[f"repositories/tlcpackstaging/{image}/tags"] = tlcpackstaging_body |
| 1250 | docker_data[f"repositories/tlcpack/{image.replace('_', '-')}/tags"] = tlcpack_body |
| 1251 | |
| 1252 | proc = run_script( |
| 1253 | [ |
| 1254 | tag_script, |
| 1255 | "--dry-run", |
| 1256 | "--testing-docker-data", |
| 1257 | json.dumps(docker_data), |
| 1258 | ], |
| 1259 | cwd=git.cwd, |
| 1260 | env={"GITHUB_TOKEN": "1234"}, |
| 1261 | stderr=subprocess.STDOUT, |
| 1262 | ) |
| 1263 | |
| 1264 | for line in expected_images: |
| 1265 | if line not in proc.stdout: |
| 1266 | raise RuntimeError(f"Missing line {line} in output:\n{proc.stdout}") |
| 1267 | |
| 1268 | assert_in(expected, proc.stdout) |
| 1269 | |
| 1270 | |
| 1271 | @parameterize_named( |
nothing calls this directly
no test coverage detected
searching dependent graphs…