diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1b161918..9f9a59a7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,9 +12,6 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest, macos-latest, windows-latest] - flags: - - "" - - -tags headless runs-on: ${{ matrix.os }} steps: - name: Print build information @@ -30,5 +27,5 @@ jobs: - name: Test env: - CGO_ENABLED: ${{ matrix.cgo }} - run: go test -v ${{ matrix.flags }} ./... + CGO_ENABLED: 0 + run: go test -v ./... diff --git a/app/mtls_test.go b/app/mtls_test.go index 48a83c42..3faf7567 100644 --- a/app/mtls_test.go +++ b/app/mtls_test.go @@ -11,14 +11,12 @@ import ( "os" "path/filepath" "runtime" - "runtime/debug" "strconv" "testing" "text/template" "time" "github.com/temporalio/temporal-cli/app" - "github.com/temporalio/temporal-cli/server" sconfig "github.com/temporalio/temporal-cli/server/config" "github.com/urfave/cli/v2" "go.temporal.io/api/enums/v1" @@ -134,11 +132,6 @@ func TestMTLSConfig(t *testing.T) { t.Fatalf("Bad state: %v", resp.NamespaceInfo.State) } - if !isUIPresent() { - t.Log("headless build detected, not testing temporal-ui mTLS") - return - } - // Pretend to be a browser to invoke the UI API res, err := http.Get(fmt.Sprintf("http://localhost:%d/api/v1/namespaces?", webUIPort)) if err != nil { @@ -153,13 +146,3 @@ func TestMTLSConfig(t *testing.T) { t.Fatalf("Unexpected response %s, with body %s", res.Status, string(body)) } } - -func isUIPresent() bool { - info, _ := debug.ReadBuildInfo() - for _, dep := range info.Deps { - if dep.Path == server.UIServerModule { - return true - } - } - return false -} diff --git a/cmd/temporal/ui_disabled_test.go b/cmd/temporal/ui_disabled_test.go deleted file mode 100644 index bfda1b2c..00000000 --- a/cmd/temporal/ui_disabled_test.go +++ /dev/null @@ -1,19 +0,0 @@ -//go:build headless - -package main - -import ( - "runtime/debug" - "testing" -) - -// This test ensures that the ui-server module is not a dependency of Temporal CLI when built -// for headless mode. -func TestNoUIServerDependency(t *testing.T) { - info, _ := debug.ReadBuildInfo() - for _, dep := range info.Deps { - if dep.Path == server.UIServerModule { - t.Errorf("%s should not be a dependency when headless tag is enabled", server.UIServerModule) - } - } -} diff --git a/cmd/temporal/ui_test.go b/cmd/temporal/ui_test.go deleted file mode 100644 index d4546feb..00000000 --- a/cmd/temporal/ui_test.go +++ /dev/null @@ -1,25 +0,0 @@ -//go:build !headless - -package main - -import ( - "runtime/debug" - "testing" - - "github.com/temporalio/temporal-cli/server" -) - -// This test ensures that ui-server is a dependency of Temporal CLI built in non-headless mode. -func TestHasUIServerDependency(t *testing.T) { - info, _ := debug.ReadBuildInfo() - for _, dep := range info.Deps { - if dep.Path == server.UIServerModule { - return - } - } - t.Errorf("%s should be a dependency when headless tag is not enabled", server.UIServerModule) - // If the ui-server module name is ever changed, this test should fail and indicate that the - // module name should be updated for this and the equivalent test case in ui_disabled_test.go - // to continue working. - t.Logf("Temporal CLI's %s dependency is missing. Was this module renamed recently?", server.UIServerModule) -} diff --git a/server/ui.go b/server/ui.go index f0fea393..1a7f472f 100644 --- a/server/ui.go +++ b/server/ui.go @@ -24,8 +24,6 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -//go:build !headless - package server // This file should be the only one to import ui-server packages. @@ -39,10 +37,6 @@ import ( uiserveroptions "github.com/temporalio/ui-server/v2/server/server_options" ) -// Name of the ui-server module, used in tests to verify that it is included/excluded -// as a dependency when building with the `headless` tag enabled. -const UIServerModule = "github.com/temporalio/ui-server/v2" - func newUIOption(frontendAddr string, uiIP string, uiPort int, configDir string) (ServerOption, error) { cfg, err := NewUIConfig( frontendAddr, diff --git a/server/ui_disabled.go b/server/ui_disabled.go deleted file mode 100644 index bb9090a5..00000000 --- a/server/ui_disabled.go +++ /dev/null @@ -1,33 +0,0 @@ -// The MIT License -// -// Copyright (c) 2022 Temporal Technologies Inc. All rights reserved. -// -// Copyright (c) 2020 Uber Technologies, Inc. -// -// Copyright (c) 2021 Datadog, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -//go:build headless - -package server - -func newUIOption(frontendAddr string, uiIP string, uiPort int, configDir string) (ServerOption, error) { - return nil, nil -} diff --git a/server/ui_test.go b/server/ui_test.go index 75c8b534..5aacdee9 100644 --- a/server/ui_test.go +++ b/server/ui_test.go @@ -24,8 +24,6 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -//go:build !headless - package server import (