Skip to content

Commit

Permalink
fix docker tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sduchesneau committed Dec 6, 2024
1 parent c4d42f6 commit 7250d47
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
14 changes: 1 addition & 13 deletions tests/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,7 @@
#!/usr/bin/env bash
set -euxo pipefail

listen_address=
if [[ ${TEST_STAGING:-false} == "true" ]]; then
listen_address="https://codegen-staging.substreams.dev"
else
if [[ -z ${CI} ]]; then
listen_address="http://host.docker.internal:9000"
else
# Codegen address when running test
listen_address="http://172.17.0.1:9000"
fi
fi

SUBSTREAMS_CODEGEN_ENDPOINT=$listen_address substreams init --state-file /app/generator.json --force-download-cwd
substreams init --state-file /app/generator.json --force-download-cwd

substreams build

Expand Down
6 changes: 5 additions & 1 deletion tests/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,11 @@ func TestIntegration(t *testing.T) {
validateBinary(t, "cargo")
validateBinary(t, "buf")

parallel := true
hasSSCache := hasBinary("sscache")
if !hasSSCache {
zlog.Info("sscache not found, tests will not run in parallel (run `cargo install sscache` to enable parallelism)")
parallel = false
} else {
os.Setenv("RUSTC_WRAPPER", "sccache")
os.Setenv("SSCACHE_DIR", filepath.Join(os.TempDir(), "sscachedir"))
Expand All @@ -122,7 +124,9 @@ func TestIntegration(t *testing.T) {
for _, c := range cases {
c := c
t.Run(c.name, func(t *testing.T) {
t.Parallel()
if parallel {
t.Parallel()
}
runTestLocally(t, c.stateFile)
})
}
Expand Down

0 comments on commit 7250d47

Please sign in to comment.