Skip to content

Commit feadfc4

Browse files
Merge branch 'master' into patch-1
2 parents 5c39762 + 62cc2b2 commit feadfc4

File tree

17 files changed

+285
-193
lines changed

17 files changed

+285
-193
lines changed

.github/workflows/attention-label.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Automatically add or remove labels
2+
on:
3+
issue_comment:
4+
types:
5+
- created
6+
jobs:
7+
show-metadata:
8+
runs-on: ubuntu-latest
9+
steps:
10+
# Use environment variable to print the metadata (cf. https://github.com/actions/runner/issues/1656#issuecomment-1030077729).
11+
- name: Show metadata
12+
run: echo $JSON
13+
env:
14+
JSON: ${{ toJson(github.event) }}
15+
add-label:
16+
if: ${{ github.event.comment.user.login != 'tillahoffmann' }}
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Add label
20+
uses: actions-ecosystem/action-add-labels@v1
21+
with:
22+
labels: '👀 requires attention'
23+
remove-label:
24+
if: ${{ github.event.comment.user.login == 'tillahoffmann' }}
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Remove label
28+
uses: actions-ecosystem/action-remove-labels@v1
29+
with:
30+
labels: '👀 requires attention'

.github/workflows/main.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ on:
88
jobs:
99
build:
1010
strategy:
11-
fail-fast: false
1211
matrix:
1312
python-version:
1413
- "3.7"

.github/workflows/triage-label.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Automatically add triage labels to new issues and pull requests
2+
on:
3+
issues:
4+
types:
5+
- opened
6+
jobs:
7+
add-label:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Add label
11+
uses: actions-ecosystem/action-add-labels@v1
12+
with:
13+
labels: '🔀 requires triage'

CODEOWNERS

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/arangodb @nshine
2+
/azurite @pffijt
3+
/clickhouse @yakimka
4+
# /compose
5+
# /core
6+
/elasticsearch @nivm @daTokenizer
7+
/google @tillahoffmann
8+
/kafka @ash1425
9+
/keycloak @timbmg
10+
/localstack @ImFlog
11+
# /meta
12+
/minio @maltehedderich
13+
/mongodb @dabrign
14+
# /mssql
15+
# /mysql
16+
/neo4j @eastlondoner
17+
# /nginx
18+
/opensearch @maltehedderich
19+
# /oracle
20+
# /postgres
21+
/rabbitmq @KerstenBreuer
22+
/redis @daTokenizer
23+
# /selenium

elasticsearch/testcontainers/elasticsearch/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import re
1515
import urllib
1616
from typing import Dict
17+
from urllib.error import URLError
1718

1819
from testcontainers.core.container import DockerContainer
1920
from testcontainers.core.waiting_utils import wait_container_is_ready
@@ -83,7 +84,7 @@ def __init__(self, image="elasticsearch", port_to_expose=9200, **kwargs) -> None
8384
for key, value in _environment_by_version(major_version).items():
8485
self.with_env(key, value)
8586

86-
@wait_container_is_ready()
87+
@wait_container_is_ready(URLError)
8788
def _connect(self) -> None:
8889
res = urllib.request.urlopen(self.get_url())
8990
if res.status != 200:

mssql/testcontainers/mssql/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ class SqlServerContainer(DbContainer):
1515
>>> from testcontainers.mssql import SqlServerContainer
1616
1717
>>> with SqlServerContainer() as mssql:
18-
... e = sqlalchemy.create_engine(mssql.get_connection_url())
19-
... result = e.execute("select @@VERSION")
18+
... engine = sqlalchemy.create_engine(mssql.get_connection_url())
19+
... with engine.begin() as connection:
20+
... result = connection.execute(sqlalchemy.text("select @@VERSION"))
2021
"""
2122

2223
def __init__(self, image: str = "mcr.microsoft.com/mssql/server:2019-latest", user: str = "SA",

mssql/tests/test_mssql.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@ def test_docker_run_mssql():
66
image = 'mcr.microsoft.com/azure-sql-edge'
77
dialect = 'mssql+pymssql'
88
with SqlServerContainer(image, dialect=dialect) as mssql:
9-
e = sqlalchemy.create_engine(mssql.get_connection_url())
10-
result = e.execute('select @@servicename')
11-
for row in result:
12-
assert row[0] == 'MSSQLSERVER'
9+
engine = sqlalchemy.create_engine(mssql.get_connection_url())
10+
with engine.begin() as connection:
11+
result = connection.execute(sqlalchemy.text('select @@servicename'))
12+
for row in result:
13+
assert row[0] == 'MSSQLSERVER'
1314

1415
with SqlServerContainer(image, password="1Secure*Password2", dialect=dialect) as mssql:
15-
e = sqlalchemy.create_engine(mssql.get_connection_url())
16-
result = e.execute('select @@servicename')
17-
for row in result:
18-
assert row[0] == 'MSSQLSERVER'
16+
engine = sqlalchemy.create_engine(mssql.get_connection_url())
17+
with engine.begin() as connection:
18+
result = connection.execute(sqlalchemy.text('select @@servicename'))
19+
for row in result:
20+
assert row[0] == 'MSSQLSERVER'

mysql/testcontainers/mysql/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@ class MySqlContainer(DbContainer):
3232
>>> from testcontainers.mysql import MySqlContainer
3333
3434
>>> with MySqlContainer('mysql:5.7.17') as mysql:
35-
... e = sqlalchemy.create_engine(mysql.get_connection_url())
36-
... result = e.execute("select version()")
37-
... version, = result.fetchone()
35+
... engine = sqlalchemy.create_engine(mysql.get_connection_url())
36+
... with engine.begin() as connection:
37+
... result = connection.execute(sqlalchemy.text("select version()"))
38+
... version, = result.fetchone()
3839
"""
3940

4041
def __init__(self, image: str = "mysql:latest", MYSQL_USER: Optional[str] = None,

mysql/tests/test_mysql.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,20 @@
1010
def test_docker_run_mysql():
1111
config = MySqlContainer('mysql:5.7.17')
1212
with config as mysql:
13-
e = sqlalchemy.create_engine(mysql.get_connection_url())
14-
result = e.execute("select version()")
15-
for row in result:
16-
assert row[0].startswith('5.7.17')
13+
engine = sqlalchemy.create_engine(mysql.get_connection_url())
14+
with engine.begin() as connection:
15+
result = connection.execute(sqlalchemy.text("select version()"))
16+
for row in result:
17+
assert row[0].startswith('5.7.17')
1718

1819

1920
def test_docker_run_mariadb():
2021
with MySqlContainer("mariadb:10.6.5").maybe_emulate_amd64() as mariadb:
21-
e = sqlalchemy.create_engine(mariadb.get_connection_url())
22-
result = e.execute("select version()")
23-
for row in result:
24-
assert row[0].startswith('10.6.5')
22+
engine = sqlalchemy.create_engine(mariadb.get_connection_url())
23+
with engine.begin() as connection:
24+
result = connection.execute(sqlalchemy.text("select version()"))
25+
for row in result:
26+
assert row[0].startswith('10.6.5')
2527

2628

2729
def test_docker_env_variables():

oracle/testcontainers/oracle/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ class OracleDbContainer(DbContainer):
1313
>>> from testcontainers.oracle import OracleDbContainer
1414
1515
>>> with OracleDbContainer() as oracle:
16-
... e = sqlalchemy.create_engine(oracle.get_connection_url())
17-
... result = e.execute("select * from V$VERSION")
16+
... engine = sqlalchemy.create_engine(oracle.get_connection_url())
17+
... with engine.begin() as connection:
18+
... result = connection.execute(sqlalchemy.text("select * from V$VERSION"))
1819
"""
1920

2021
def __init__(self, image: str = "wnameless/oracle-xe-11g-r2:latest", **kwargs) -> None:

0 commit comments

Comments
 (0)