Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
chray-zhang committed Nov 13, 2024
1 parent 46ac876 commit 4c36f44
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
20 changes: 9 additions & 11 deletions integration-tests/docker/testenv/gauntlet/gauntletplusplus.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package testenv

import (
"fmt"
"testing"
Expand All @@ -13,28 +14,27 @@ import (
"github.com/smartcontractkit/chainlink-testing-framework/lib/docker/test_env"
"github.com/smartcontractkit/chainlink-testing-framework/lib/logging"
"github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext"

)

const (
GauntletPlusPlusPort = "7530"
GauntletPlusPlusInternalPort = "4444"
)

type GauntletPlusPlus struct {
test_env.EnvComponent
ExternalHTTPURL string
InternalHTTPURL string
t *testing.T
l zerolog.Logger
Image string
t *testing.T
l zerolog.Logger
Image string
}

func NewGauntletPlusPlus(networks []string, image string, opts ...test_env.EnvComponentOption) *GauntletPlusPlus {
ms := &GauntletPlusPlus{
Image: image,
EnvComponent: test_env.EnvComponent{
ContainerName: "gauntlet-plus-plus",
Networks: networks,
Networks: networks,
},

l: log.Logger,
Expand All @@ -61,12 +61,10 @@ func (g *GauntletPlusPlus) StartContainer() error {
L: g.l,
}
}
l.Printf("Testing reached")
cReq, err := g.getContainerRequest()
if err != nil {
return err
}
l.Printf("Testing reached 2")
c, err := tc.GenericContainer(testcontext.Get(g.t), tc.GenericContainerRequest{
ContainerRequest: *cReq,
Reuse: true,
Expand All @@ -76,20 +74,20 @@ func (g *GauntletPlusPlus) StartContainer() error {
if err != nil {
return fmt.Errorf("cannot start GauntletPlusPlus container: %w", err)
}
l.Printf("Testing reached 3")

g.Container = c
host, err := test_env.GetHost(testcontext.Get(g.t), c)
if err != nil {
return err
}

httpPort, err := c.MappedPort(testcontext.Get(g.t), test_env.NatPort(GauntletPlusPlusPort))
if err != nil {
return err
}

g.ExternalHTTPURL = fmt.Sprintf("http://%s:%s", host, httpPort.Port())
g.InternalHTTPURL = fmt.Sprintf("http://%s:%s", g.ContainerName, GauntletPlusPlusInternalPort)
g.InternalHTTPURL = fmt.Sprintf("http://%s:%s", g.ContainerName, GauntletPlusPlusPort)

g.l.Info().
Any("ExternalHTTPURL", g.ExternalHTTPURL).
Expand All @@ -104,7 +102,7 @@ func (g *GauntletPlusPlus) getContainerRequest() (*tc.ContainerRequest, error) {
return &tc.ContainerRequest{
Name: g.ContainerName,
Image: g.Image,
ExposedPorts: []string{test_env.NatPortFormat(GauntletPlusPlusInternalPort)},
ExposedPorts: []string{test_env.NatPortFormat(GauntletPlusPlusPort)},
Networks: g.Networks,
WaitingFor: tcwait.ForLog("Server listening at ").
WithStartupTimeout(30 * time.Second).
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/testconfig/testconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ type Common struct {
InternalDockerRepo *string `toml:"internal_docker_repo"`
DevnetImage *string `toml:"devnet_image"`
PostgresVersion *string `toml:"postgres_version"`
GauntletPPImage *string `toml:"gauntlet_plus_plus_image"`
GauntletPPImage *string `toml:"gauntlet_plus_plus_image"`
}

func (c *Common) Validate() error {
Expand Down

0 comments on commit 4c36f44

Please sign in to comment.