Skip to content

Commit bc36c0e

Browse files
committed
working on test and action
1 parent bdbce75 commit bc36c0e

File tree

3 files changed

+16
-13
lines changed

3 files changed

+16
-13
lines changed

.github/workflows/testing.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
build:
99
env:
1010
USING_COVERAGE: "3.12"
11-
DATABASE_URL: "postgresql://postgres:postgres@postgresdbTest:5432/postgres"
11+
DATABASE_URL: "postgresql://postgres:postgres@localhost:5432/postgres"
1212
runs-on: ubuntu-latest
1313
services:
1414
postgresdbTest:
@@ -20,7 +20,6 @@ jobs:
2020
ports:
2121
- 5432:5432
2222
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
23-
2423
strategy:
2524
max-parallel: 10
2625
matrix:

coverage.xml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" ?>
2-
<coverage version="7.4.4" timestamp="1713058409019" lines-valid="629" lines-covered="187" line-rate="0.2973" branches-covered="0" branches-valid="0" branch-rate="0" complexity="0">
2+
<coverage version="7.4.4" timestamp="1713061892639" lines-valid="629" lines-covered="187" line-rate="0.2973" branches-covered="0" branches-valid="0" branch-rate="0" complexity="0">
33
<!-- Generated by coverage.py: https://coverage.readthedocs.io/en/7.4.4 -->
44
<!-- Based on https://raw.githubusercontent.com/cobertura/web/master/htdocs/xml/coverage-04.dtd -->
55
<sources>
@@ -77,14 +77,14 @@
7777
<line number="416" hits="1"/>
7878
<line number="426" hits="1"/>
7979
<line number="435" hits="1"/>
80-
<line number="443" hits="1"/>
81-
<line number="474" hits="1"/>
82-
<line number="484" hits="1"/>
83-
<line number="493" hits="1"/>
84-
<line number="501" hits="1"/>
85-
<line number="532" hits="1"/>
86-
<line number="542" hits="1"/>
87-
<line number="551" hits="1"/>
80+
<line number="444" hits="1"/>
81+
<line number="475" hits="1"/>
82+
<line number="485" hits="1"/>
83+
<line number="494" hits="1"/>
84+
<line number="503" hits="1"/>
85+
<line number="534" hits="1"/>
86+
<line number="544" hits="1"/>
87+
<line number="553" hits="1"/>
8888
</lines>
8989
</class>
9090
<class name="database_config.py" filename="dsg_lib/async_database_functions/database_config.py" complexity="0" line-rate="0.72" branch-rate="0">

tests/test_database_functions/test_base_schema.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,18 @@
1111
SchemaBaseSQLite,
1212
)
1313

14+
import os
15+
16+
# Get the database URL from the environment variable
17+
database_url = os.getenv('DATABASE_URL', 'postgresql://postgres:postgres@postgresdbTest:5432/postgres')
18+
1419
Base = declarative_base()
1520

1621
# Define a dictionary with the connection strings for each database
1722
# Replace the placeholders with your actual connection details
1823
DATABASES = {
1924
"sqlite": "sqlite:///:memory:",
20-
"postgres": "postgresql://postgres:postgres@postgresdbTest:5432/postgres",
21-
# postgresql+asyncpg://postgres:postgres@postgresdb:5432/devsetgo
25+
"postgres": database_url,
2226
}
2327

2428
# Define a dictionary with the schema base classes for each database

0 commit comments

Comments
 (0)