Skip to content

Commit d7d7e96

Browse files
authored
fix: shellcheck and docker-tests in CI (#2905)
1 parent 6a54106 commit d7d7e96

File tree

5 files changed

+13
-7
lines changed

5 files changed

+13
-7
lines changed

Diff for: .github/workflows/generate_workflows_lib/src/generate_workflows_lib/misc.yml.j2

-2
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,11 @@ jobs:
4646
- name: Checkout pull request
4747
run: git checkout ${% raw %}{{ github.event.pull_request.head.sha }}{% endraw %}
4848
{%- endif %}
49-
{%- if job_data != "shellcheck" %}
5049

5150
- name: Set up Python 3.10
5251
uses: actions/setup-python@v5
5352
with:
5453
python-version: "3.10"
55-
{%- endif %}
5654

5755
- name: Install tox
5856
run: pip install tox

Diff for: .github/workflows/misc_0.yml

+5
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,11 @@ jobs:
122122
- name: Checkout repo @ SHA - ${{ github.sha }}
123123
uses: actions/checkout@v4
124124

125+
- name: Set up Python 3.10
126+
uses: actions/setup-python@v5
127+
with:
128+
python-version: "3.10"
129+
125130
- name: Install tox
126131
run: pip install tox
127132

Diff for: tests/opentelemetry-docker-tests/tests/check_availability.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ 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};"
117-
f"PWD={MSSQL_PASSWORD}",
115+
f"DRIVER={{ODBC Driver 18 for SQL Server}};SERVER={MSSQL_HOST},"
116+
f"{MSSQL_PORT};DATABASE=master;UID={MSSQL_USER};TrustServerCertificate=yes;"
117+
f"PWD={MSSQL_PASSWORD};",
118118
autocommit=True,
119119
)
120120
return connection

Diff for: tests/opentelemetry-docker-tests/tests/sqlalchemy_tests/test_mssql.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
"user": os.getenv("TEST_MSSQL_USER", "sa"),
2929
"password": os.getenv("TEST_MSSQL_PASSWORD", "yourStrong(!)Password"),
3030
"database": os.getenv("TEST_MSSQL_DATABASE", "opentelemetry-tests"),
31-
"driver": os.getenv("TEST_MSSQL_DRIVER", "ODBC+Driver+17+for+SQL+Server"),
31+
"driver": os.getenv("TEST_MSSQL_DRIVER", "ODBC+Driver+18+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

Diff for: tox.ini

+2
Original file line numberDiff line numberDiff line change
@@ -1286,6 +1286,8 @@ 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 msodbcsql18 unixodbc-dev unixodbc"
1290+
python -c "import pyodbc; print(pyodbc.drivers())"
12891291
pip install {env:CORE_REPO}\#egg=opentelemetry-api&subdirectory=opentelemetry-api \
12901292
{env:CORE_REPO}\#egg=opentelemetry-semantic-conventions&subdirectory=opentelemetry-semantic-conventions \
12911293
{env:CORE_REPO}\#egg=opentelemetry-sdk&subdirectory=opentelemetry-sdk \

0 commit comments

Comments
 (0)