Skip to content

Commit a94ada7

Browse files
committed
fix test
1 parent 86045e7 commit a94ada7

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

core/scripts/cre/environment/environment/state_resolver_test.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package environment
22

33
import (
4+
"os"
45
"testing"
56

67
"github.com/Masterminds/semver/v3"
@@ -131,8 +132,13 @@ func TestResolveContractAddressAndVersion(t *testing.T) {
131132
func TestToDockerHostRPC(t *testing.T) {
132133
t.Parallel()
133134

134-
require.Equal(t, "http://host.docker.internal:8545", toDockerHostRPC("http://localhost:8545"))
135-
require.Equal(t, "http://host.docker.internal:8545", toDockerHostRPC("http://127.0.0.1:8545"))
135+
expected := "http://host.docker.internal:8545"
136+
if os.Getenv("CI") == "true" {
137+
expected = "http://172.17.0.1:8545"
138+
}
139+
140+
require.Equal(t, expected, toDockerHostRPC("http://localhost:8545"))
141+
require.Equal(t, expected, toDockerHostRPC("http://127.0.0.1:8545"))
136142
}
137143

138144
func newCobraCommand() *cobra.Command {

0 commit comments

Comments
 (0)