Skip to content

Commit 9d6eada

Browse files
authored
Merge pull request #744 from fluxcd/libgit2-enable-tests
libgit2: Enable tests
2 parents 36bbaf0 + 8661066 commit 9d6eada

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

pkg/git/libgit2/managed_test.go

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,11 @@ import (
4242

4343
const testRepositoryPath = "../testdata/git/repo"
4444

45-
func TestMain(m *testing.M) {
46-
managed.InitManagedTransport(logr.Discard())
47-
}
48-
4945
// Test_ManagedSSH_KeyTypes assures support for the different
5046
// types of keys for SSH Authentication supported by Flux.
5147
func Test_ManagedSSH_KeyTypes(t *testing.T) {
48+
managed.InitManagedTransport(logr.Discard())
49+
5250
tests := []struct {
5351
name string
5452
keyType ssh.KeyPairType
@@ -176,6 +174,8 @@ func Test_ManagedSSH_KeyTypes(t *testing.T) {
176174
// Test_ManagedSSH_KeyExchangeAlgos assures support for the different
177175
// types of SSH key exchange algorithms supported by Flux.
178176
func Test_ManagedSSH_KeyExchangeAlgos(t *testing.T) {
177+
managed.InitManagedTransport(logr.Discard())
178+
179179
tests := []struct {
180180
name string
181181
ClientKex []string
@@ -297,6 +297,8 @@ func Test_ManagedSSH_KeyExchangeAlgos(t *testing.T) {
297297
// Test_ManagedSSH_HostKeyAlgos assures support for the different
298298
// types of SSH Host Key algorithms supported by Flux.
299299
func Test_ManagedSSH_HostKeyAlgos(t *testing.T) {
300+
managed.InitManagedTransport(logr.Discard())
301+
300302
tests := []struct {
301303
name string
302304
keyType ssh.KeyPairType
@@ -457,6 +459,7 @@ func Test_ManagedSSH_HostKeyAlgos(t *testing.T) {
457459
}
458460

459461
func Test_ManagedHTTPCheckout(t *testing.T) {
462+
managed.InitManagedTransport(logr.Discard())
460463
g := NewWithT(t)
461464

462465
timeout := 5 * time.Second
@@ -496,6 +499,7 @@ func Test_ManagedHTTPCheckout(t *testing.T) {
496499
}
497500

498501
func TestManagedCheckoutBranch_Checkout(t *testing.T) {
502+
managed.InitManagedTransport(logr.Discard())
499503
g := NewWithT(t)
500504

501505
timeout := 5 * time.Second
@@ -551,6 +555,7 @@ func TestManagedCheckoutBranch_Checkout(t *testing.T) {
551555
}
552556

553557
func TestManagedCheckoutTag_Checkout(t *testing.T) {
558+
managed.InitManagedTransport(logr.Discard())
554559
g := NewWithT(t)
555560

556561
timeout := 5 * time.Second

0 commit comments

Comments
 (0)