Test script to decide whether to use tlcpack or tlcpackstaging for images
(tmpdir_factory, images, expected)
| 1284 | ), |
| 1285 | ) |
| 1286 | def test_determine_docker_images(tmpdir_factory, images, expected): |
| 1287 | """Test script to decide whether to use tlcpack or tlcpackstaging for images""" |
| 1288 | script = JENKINS_SCRIPT_ROOT / "determine_docker_images.py" |
| 1289 | |
| 1290 | git_dir = tmpdir_factory.mktemp("tmp_git_dir") |
| 1291 | |
| 1292 | docker_data = { |
| 1293 | "repositories/tlcpack/ci-arm/tags/abc-abc-123": {}, |
| 1294 | "repositories/tlcpack/ci-lint/tags/abc-abc-234": {}, |
| 1295 | } |
| 1296 | |
| 1297 | images_data = { |
| 1298 | "ci_arm": "tlcpack/ci-arm:abc-abc-123", |
| 1299 | "ci_lint": "tlcpack/ci-lint:abc-abc-234", |
| 1300 | "ci_arm2": "tlcpack/ci-arm2:abc-abc-123", |
| 1301 | } |
| 1302 | |
| 1303 | run_script( |
| 1304 | [ |
| 1305 | script, |
| 1306 | "--testing-docker-data", |
| 1307 | json.dumps(docker_data), |
| 1308 | "--testing-images-data", |
| 1309 | json.dumps(images_data), |
| 1310 | "--base-dir", |
| 1311 | git_dir, |
| 1312 | ] |
| 1313 | + images, |
| 1314 | cwd=git_dir, |
| 1315 | ) |
| 1316 | |
| 1317 | for expected_filename, expected_image in expected.items(): |
| 1318 | with open(Path(git_dir) / expected_filename) as f: |
| 1319 | actual_image = f.read() |
| 1320 | |
| 1321 | assert actual_image == expected_image |
| 1322 | |
| 1323 | |
| 1324 | @parameterize_named( |
nothing calls this directly
no test coverage detected
searching dependent graphs…