E2E Tests With Kind¶
For Quick and Easy Local Development it is Recommended to use a Vanilla Harbor installation. The Local Test environment will be used the Helm Chart from goharbor/harbor-helm.
All relevant Makefile
goals are prefixed with e2s_*
.
Goal | Description |
---|---|
e2e_prepare |
Configure the Kind based Env, and install the latest version from the Harbor Chart. |
e2e_prepare_harbor_v1 |
Install a Harbor v1 to the Kind Cluster |
e2e_prepare_harbor_v2 |
Install a Harbor v2 to the Kind Cluster |
e2e_test_v1 |
Starting the go based tests again a Harbor V1 Deployment |
e2e_test_v2 |
Starting the go based tests again a Harbor V2 Deployment |
e2e_test_classic |
Test the Terraform Scripts from examples with terratest |
e2e_clean_harbor |
Delete the Harbor helm chart from kind cluster |
e2e_clean_cluster |
Remove the current kind cluster. |
The same flavore of tests will be integrated into the CI/CD Process.
Befor you execute e2e_prepare
ensure that the INGRESS_DOMAIN
to your local host (By default we use the Docker Bridge Network Interface like 172-17-0-1.sslip.io
.)
example without change any files
cd ./tools && go run mage.go -v kind:recreate
./scripts/tst-01-prepare-harbor.sh "10-42-0-100.sslip.io" "1.2.0"
As wildcard DNS we use a service like sslip.io.
The scripts will be starting the Kind Cluster with Ingress Support, as Ingress Controller we use Nginx .
The Kind installation is part of the used Visual Studio Code Devcontainer
Go Based Tests¶
For quick response and tests near the Code we use Terrafomr Go Acceptance Tests.
make e2e_test
Tests will be matchs by the file name prefix *_test.go
.
Terratest File Based Tests¶
The Classic Terraform File based tests are located at examples/**
, and executed with terratest. For execution you need, a full runnable Terraform Enviroment with the current version from the harbor terraform provider.
# compile the provider
make compile
# copy provider to local ~/.terraform.d/plugins/linux_amd64 folder
make install
# start the tests
make e2e_test_classic