Skip to content

Commit

Permalink
fix: tilt deps
Browse files Browse the repository at this point in the history
  • Loading branch information
dolcalmi committed Dec 13, 2024
1 parent b7e5897 commit c5a6fd5
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/e2e-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ jobs:
echo $! > /tmp/pids/sim_record.pid
# Run the E2E tests
nix develop -c tilt ci ios-e2e-tests -f ./dev/Tiltfile
nix develop -c tilt -f ./dev/Tiltfile ci -- --test ios-e2e-tests
- name: Cleanup Processes
if: always()
Expand Down
74 changes: 51 additions & 23 deletions dev/Tiltfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
config.define_string_list("test")
cfg = config.parse()

local_resource(
name="init-onchain",
labels = ["dev-setup"],
Expand All @@ -9,18 +12,18 @@ local_resource(
)

local_resource(
name='init-lightning',
labels = ['dev-setup'],
cmd='vendor/galoy-quickstart/bin/init-lightning.sh',
name="init-lightning",
labels = ["dev-setup"],
cmd="vendor/galoy-quickstart/bin/init-lightning.sh",
resource_deps = [
"init-onchain",
"lnd1",
"lnd-outside-1",
]
)

docker_compose('vendor/galoy-quickstart/docker-compose.yml')
galoy_services = ["apollo-router", "galoy", "trigger", "redis", "mongodb", "mongodb-migrate", "price", "price-history", "price-history-migrate", "price-history-pg", "svix", "svix-pg", "stablesats", "notifications", "notifications-pg"]
docker_compose("vendor/galoy-quickstart/docker-compose.yml")
galoy_services = ["apollo-router", "redis", "mongodb", "mongodb-migrate", "price", "price-history", "price-history-migrate", "price-history-pg", "svix", "svix-pg", "stablesats", "notifications", "notifications-pg"]
auth_services = ["oathkeeper", "kratos", "kratos-pg", "hydra", "hydra-pg", "hydra-migrate"]
bitcoin_services = ["bitcoind", "bitcoind-signer", "lnd1", "lnd-outside-1", "bria", "bria-pg", "fulcrum"]

Expand All @@ -31,45 +34,70 @@ for service in auth_services:
for service in bitcoin_services:
dc_resource(service, labels = ["bitcoin"])

dc_resource('otel-agent', labels = ["otel"])
dc_resource('quickstart-test', labels = ['quickstart'], auto_init=False)
dc_resource("galoy", labels = ["galoy"], resource_deps = ["dev-ln-setup"])
dc_resource("trigger", labels = ["galoy"], resource_deps = ["galoy", "dev-ln-setup"])
dc_resource("otel-agent", labels = ["otel"])
dc_resource("quickstart-test", labels = ["quickstart"], auto_init=False)

local_resource(
name='dev-ln-setup',
labels = ['dev-setup'],
cmd='bin/dev-ln-setup.sh',
name="dev-ln-setup",
labels = ["dev-setup"],
cmd="bin/dev-ln-setup.sh",
resource_deps = galoy_services + [
"init-lightning"
]
)

local_resource(
name='dev-setup',
labels = ['dev-setup'],
cmd='bin/dev-setup.sh',
name="wait-for-galoy",
labels = ["dev-setup"],
cmd='''
GALOY_ENDPOINT=${GALOY_ENDPOINT:-localhost:4455}
max_attempts=30
attempt=1
while [ $attempt -le $max_attempts ]; do
if curl -f -X POST http://$GALOY_ENDPOINT/graphql \
-H 'Content-Type: application/json' \
-d '{"query":"query Globals { globals { network } }"}' 2>/dev/null; then
echo "GraphQL server is ready at $GALOY_ENDPOINT!"
exit 0
fi
echo "Attempt $attempt/$max_attempts: Waiting for GraphQL server at $GALOY_ENDPOINT..."
sleep 10
attempt=$((attempt + 1))
done
echo "GraphQL server failed to become ready at $GALOY_ENDPOINT"
exit 1
''',
resource_deps = ["galoy"]
)

local_resource(
name="dev-setup",
labels = ["dev-setup"],
cmd="bin/dev-setup.sh",
resource_deps = [
"galoy",
"dev-ln-setup"
"wait-for-galoy",
]
)

local_resource(
name='one-block-every-5s',
labels = ['dev-setup'],
serve_cmd='bin/one-block-every-5s.sh',
name="one-block-every-5s",
labels = ["dev-setup"],
serve_cmd="bin/one-block-every-5s.sh",
resource_deps = [
"dev-setup"
"dev-ln-setup"
]
)

# iOS E2E test
local_resource(
name='ios-e2e-tests',
auto_init = False,
name="ios-e2e-tests",
auto_init = "ios-e2e-tests" in cfg.get("test", []),
labels = ["test"],
cmd='''
cmd="""
# Run the tests
nix develop -c yarn e2e:test ios.sim.debug -d -R 5 --take-screenshots all --record-videos all --record-logs all --artifacts-location ./ios-recordings
''',
""",
resource_deps = ["dev-setup"]
)

0 comments on commit c5a6fd5

Please sign in to comment.