Skip to content

Commit

Permalink
Remove -tags headless build (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
feedmeapples committed Dec 1, 2022
1 parent b642a45 commit af30771
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 107 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 ./...
17 changes: 0 additions & 17 deletions app/mtls_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 {
Expand All @@ -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
}
19 changes: 0 additions & 19 deletions cmd/temporal/ui_disabled_test.go

This file was deleted.

25 changes: 0 additions & 25 deletions cmd/temporal/ui_test.go

This file was deleted.

6 changes: 0 additions & 6 deletions server/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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,
Expand Down
33 changes: 0 additions & 33 deletions server/ui_disabled.go

This file was deleted.

2 changes: 0 additions & 2 deletions server/ui_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down

0 comments on commit af30771

Please sign in to comment.