Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start of mariadb-client image tests #378

Merged
merged 1 commit into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions bci_tester/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,18 +558,30 @@ def create_BCI(
create_BCI(
build_tag=f"{APP_CONTAINER_PREFIX}/mariadb:{mariadb_ver}",
bci_type=ImageType.APPLICATION,
available_versions=maria_versions,
available_versions=os_versions,
forwarded_ports=[PortForwarding(container_port=3306)],
extra_environment_variables={
"MARIADB_ROOT_PASSWORD": MARIADB_ROOT_PASSWORD
},
)
for mariadb_ver, maria_versions in (
for mariadb_ver, os_versions in (
("10.6", ("15.5", "15.6")),
("11.2", ("tumbleweed",)),
)
]

MARIADB_CLIENT_CONTAINERS = [
create_BCI(
build_tag=f"{APP_CONTAINER_PREFIX}/mariadb-client:{mariadb_client_ver}",
bci_type=ImageType.APPLICATION,
available_versions=os_versions,
custom_entry_point="/bin/sh",
)
for mariadb_client_ver, os_versions in (
("10.6", ("15.5", "15.6")),
("11.2", ("tumbleweed",)),
)
]

POSTGRES_PASSWORD = "n0ts3cr3t"

Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ markers = [
'golang_stable-openssl',
'mariadb_10.6',
'mariadb_11.2',
'mariadb-client_10.6',
'mariadb-client_11.2',
'nodejs_16',
'nodejs_18',
'nodejs_20',
Expand Down
12 changes: 12 additions & 0 deletions tests/test_mariadb.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from tenacity import stop_after_attempt
from tenacity import wait_exponential

from bci_tester.data import MARIADB_CLIENT_CONTAINERS
from bci_tester.data import MARIADB_CONTAINERS
from bci_tester.data import MARIADB_ROOT_PASSWORD

Expand Down Expand Up @@ -136,3 +137,14 @@ def wait_for_db_to_start():
with conn.cursor() as cur:
cur.execute("SELECT * FROM test;")
assert cur.fetchone() == (1, 100, "abc'def")


@pytest.mark.parametrize(
"container_per_test",
MARIADB_CLIENT_CONTAINERS,
indirect=["container_per_test"],
)
def test_mariadb_client(container_per_test: ContainerData) -> None:
assert "MariaDB" in container_per_test.connection.check_output(
"mysql --version"
)
Loading