Skip to content

Commit

Permalink
delay payment and set postgres only if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
callebtc committed Jul 8, 2024
1 parent 9643eb8 commit f6b7256
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 29 deletions.
34 changes: 20 additions & 14 deletions .github/workflows/regtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,27 @@ jobs:
regtest:
runs-on: ${{ inputs.os-version }}
timeout-minutes: 10
services:
postgres:
image: postgres:latest
env:
POSTGRES_USER: cashu
POSTGRES_PASSWORD: cashu
POSTGRES_DB: cashu
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
# services:
# postgres:
# image: postgres:latest
# env:
# POSTGRES_USER: cashu
# POSTGRES_PASSWORD: cashu
# POSTGRES_DB: cashu
# ports:
# - 5432:5432
# options: >-
# --health-cmd pg_isready
# --health-interval 10s
# --health-timeout 5s
# --health-retries 5
steps:
- name: Start PostgreSQL service
if: contains(inputs.mint-database, 'postgres')
run: |
docker run -d --name postgres -e POSTGRES_USER=cashu -e POSTGRES_PASSWORD=cashu -e POSTGRES_DB=cashu -p 5432:5432 postgres:latest
until docker exec postgres pg_isready; do sleep 1; done
- uses: actions/checkout@v3

- uses: ./.github/actions/prepare
Expand Down
33 changes: 19 additions & 14 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,26 @@ jobs:
poetry:
name: Run (db ${{ inputs.mint-database }}, deprecated api ${{ inputs.mint-only-deprecated }})
runs-on: ${{ inputs.os }}
services:
postgres:
image: postgres:latest
env:
POSTGRES_USER: cashu
POSTGRES_PASSWORD: cashu
POSTGRES_DB: cashu
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
# services:
# postgres:
# image: postgres:latest
# env:
# POSTGRES_USER: cashu
# POSTGRES_PASSWORD: cashu
# POSTGRES_DB: cashu
# ports:
# - 5432:5432
# options: >-
# --health-cmd pg_isready
# --health-interval 10s
# --health-timeout 5s
# --health-retries 5
steps:
- name: Start PostgreSQL service
if: contains(inputs.mint-database, 'postgres')
run: |
docker run -d --name postgres -e POSTGRES_USER=cashu -e POSTGRES_PASSWORD=cashu -e POSTGRES_DB=cashu -p 5432:5432 postgres:latest
until docker exec postgres pg_isready; do sleep 1; done
- name: Checkout repository and submodules
uses: actions/checkout@v2
- uses: ./.github/actions/prepare
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
settings.mint_backend_bolt11_sat = settings.mint_backend_bolt11_sat or "FakeWallet"
settings.fakewallet_brr = True
settings.fakewallet_delay_outgoing_payment = 0
settings.fakewallet_delay_incoming_payment = 0.5
settings.fakewallet_delay_incoming_payment = 1
settings.fakewallet_stochastic_invoice = False
assert (
settings.mint_test_database != settings.mint_database
Expand Down

0 comments on commit f6b7256

Please sign in to comment.