Skip to content

libgit2: Enable tests #744

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions pkg/git/libgit2/managed_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,11 @@ import (

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

func TestMain(m *testing.M) {
managed.InitManagedTransport(logr.Discard())
}

// Test_ManagedSSH_KeyTypes assures support for the different
// types of keys for SSH Authentication supported by Flux.
func Test_ManagedSSH_KeyTypes(t *testing.T) {
managed.InitManagedTransport(logr.Discard())

tests := []struct {
name string
keyType ssh.KeyPairType
Expand Down Expand Up @@ -176,6 +174,8 @@ func Test_ManagedSSH_KeyTypes(t *testing.T) {
// Test_ManagedSSH_KeyExchangeAlgos assures support for the different
// types of SSH key exchange algorithms supported by Flux.
func Test_ManagedSSH_KeyExchangeAlgos(t *testing.T) {
managed.InitManagedTransport(logr.Discard())

tests := []struct {
name string
ClientKex []string
Expand Down Expand Up @@ -297,6 +297,8 @@ func Test_ManagedSSH_KeyExchangeAlgos(t *testing.T) {
// Test_ManagedSSH_HostKeyAlgos assures support for the different
// types of SSH Host Key algorithms supported by Flux.
func Test_ManagedSSH_HostKeyAlgos(t *testing.T) {
managed.InitManagedTransport(logr.Discard())

tests := []struct {
name string
keyType ssh.KeyPairType
Expand Down Expand Up @@ -457,6 +459,7 @@ func Test_ManagedSSH_HostKeyAlgos(t *testing.T) {
}

func Test_ManagedHTTPCheckout(t *testing.T) {
managed.InitManagedTransport(logr.Discard())
g := NewWithT(t)

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

func TestManagedCheckoutBranch_Checkout(t *testing.T) {
managed.InitManagedTransport(logr.Discard())
g := NewWithT(t)

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

func TestManagedCheckoutTag_Checkout(t *testing.T) {
managed.InitManagedTransport(logr.Discard())
g := NewWithT(t)

timeout := 5 * time.Second
Expand Down