[infra] Remove mock testing.t

It's a lot of extra overhead for effectively being used in one test.

Change-Id: Ia2486f0c3f6a5993c133827e6f85d3aec647015f
Reviewed-on: https://skia-review.googlesource.com/c/buildbot/+/372498
Reviewed-by: Eric Boren <borenet@google.com>
diff --git a/go/deepequal/assertdeep/assertdeep.go b/go/deepequal/assertdeep/assertdeep.go
index bd5f965..84b1250 100644
--- a/go/deepequal/assertdeep/assertdeep.go
+++ b/go/deepequal/assertdeep/assertdeep.go
@@ -1,8 +1,6 @@
 package assertdeep
 
 import (
-	"bytes"
-	"encoding/json"
 	"fmt"
 	"reflect"
 
@@ -122,16 +120,3 @@
 		}
 	}
 }
-
-// JSONRoundTripEqual encodes and decodes an object to/from JSON and asserts
-// that the result is deep equal to the original. obj must be a pointer.
-func JSONRoundTripEqual(t sktest.TestingT, obj interface{}) {
-	val := reflect.ValueOf(obj)
-	require.Equal(t, reflect.Ptr, val.Kind(), "JSONRoundTripEqual must be passed a pointer.")
-	cpyval := reflect.New(val.Elem().Type())
-	cpy := cpyval.Interface()
-	buf := bytes.Buffer{}
-	require.NoError(t, json.NewEncoder(&buf).Encode(obj))
-	require.NoError(t, json.NewDecoder(&buf).Decode(cpy))
-	Equal(t, obj, cpy)
-}
diff --git a/go/deepequal/assertdeep/assertdeep_test.go b/go/deepequal/assertdeep/assertdeep_test.go
deleted file mode 100644
index f8a6558..0000000
--- a/go/deepequal/assertdeep/assertdeep_test.go
+++ /dev/null
@@ -1,43 +0,0 @@
-package assertdeep
-
-import (
-	"testing"
-
-	"go.skia.org/infra/go/sktest"
-	"go.skia.org/infra/go/testutils"
-	"go.skia.org/infra/go/testutils/unittest"
-)
-
-func TestAssertJSONRoundTrip(t *testing.T) {
-	unittest.SmallTest(t)
-
-	type Success struct {
-		Public int `json:"public"`
-	}
-	JSONRoundTripEqual(t, &Success{
-		Public: 123,
-	})
-
-	type Unencodable struct {
-		Unsupported map[Success]struct{} `json:"unsupported"`
-	}
-	testutils.AssertFails(t, `unsupported type: map\[\w+\.Success]struct`, func(t sktest.TestingT) {
-		JSONRoundTripEqual(t, &Unencodable{
-			Unsupported: map[Success]struct{}{
-				{
-					Public: 5,
-				}: {},
-			},
-		})
-	})
-
-	type CantRoundTrip struct {
-		// go vet complains if we add a json struct field tag to a private field.
-		private int
-	}
-	testutils.AssertFails(t, "Objects do not match", func(t sktest.TestingT) {
-		JSONRoundTripEqual(t, &CantRoundTrip{
-			private: 123,
-		})
-	})
-}
diff --git a/go/testutils/testutils.go b/go/testutils/testutils.go
index 564b1fe..4042f59 100644
--- a/go/testutils/testutils.go
+++ b/go/testutils/testutils.go
@@ -12,7 +12,6 @@
 	"os"
 	"path/filepath"
 	"runtime"
-	"sync"
 	"text/template"
 	"time"
 
@@ -164,88 +163,6 @@
 	return fmt.Errorf("Failed to pass test in allotted time.")
 }
 
-// MockTestingT implements sktest.TestingT by saving calls to Log and Fail. MockTestingT can
-// be used to test a test helper function. See also AssertFails.
-// The methods Helper, Name, Skip, SkipNow, Skipf, and Skipped are unimplemented.
-// This type is not safe for concurrent use.
-type MockTestingT struct {
-	LogMsgs  []string
-	IsFailed bool
-}
-
-func (m *MockTestingT) Cleanup(fn func()) {
-	panic("Cleanup is not implemented.")
-}
-func (m *MockTestingT) Error(args ...interface{}) {
-	m.Log(args...)
-	m.Fail()
-}
-func (m *MockTestingT) Errorf(format string, args ...interface{}) {
-	m.Logf(format, args...)
-	m.Fail()
-}
-func (m *MockTestingT) Fail() {
-	m.IsFailed = true
-}
-func (m *MockTestingT) FailNow() {
-	m.Fail()
-	runtime.Goexit()
-}
-func (m *MockTestingT) Failed() bool {
-	return m.IsFailed
-}
-func (m *MockTestingT) Fatal(args ...interface{}) {
-	m.Log(args...)
-	m.FailNow()
-}
-func (m *MockTestingT) Fatalf(format string, args ...interface{}) {
-	m.Logf(format, args...)
-	m.FailNow()
-}
-func (m *MockTestingT) Helper() {}
-func (m *MockTestingT) Log(args ...interface{}) {
-	m.LogMsgs = append(m.LogMsgs, fmt.Sprintln(args...))
-}
-func (m *MockTestingT) Logf(format string, args ...interface{}) {
-	m.LogMsgs = append(m.LogMsgs, fmt.Sprintf(format, args...))
-}
-func (m *MockTestingT) Name() string {
-	return ""
-}
-func (m *MockTestingT) Skip(args ...interface{}) {
-	m.Log(args...)
-	m.SkipNow()
-}
-func (m *MockTestingT) SkipNow() {
-	panic("SkipNow is not implemented.")
-}
-func (m *MockTestingT) Skipf(format string, args ...interface{}) {
-	m.Logf(format, args...)
-	m.SkipNow()
-}
-func (m *MockTestingT) Skipped() bool {
-	return false
-}
-
-// Assert that MockTestingT implements the sktest.TestingT interface:
-var _ sktest.TestingT = (*MockTestingT)(nil)
-
-// AssertFails runs testfn with a MockTestingT and asserts that the test fails and the first failure
-// logged matches the regexp. The sktest.TestingT passed to testfn is not safe for concurrent use.
-func AssertFails(parent sktest.TestingT, regexp string, testfn func(sktest.TestingT)) {
-	mock := MockTestingT{}
-	wg := sync.WaitGroup{}
-	wg.Add(1)
-	go func() {
-		defer wg.Done()
-		testfn(&mock)
-	}()
-	wg.Wait()
-	require.True(parent, mock.Failed(), "In AssertFails, the test function did not fail.")
-	require.True(parent, len(mock.LogMsgs) > 0, "In AssertFails, the test function did not produce any failure messages.")
-	require.Regexp(parent, regexp, mock.LogMsgs[0])
-}
-
 // AnyContext can be used to match any Context objects e.g.
 // m.On("Foo", testutils.AnyContext).Return(...)
 // This is better than trying to used mock.AnythingOfTypeArgument
diff --git a/go/testutils/testutils_test.go b/go/testutils/testutils_test.go
index efceb84..3dd04e2 100644
--- a/go/testutils/testutils_test.go
+++ b/go/testutils/testutils_test.go
@@ -3,8 +3,9 @@
 import (
 	"testing"
 
-	"github.com/stretchr/testify/assert"
 	"go.skia.org/infra/go/sktest"
+
+	"github.com/stretchr/testify/assert"
 	"go.skia.org/infra/go/testutils/unittest"
 )
 
@@ -16,27 +17,3 @@
 	var _ sktest.TestingT = (*testing.T)(nil)
 	var _ sktest.TestingT = (*testing.B)(nil)
 }
-
-func TestAssertFails(t *testing.T) {
-	unittest.SmallTest(t)
-
-	AssertFails(t, `Not equal:\s+expected: 123\s+actual\s+: 124`, func(inner sktest.TestingT) {
-		assert.Equal(inner, 123, 124)
-	})
-	// "We must go deeper."
-	AssertFails(t, `In AssertFails, the test function did not fail\.`, func(inner1 sktest.TestingT) {
-		AssertFails(inner1, "blah", func(inner2 sktest.TestingT) {
-			assert.Equal(inner2, 123, 123)
-		})
-	})
-	AssertFails(t, `In AssertFails, the test function did not produce any failure messages\.`, func(inner1 sktest.TestingT) {
-		AssertFails(inner1, "blah", func(inner2 sktest.TestingT) {
-			inner2.Fail()
-		})
-	})
-	AssertFails(t, `Expect "misunderestimate" to match "blah"`, func(inner1 sktest.TestingT) {
-		AssertFails(inner1, "blah", func(inner2 sktest.TestingT) {
-			inner2.Fatalf("misunderestimate")
-		})
-	})
-}
diff --git a/task_scheduler/go/scheduling/task_candidate_test.go b/task_scheduler/go/scheduling/task_candidate_test.go
index d006142..5ea67cc 100644
--- a/task_scheduler/go/scheduling/task_candidate_test.go
+++ b/task_scheduler/go/scheduling/task_candidate_test.go
@@ -1,10 +1,13 @@
 package scheduling
 
 import (
+	"encoding/json"
 	"fmt"
 	"testing"
 	"time"
 
+	"github.com/stretchr/testify/assert"
+
 	"github.com/stretchr/testify/require"
 	"go.skia.org/infra/go/deepequal/assertdeep"
 	"go.skia.org/infra/go/testutils/unittest"
@@ -50,10 +53,15 @@
 	assertdeep.Copy(t, v, cp)
 }
 
-func TestTaskCandidateJSON(t *testing.T) {
+func TestTaskCandidate_EncodedToAndFromJSON_BeforeEqualsAfter(t *testing.T) {
 	unittest.SmallTest(t)
 	v := fullTaskCandidate()
-	assertdeep.JSONRoundTripEqual(t, v)
+	jsonB, err := json.Marshal(v)
+	require.NoError(t, err)
+	var reEncoded taskCandidate
+	err = json.Unmarshal(jsonB, &reEncoded)
+	require.NoError(t, err)
+	assert.Equal(t, v, &reEncoded)
 }
 
 func TestTaskCandidateId(t *testing.T) {