Importable End-To-End Test Suite (#758)

* Rename VK to chewong for development purpose

* Rename basic_test.go to basic.go

* Add e2e.go and suite.go

* Disable tests in node.go

* End to end tests are now importable as a testing suite

* Remove 'test' from test files

* Add documentations

* Rename chewong back to virtual-kubelet

* Change 'Testing Suite' to 'Test Suite'

* Add the ability to skip certain testss

* Add unit tests for suite.go

* Add README.md for importable e2e test suite

* VK implementation has to be based on VK v1.0.0

* Stricter checks on validating test functions

* Move certain files back to internal folder

* Add WatchTimeout as a config field

* Add slight modifications
This commit is contained in:
Ernest Wong
2019-09-04 14:25:43 -07:00
committed by Pires
parent da57373abb
commit f10a16aed7
14 changed files with 585 additions and 107 deletions

View File

@@ -1,6 +1,8 @@
package framework
import (
"time"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd"
@@ -8,17 +10,19 @@ import (
// Framework encapsulates the configuration for the current run, and provides helper methods to be used during testing.
type Framework struct {
KubeClient kubernetes.Interface
Namespace string
NodeName string
KubeClient kubernetes.Interface
Namespace string
NodeName string
WatchTimeout time.Duration
}
// NewTestingFramework returns a new instance of the testing framework.
func NewTestingFramework(kubeconfig, namespace, nodeName string) *Framework {
func NewTestingFramework(kubeconfig, namespace, nodeName string, watchTimeout time.Duration) *Framework {
return &Framework{
KubeClient: createKubeClient(kubeconfig),
Namespace: namespace,
NodeName: nodeName,
KubeClient: createKubeClient(kubeconfig),
Namespace: namespace,
NodeName: nodeName,
WatchTimeout: watchTimeout,
}
}