README
¶
E2E tests
The directory contains E2E tests and test applications. Tests assume that Argo CD services are installed into argocd-e2e
namespace or cluster in current context. One throw-away
namespace argocd-e2e***
is created prior to tests execute. The throw-away namespace is used as a target namespace for test applications.
The test/e2e/testdata
directory contains various Argo CD applications. Before test execution directory is copies into /tmp/argocd-e2e***
temp directory and used in tests as a
git repository via file url: file:///tmp/argocd-e2e***
.
Use the following steps to run tests locally:
- (Do it once) Create namespace
argocd-e2e
and apply base manifests:kubectl create ns -n argocd-e2e && kustomize build test/manifests/base | kubectl apply -n argocd-e2e -f -
- Change kubectl context namespace to
argocd-e2e
and start services usinggoreman start
- Keep Argo CD services running and run tests using
make test-e2e
The tests are executed by Argo Workflow defined at .argo-ci/ci.yaml
. CI job The build argo cd image, deploy argo cd components into throw-away kubernetes cluster provisioned
using k3s and run e2e tests against it.
Documentation
¶
Index ¶
- Constants
- Variables
- func DemoDeployment() *appsv1.Deployment
- func GetFreePort() (int, error)
- func NewDeployment() *unstructured.Unstructured
- func NewFakeConfigMap() *apiv1.ConfigMap
- func NewFakeProjLister(objects ...runtime.Object) applister.AppProjectNamespaceLister
- func NewFakeSecret(policy ...string) *apiv1.Secret
- func NewPod() *unstructured.Unstructured
- func NewService() *unstructured.Unstructured
- func StartInformer(informer cache.SharedIndexInformer) context.CancelFunc
- func WaitForPortListen(addr string, timeout time.Duration) error
Constants ¶
const ( FakeArgoCDNamespace = "fake-argocd-ns" FakeDestNamespace = "fake-dest-ns" FakeClusterURL = "https://fake-cluster:443" )
Variables ¶
var DeploymentManifest = []byte(`
{
"apiVersion": "apps/v1",
"kind": "Deployment",
"metadata": {
"name": "nginx-deployment",
"labels": {
"app": "nginx"
}
},
"spec": {
"replicas": 3,
"selector": {
"matchLabels": {
"app": "nginx"
}
},
"template": {
"metadata": {
"labels": {
"app": "nginx"
}
},
"spec": {
"containers": [
{
"name": "nginx",
"image": "nginx:1.15.4",
"ports": [
{
"containerPort": 80
}
]
}
]
}
}
}
}
`)
var PodManifest = []byte(`
{
"apiVersion": "v1",
"kind": "Pod",
"metadata": {
"name": "my-pod"
},
"spec": {
"containers": [
{
"image": "nginx:1.7.9",
"name": "nginx",
"resources": {
"requests": {
"cpu": 0.2
}
}
}
]
}
}
`)
var ServiceManifest = []byte(`
{
"apiVersion": "v1",
"kind": "Service",
"metadata": {
"name": "my-service"
},
"spec": {
"ports": [
{
"name": "http",
"protocol": "TCP",
"port": 80,
"targetPort": 8080
}
],
"selector": {
"app": "my-service"
}
}
}
`)
Functions ¶
func DemoDeployment ¶
func DemoDeployment() *appsv1.Deployment
func GetFreePort ¶ added in v0.11.0
GetFreePort finds an available free port on the OS
func NewDeployment ¶ added in v0.11.0
func NewDeployment() *unstructured.Unstructured
func NewFakeConfigMap ¶ added in v0.11.1
func NewFakeProjLister ¶ added in v0.11.1
func NewFakeProjLister(objects ...runtime.Object) applister.AppProjectNamespaceLister
func NewFakeSecret ¶ added in v0.11.1
func NewPod ¶ added in v0.11.0
func NewPod() *unstructured.Unstructured
func NewService ¶ added in v0.11.0
func NewService() *unstructured.Unstructured
func StartInformer ¶ added in v0.11.0
func StartInformer(informer cache.SharedIndexInformer) context.CancelFunc
StartInformer is a helper to start an informer, wait for its cache to sync and return a cancel func
Types ¶
This section is empty.