dont display t.Log/t.Logf as errors in github actions (#1508)
* fix tests and github action annotations Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
@@ -11,6 +11,10 @@ import (
|
||||
)
|
||||
|
||||
func TestCloudflare(t *testing.T) {
|
||||
if len(os.Getenv("IN_TRAVIS_CI")) != 0 {
|
||||
t.Skip()
|
||||
}
|
||||
|
||||
apiToken, accountID := os.Getenv("CF_API_TOKEN"), os.Getenv("CF_ACCOUNT_ID")
|
||||
kvID := os.Getenv("KV_NAMESPACE_ID")
|
||||
if len(apiToken) == 0 || len(accountID) == 0 || len(kvID) == 0 {
|
||||
@@ -31,7 +35,9 @@ func TestCloudflare(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatalf("List: %s\n", err.Error())
|
||||
} else {
|
||||
t.Log("Listed " + strconv.Itoa(len(records)) + " records")
|
||||
if len(os.Getenv("IN_TRAVIS_CI")) == 0 {
|
||||
t.Log("Listed " + strconv.Itoa(len(records)) + " records")
|
||||
}
|
||||
}
|
||||
|
||||
err = wkv.Write(&store.Record{
|
||||
|
@@ -3,6 +3,7 @@ package cockroach
|
||||
import (
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"os"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
@@ -11,6 +12,10 @@ import (
|
||||
)
|
||||
|
||||
func TestSQL(t *testing.T) {
|
||||
if len(os.Getenv("IN_TRAVIS_CI")) != 0 {
|
||||
t.Skip()
|
||||
}
|
||||
|
||||
connection := fmt.Sprintf(
|
||||
"host=%s port=%d user=%s sslmode=disable dbname=%s",
|
||||
"localhost",
|
||||
@@ -23,7 +28,7 @@ func TestSQL(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := db.Ping(); err != nil {
|
||||
t.Skip(err)
|
||||
t.Fatal(err)
|
||||
}
|
||||
db.Close()
|
||||
|
||||
|
@@ -53,8 +53,9 @@ func TestFileStoreDatabaseTable(t *testing.T) {
|
||||
}
|
||||
|
||||
func fileTest(s store.Store, t *testing.T) {
|
||||
t.Logf("Options %s %v\n", s.String(), s.Options())
|
||||
|
||||
if len(os.Getenv("IN_TRAVIS_CI")) == 0 {
|
||||
t.Logf("Options %s %v\n", s.String(), s.Options())
|
||||
}
|
||||
// Read and Write an expiring Record
|
||||
if err := s.Write(&store.Record{
|
||||
Key: "Hello",
|
||||
@@ -109,7 +110,7 @@ func fileTest(s store.Store, t *testing.T) {
|
||||
} else {
|
||||
if len(results) != 2 {
|
||||
t.Errorf("Expected 2 items, got %d", len(results))
|
||||
t.Logf("Table test: %v\n", spew.Sdump(results))
|
||||
//t.Logf("Table test: %v\n", spew.Sdump(results))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,7 +121,7 @@ func fileTest(s store.Store, t *testing.T) {
|
||||
t.Errorf("Couldn't read all \"foo\" keys, got %# v (%s)", spew.Sdump(results), err)
|
||||
} else if len(results) != 1 {
|
||||
t.Errorf("Expected 1 item, got %d", len(results))
|
||||
t.Logf("Table test: %v\n", spew.Sdump(results))
|
||||
//t.Logf("Table test: %v\n", spew.Sdump(results))
|
||||
}
|
||||
|
||||
if err := s.Delete("foo"); err != nil {
|
||||
@@ -163,7 +164,7 @@ func fileTest(s store.Store, t *testing.T) {
|
||||
} else {
|
||||
if len(results) != 3 {
|
||||
t.Errorf("Expected 3 items, got %d", len(results))
|
||||
t.Logf("Table test: %v\n", spew.Sdump(results))
|
||||
//t.Logf("Table test: %v\n", spew.Sdump(results))
|
||||
}
|
||||
|
||||
}
|
||||
@@ -173,7 +174,7 @@ func fileTest(s store.Store, t *testing.T) {
|
||||
} else {
|
||||
if len(results) != 2 {
|
||||
t.Errorf("Expected 2 items, got %d", len(results))
|
||||
t.Logf("Table test: %v\n", spew.Sdump(results))
|
||||
//t.Logf("Table test: %v\n", spew.Sdump(results))
|
||||
}
|
||||
|
||||
}
|
||||
@@ -183,7 +184,7 @@ func fileTest(s store.Store, t *testing.T) {
|
||||
} else {
|
||||
if len(results) != 1 {
|
||||
t.Errorf("Expected 1 item, got %d", len(results))
|
||||
t.Logf("Table test: %# v\n", spew.Sdump(results))
|
||||
// t.Logf("Table test: %# v\n", spew.Sdump(results))
|
||||
}
|
||||
}
|
||||
if err := s.Delete("foo"); err != nil {
|
||||
|
@@ -2,6 +2,7 @@ package memory
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
@@ -42,7 +43,9 @@ func TestMemoryNamespacePrefix(t *testing.T) {
|
||||
}
|
||||
|
||||
func basictest(s store.Store, t *testing.T) {
|
||||
t.Logf("Testing store %s, with options %# v\n", s.String(), pretty.Formatter(s.Options()))
|
||||
if len(os.Getenv("IN_TRAVIS_CI")) == 0 {
|
||||
t.Logf("Testing store %s, with options %# v\n", s.String(), pretty.Formatter(s.Options()))
|
||||
}
|
||||
// Read and Write an expiring Record
|
||||
if err := s.Write(&store.Record{
|
||||
Key: "Hello",
|
||||
@@ -97,7 +100,9 @@ func basictest(s store.Store, t *testing.T) {
|
||||
if len(results) != 3 {
|
||||
t.Errorf("Expected 3 items, got %d", len(results))
|
||||
}
|
||||
t.Logf("Prefix test: %v\n", pretty.Formatter(results))
|
||||
if len(os.Getenv("IN_TRAVIS_CI")) == 0 {
|
||||
t.Logf("Prefix test: %v\n", pretty.Formatter(results))
|
||||
}
|
||||
}
|
||||
time.Sleep(time.Millisecond * 100)
|
||||
if results, err := s.Read("foo", store.ReadPrefix()); err != nil {
|
||||
@@ -106,7 +111,9 @@ func basictest(s store.Store, t *testing.T) {
|
||||
if len(results) != 2 {
|
||||
t.Errorf("Expected 2 items, got %d", len(results))
|
||||
}
|
||||
t.Logf("Prefix test: %v\n", pretty.Formatter(results))
|
||||
if len(os.Getenv("IN_TRAVIS_CI")) == 0 {
|
||||
t.Logf("Prefix test: %v\n", pretty.Formatter(results))
|
||||
}
|
||||
}
|
||||
time.Sleep(time.Millisecond * 100)
|
||||
if results, err := s.Read("foo", store.ReadPrefix()); err != nil {
|
||||
@@ -115,7 +122,9 @@ func basictest(s store.Store, t *testing.T) {
|
||||
if len(results) != 1 {
|
||||
t.Errorf("Expected 1 item, got %d", len(results))
|
||||
}
|
||||
t.Logf("Prefix test: %# v\n", pretty.Formatter(results))
|
||||
if len(os.Getenv("IN_TRAVIS_CI")) == 0 {
|
||||
t.Logf("Prefix test: %# v\n", pretty.Formatter(results))
|
||||
}
|
||||
}
|
||||
if err := s.Delete("foo", func(d *store.DeleteOptions) {}); err != nil {
|
||||
t.Errorf("Delete failed (%v)", err)
|
||||
@@ -156,7 +165,9 @@ func basictest(s store.Store, t *testing.T) {
|
||||
if len(results) != 3 {
|
||||
t.Errorf("Expected 3 items, got %d", len(results))
|
||||
}
|
||||
t.Logf("Prefix test: %v\n", pretty.Formatter(results))
|
||||
if len(os.Getenv("IN_TRAVIS_CI")) == 0 {
|
||||
t.Logf("Prefix test: %v\n", pretty.Formatter(results))
|
||||
}
|
||||
}
|
||||
time.Sleep(time.Millisecond * 100)
|
||||
if results, err := s.Read("foo", store.ReadSuffix()); err != nil {
|
||||
@@ -165,7 +176,9 @@ func basictest(s store.Store, t *testing.T) {
|
||||
if len(results) != 2 {
|
||||
t.Errorf("Expected 2 items, got %d", len(results))
|
||||
}
|
||||
t.Logf("Prefix test: %v\n", pretty.Formatter(results))
|
||||
if len(os.Getenv("IN_TRAVIS_CI")) == 0 {
|
||||
t.Logf("Prefix test: %v\n", pretty.Formatter(results))
|
||||
}
|
||||
}
|
||||
time.Sleep(time.Millisecond * 100)
|
||||
if results, err := s.Read("foo", store.ReadSuffix()); err != nil {
|
||||
@@ -174,7 +187,9 @@ func basictest(s store.Store, t *testing.T) {
|
||||
if len(results) != 1 {
|
||||
t.Errorf("Expected 1 item, got %d", len(results))
|
||||
}
|
||||
t.Logf("Prefix test: %# v\n", pretty.Formatter(results))
|
||||
if len(os.Getenv("IN_TRAVIS_CI")) == 0 {
|
||||
t.Logf("Prefix test: %# v\n", pretty.Formatter(results))
|
||||
}
|
||||
}
|
||||
if err := s.Delete("foo"); err != nil {
|
||||
t.Errorf("Delete failed (%v)", err)
|
||||
|
Reference in New Issue
Block a user