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

Commit

Permalink
experimenting with the kubernetes integration testing framework
Browse files Browse the repository at this point in the history
  • Loading branch information
wallrj committed May 17, 2018
1 parent 8fd85ce commit 7e8965b
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions pkg/config/config_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
package config_test

import (
"os"
"testing"
"time"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"sigs.k8s.io/testing_frameworks/integration"

"github.com/jetstack/navigator/internal/test/util/testfs"
"github.com/jetstack/navigator/pkg/config"
Expand All @@ -27,3 +30,24 @@ func TestRoundTrip(t *testing.T) {

assert.Equal(t, c1.AllSettings(), c2.AllSettings())
}

func TestIntegration(t *testing.T) {
cp := &integration.ControlPlane{
APIServer: &integration.APIServer{
Out: os.Stdout,
Err: os.Stderr,
},
}
err := cp.Start()
require.NoError(t, err)
defer cp.Stop()
t.Log(cp.APIURL())
kubeCtl := cp.KubeCtl()
stdout, stderr, err := kubeCtl.Run("get", "ns")
require.NoError(t, err)
// You can check on err, stdout & stderr and build up
// your tests
t.Log("out", stdout)
t.Log("err", stderr)
time.Sleep(time.Hour)
}

0 comments on commit 7e8965b

Please sign in to comment.