Skip to content

Commit 8fff1ed

Browse files
Tofelskudasov
andauthored
[DX-585] parrot custom startup time (#1795)
* allow parrot docker container to use custom startup time * add changesets * add goimports for lib, try fix --------- Co-authored-by: skudasov <[email protected]>
1 parent 89e6d79 commit 8fff1ed

File tree

5 files changed

+16
-8
lines changed

5 files changed

+16
-8
lines changed

justfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ test-all:
5050

5151
goimports-all:
5252
@just _default_goimports k8s-test-runner
53+
@just _default_goimports lib
5354
@just _default_goimports parrot
5455
@just _default_goimports tools/workflowresultparser
5556
@just _default_goimports tools/asciitable

lib/.changeset/v1.54.0.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Fix tc logger for v0.36.0

lib/.changeset/v1.54.1.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Make Parrot Docker container startup time configurable

lib/docker/test_env/parrot.go

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ import (
2121
)
2222

2323
const (
24-
defaultParrotImage = "kalverra/parrot"
25-
defaultParrotVersion = "v0.6.2"
26-
defaultParrotPort = "80"
24+
defaultParrotImage = "kalverra/parrot"
25+
defaultParrotVersion = "v0.6.2"
26+
defaultParrotPort = "80"
27+
defaultStartupTimeout = 10 * time.Second
2728
)
2829

2930
// Parrot is a test environment component that wraps a Parrot server.
@@ -54,16 +55,20 @@ type ParrotAdapterResult struct {
5455
func NewParrot(networks []string, opts ...EnvComponentOption) *Parrot {
5556
p := &Parrot{
5657
EnvComponent: EnvComponent{
57-
ContainerName: fmt.Sprintf("%s-%s", "parrot", uuid.NewString()[0:3]),
58-
Networks: networks,
59-
StartupTimeout: 10 * time.Second,
58+
ContainerName: fmt.Sprintf("%s-%s", "parrot", uuid.NewString()[0:3]),
59+
Networks: networks,
6060
},
6161
l: log.Logger,
6262
}
6363
p.SetDefaultHooks()
6464
for _, opt := range opts {
6565
opt(&p.EnvComponent)
6666
}
67+
68+
if p.StartupTimeout == 0 {
69+
p.StartupTimeout = defaultStartupTimeout
70+
}
71+
6772
return p
6873
}
6974

lib/grafana/client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ type GrafanaResponse struct {
119119
}
120120

121121
// PostDashboard sends a request to create or update a Grafana dashboard.
122-
// It returns the response containing the dashboard details, the HTTP response,
123-
// and any error encountered during the request. This function is useful for
122+
// It returns the response containing the dashboard details, the HTTP response,
123+
// and any error encountered during the request. This function is useful for
124124
// programmatically managing Grafana dashboards.
125125
func (c *Client) PostDashboard(dashboard PostDashboardRequest) (GrafanaResponse, *resty.Response, error) {
126126
var grafanaResp GrafanaResponse

0 commit comments

Comments
 (0)