Skip to content
This repository has been archived by the owner on May 9, 2023. It is now read-only.

Commit

Permalink
Merge pull request #201 from triggermesh/tests-fix
Browse files Browse the repository at this point in the history
Failing tests fixed
  • Loading branch information
tzununbekov authored Sep 10, 2020
2 parents 94c8a99 + 766a88c commit 7eeccd9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
2 changes: 0 additions & 2 deletions pkg/resources/service/pingsource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ func TestPingSource(t *testing.T) {
assert.Len(t, psList.Items, 1)
ps := psList.Items[0]

assert.True(t, ps.Status.IsReady())

assert.Equal(t, ps.Spec.Sink.Ref.Name, tc.service.Name)
assert.Equal(t, ps.Spec.Sink.Ref.Namespace, tc.service.Namespace)

Expand Down
15 changes: 13 additions & 2 deletions pkg/resources/service/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package service
import (
"fmt"
"net"
"net/url"
"os"
"strings"
"testing"
Expand Down Expand Up @@ -94,8 +95,18 @@ func TestDeployAndDelete(t *testing.T) {
return
}

address := strings.TrimPrefix(output, fmt.Sprintf("Service %s URL: https://", tc.service.Name))
conn, err := net.DialTimeout("tcp", address+":443", dialTimeout)
address := strings.TrimPrefix(output, fmt.Sprintf("Service %s URL: ", tc.service.Name))
addr, err := url.Parse(address)
assert.NoError(t, err)
switch addr.Scheme {
case "https":
address = addr.Host + ":443"
case "http":
address = addr.Host + ":80"
default:
t.Error("malformed service URL scheme", addr.Scheme)
}
conn, err := net.DialTimeout("tcp", address, dialTimeout)
assert.NoError(t, err)
assert.NoError(t, conn.Close())

Expand Down

0 comments on commit 7eeccd9

Please sign in to comment.