-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Remove deprecated version field * Add pg_dump wrapper for db tests
- Loading branch information
1 parent
9141b52
commit ed1f945
Showing
2 changed files
with
23 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# This script acts as a docker replacement around pg_dump so that developers can | ||
# run DB involved tests locally without having postgres installed. | ||
# | ||
# Installation: | ||
# - Make sure that your PATH doesn't already contain a postgres installation | ||
# - Add this script to your PATH | ||
# | ||
# Usage: | ||
# You should be able to setup your test db via: | ||
# - go build -o chainlink.test . # Build the chainlink binary to run test db prep commands from | ||
# - export CL_DATABASE_URL="postgresql://postgres:postgres@localhost:5432/chainlink_test?sslmode=disable" | ||
# - pushd .github/actions/setup-postgres/ # Navigate to the setup-postgres action so we can spin up a docker postgres | ||
# instance | ||
# - docker compose up # Spin up postgres | ||
# - ./chainlink.test local db preparetest # Run the db migration, which will shell out to our pg_dump wrapper too. | ||
# - popd | ||
# - go test -timeout 30s ./core/services/workflows/... -v # Run tests that use the database | ||
|
||
cd "$(dirname "$0")" || exit | ||
|
||
docker compose exec -T postgres pg_dump "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
name: gha_postgres | ||
version: "3.8" | ||
services: | ||
postgres: | ||
ports: | ||
|