Playwright: Gate server start up with GRAFANA_URL env var (#108302)
* refactor so server is created unless GRAFANA_URL is provided * update documentation * don't swallow errors from the server process
This commit is contained in:
@@ -32,12 +32,17 @@ func RunTest(
|
||||
) (*dagger.Container, error) {
|
||||
playwrightCommand := buildPlaywrightCommand(opts)
|
||||
|
||||
grafanaHost, err := opts.GrafanaService.Hostname(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
e2eContainer := opts.FrontendContainer.
|
||||
WithWorkdir("/src").
|
||||
WithDirectory("/src", opts.HostSrc).
|
||||
WithMountedCache(".nx", d.CacheVolume("nx-cache")).
|
||||
WithEnvVariable("HOST", grafanaHost).
|
||||
WithEnvVariable("PORT", fmt.Sprint(grafanaPort)).
|
||||
WithEnvVariable("CI", "true").
|
||||
WithEnvVariable("GRAFANA_URL", fmt.Sprintf("http://%s:%d", grafanaHost, grafanaPort)).
|
||||
WithServiceBinding(grafanaHost, opts.GrafanaService).
|
||||
WithEnvVariable("bustcache", "1").
|
||||
WithEnvVariable("PLAYWRIGHT_HTML_OPEN", "never").
|
||||
|
||||
@@ -12,7 +12,6 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
grafanaHost = "grafana"
|
||||
grafanaPort = 3001
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user