mirror of
https://github.com/apache/superset.git
synced 2026-04-25 02:55:07 +00:00
build: Parallelize the CI image builds (continued) (#26698)
This commit is contained in:
committed by
GitHub
parent
e00e039ca3
commit
363a8e6b07
@@ -15,30 +15,36 @@ def wrapped(*args, **kwargs):
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"tag, expected_output, branch",
|
||||
"tag, target, platform, expected_output, branch",
|
||||
[
|
||||
("1.0.0", "LATEST_TAG is master", "master"),
|
||||
("2.1.0", "LATEST_TAG is master", "master"),
|
||||
("2.1.1", "LATEST_TAG is latest", "master"),
|
||||
("3.0.0", "LATEST_TAG is latest", "master"),
|
||||
("2.1.0rc1", "LATEST_TAG is 2.1.0", "2.1.0"),
|
||||
("", "LATEST_TAG is foo", "foo"),
|
||||
("2.1", "LATEST_TAG is 2.1", "2.1"),
|
||||
("does_not_exist", "LATEST_TAG is does-not-exist", "does_not_exist"),
|
||||
("1.0.0", "lean", "linux/amd64", "LATEST_TAG is master", "master"),
|
||||
("2.1.0", "lean", "linux/amd64", "LATEST_TAG is master", "master"),
|
||||
("2.1.1", "lean", "linux/amd64", "LATEST_TAG is latest", "master"),
|
||||
("3.0.0", "lean", "linux/amd64", "LATEST_TAG is latest", "master"),
|
||||
("2.1.0rc1", "lean", "linux/amd64", "LATEST_TAG is 2.1.0", "2.1.0"),
|
||||
("", "lean", "linux/amd64", "LATEST_TAG is foo", "foo"),
|
||||
("2.1", "lean", "linux/amd64", "LATEST_TAG is 2.1", "2.1"),
|
||||
(
|
||||
"does_not_exist",
|
||||
"lean",
|
||||
"linux/amd64",
|
||||
"LATEST_TAG is does-not-exist",
|
||||
"does_not_exist",
|
||||
),
|
||||
],
|
||||
)
|
||||
def test_tag_latest_release(tag, expected_output, branch):
|
||||
def test_tag_latest_release(tag, target, platform, expected_output, branch):
|
||||
with mock.patch(
|
||||
"tests.unit_tests.fixtures.bash_mock.subprocess.run", wraps=wrapped
|
||||
) as subprocess_mock:
|
||||
result = BashMock.docker_build_push(tag, branch)
|
||||
result = BashMock.docker_build_push(tag, target, platform, branch)
|
||||
|
||||
cmd = f'./scripts/docker_build_push.sh "{tag}" "{target}" "{platform}"'
|
||||
subprocess_mock.assert_called_once_with(
|
||||
f"./scripts/docker_build_push.sh {tag}",
|
||||
cmd,
|
||||
shell=True,
|
||||
capture_output=True,
|
||||
text=True,
|
||||
env={"TEST_ENV": "true", "GITHUB_REF": f"refs/heads/{branch}"},
|
||||
)
|
||||
|
||||
assert re.search(expected_output, result.stdout, re.MULTILINE)
|
||||
assert re.search(expected_output, result.stdout.strip(), re.MULTILINE)
|
||||
|
||||
Reference in New Issue
Block a user