Skip to content

Commit

Permalink
use host after all, map service ports to host
Browse files Browse the repository at this point in the history
  • Loading branch information
xoudini committed Oct 21, 2024
1 parent ec40ec1 commit 74615ce
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ jobs:
image: postgres:${{ matrix.postgres-version }}
env:
POSTGRES_PASSWORD: "1234"
ports:
- "5432:5432"
options: >-
--health-cmd pg_isready
--health-interval 10s
Expand All @@ -52,5 +54,4 @@ jobs:
- name: Run tests
run: hatch test --python ${{ matrix.python-version }} --cover --randomize --parallel --retries 2 --retry-delay 1
env:
POSTGRES_HOSTADDR: "postgres"
POSTGRES_DB: "postgres"
8 changes: 4 additions & 4 deletions tests/db/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ def namespace() -> str:


@pytest.fixture(scope="session")
def hostaddr() -> str:
return os.getenv("POSTGRES_HOSTADDR", "127.0.0.1")
def host() -> str:
return os.getenv("POSTGRES_HOST", "127.0.0.1")


@pytest.fixture(scope="session")
Expand All @@ -35,13 +35,13 @@ def password() -> str:

@pytest.fixture(scope="session")
def conninfo(
hostaddr: str,
host: str,
dbname: str,
username: str,
password: str,
) -> str:
return config.ConnectionInfo(
hostaddr=hostaddr,
host=host,
dbname=dbname,
username=username,
password=password,
Expand Down

0 comments on commit 74615ce

Please sign in to comment.