Skip to content

Commit

Permalink
hacked code to reproduce env resolution failure in make testscript fo…
Browse files Browse the repository at this point in the history
…r the health dir
  • Loading branch information
krehermann committed Jan 10, 2024
1 parent 7fc45b6 commit 0a6af1a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ generate: abigen codecgen mockery ## Execute all go:generate commands.
.PHONY: testscripts
testscripts: chainlink-test ## Install and run testscript against testdata/scripts/* files.
go install github.com/rogpeppe/go-internal/cmd/testscript@latest
go run ./tools/txtar/cmd/lstxtardirs -recurse=true | PATH="$(CURDIR):${PATH}" xargs -I % \
go run ./tools/txtar/cmd/lstxtardirs -recurse=true -dir testdata/scripts/health | PATH="$(CURDIR):${PATH}" xargs -I % \
sh -c 'testscript -e COMMIT_SHA=$(COMMIT_SHA) -e HOME="$(TMPDIR)/home" -e VERSION=$(VERSION) $(TS_FLAGS) %/*.txtar'

.PHONY: testscripts-update
Expand Down
4 changes: 3 additions & 1 deletion testdata/scripts/health/default.txtar
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# start node
exec sh -c 'eval "echo \"$(cat config.toml.tmpl)\" > config.toml"'
exec chainlink node -c config.toml start -p password -a creds &
exec cat config.toml
exec chainlink node -c config.toml start -p password -a creds

# initialize client
env PORT=8118
env NODEURL=http://localhost:$PORT
exec curl --retry 10 --retry-max-time 60 --retry-connrefused $NODEURL
exec chainlink --remote-node-url $NODEURL admin login -file creds --bypass-version-check
Expand Down
15 changes: 6 additions & 9 deletions testdata/scripts/node/db/help.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,12 @@ USAGE:
chainlink node db command [command options] [arguments...]

COMMANDS:
reset Drop, create and migrate database. Useful for setting up the database in order to run tests or resetting the dev database. WARNING: This will ERASE ALL DATA for the specified database, referred to by CL_DATABASE_URL env variable or by the Database.URL field in a secrets TOML config.
preparetest Reset database and load fixtures.
version Display the current database version.
status Display the current database migration status.
migrate Migrate the database to the latest version.
rollback Roll back the database to a previous <version>. Rolls back a single migration if no version specified.
create-migration Create a new migration.
delete-chain Commands for cleaning up chain specific db tables. WARNING: This will ERASE ALL chain specific data referred to by --type and --id options for the specified database, referred to by CL_DATABASE_URL env variable or by the Database.URL field in a secrets TOML config.
version Display the current database version.
status Display the current database migration status.
migrate Migrate the database to the latest version.
rollback Roll back the database to a previous <version>. Rolls back a single migration if no version specified.
delete-chain Commands for cleaning up chain specific db tables. WARNING: This will ERASE ALL chain specific data referred to by --type and --id options for the specified database, referred to by CL_DATABASE_URL env variable or by the Database.URL field in a secrets TOML config.

OPTIONS:
--help, -h show help


0 comments on commit 0a6af1a

Please sign in to comment.