Skip to content

Commit 9a8a38d

Browse files
committed
fix
Signed-off-by: emdneto <[email protected]>
1 parent eea33fd commit 9a8a38d

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

tests/opentelemetry-docker-tests/tests/check_availability.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ def check_redis_connection():
112112

113113
def new_mssql_connection() -> pyodbc.Connection:
114114
connection = pyodbc.connect(
115-
f"DRIVER={{ODBC Driver 17 for SQL Server}};SERVER={MSSQL_HOST},"
116-
f"{MSSQL_PORT};DATABASE=master;UID={MSSQL_USER};"
115+
f"DRIVER={{ODBC Driver 18 for SQL Server}};SERVER={MSSQL_HOST},"
116+
f"{MSSQL_PORT};DATABASE=master;UID={MSSQL_USER};TrustServerCertificate=yes;"
117117
f"PWD={MSSQL_PASSWORD};",
118118
autocommit=True,
119119
)

tests/opentelemetry-docker-tests/tests/sqlalchemy_tests/test_mssql.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"password": os.getenv("TEST_MSSQL_PASSWORD", "yourStrong(!)Password"),
3030
"database": os.getenv("TEST_MSSQL_DATABASE", "opentelemetry-tests"),
3131
"driver": os.getenv("TEST_MSSQL_DRIVER", "ODBC+Driver+17+for+SQL+Server"),
32+
"trusted_connection": os.getenv("TEST_MSSQL_TRUSTED_CONNECTION", "yes"),
3233
}
3334

3435

@@ -40,7 +41,7 @@ class MssqlConnectorTestCase(SQLAlchemyTestMixin):
4041
VENDOR = "mssql"
4142
SQL_DB = "opentelemetry-tests"
4243
ENGINE_ARGS = {
43-
"url": "mssql+pyodbc://%(user)s:%(password)s@%(host)s:%(port)s/%(database)s?driver=%(driver)s"
44+
"url": "mssql+pyodbc://%(user)s:%(password)s@%(host)s:%(port)s/%(database)s?driver=%(driver)s&TrustServerCertificate=%(trusted_connection)s"
4445
% MSSQL_CONFIG
4546
}
4647

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1286,7 +1286,7 @@ changedir =
12861286
tests/opentelemetry-docker-tests/tests
12871287

12881288
commands_pre =
1289-
sh -c "sudo apt update -y && sudo ACCEPT_EULA=Y apt-get install -y msodbcsql17 unixodbc-dev unixodbc"
1289+
sh -c "sudo apt update -y && sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18 unixodbc-dev unixodbc"
12901290
python -c "import pyodbc; print(pyodbc.drivers())"
12911291
pip install {env:CORE_REPO}\#egg=opentelemetry-api&subdirectory=opentelemetry-api \
12921292
{env:CORE_REPO}\#egg=opentelemetry-semantic-conventions&subdirectory=opentelemetry-semantic-conventions \

0 commit comments

Comments
 (0)