Path: blob/main/test/tests/ide/jetbrains/base_in_workspace_test.go
2500 views
// Copyright (c) 2024 Gitpod GmbH. All rights reserved.1// Licensed under the GNU Affero General Public License (AGPL).2// See License.AGPL.txt in the project root for license information.34package ide56import (7"context"8"fmt"9"io"10"os"11"os/exec"12"testing"13)1415type testLogWriter struct {16t *testing.T17}1819var _ io.Writer = &testLogWriter{}2021func (t *testLogWriter) Write(p []byte) (n int, err error) {22t.t.Log(string(p))23return len(p), nil24}2526const localDebug = false2728func testWithoutGithubAction(ctx context.Context, gatewayLink, gitpodAccessToken, secretEndpoint string, useLatest bool) {29scriptName := "dev/jetbrains-test:test-stable"30if useLatest {31scriptName = "dev/jetbrains-test:test-latest"32}3334if localDebug {35fmt.Printf("Exec command below to run UI tests:\n\nexport DISPLAY=:0\nexport GATEWAY_LINK=\"%s\"\nexport GITPOD_TEST_ACCESSTOKEN=\"%s\"\nexport WS_ENDPOINT=%s\nleeway run %s -Dversion=integration-test -DpublishToJBMarketplace=false", gatewayLink, gitpodAccessToken, secretEndpoint, scriptName)36os.Exit(1)37}38cmdEnv := os.Environ()39cmdEnv = append(cmdEnv, "GATEWAY_LINK="+gatewayLink)40cmdEnv = append(cmdEnv, "GITPOD_TEST_ACCESSTOKEN="+gitpodAccessToken)41cmdEnv = append(cmdEnv, "WS_ENDPOINT="+secretEndpoint)42cmd := exec.CommandContext(ctx, "leeway", "run", scriptName, "-Dversion=integration-test", "-DpublishToJBMarketplace=false")43cmd.Env = cmdEnv44// writer := &testLogWriter{t: t}45cmd.Stdout = os.Stdout46cmd.Stderr = os.Stdout47cmd.Run()48}495051