Stack Testing
Stack testing is based on ginkgo framework. Each test is an e2e test that verifies the given stack is running correctly.
Each stack has a test/
folder that contains the testing code to verify the current stack.
You can take a look at sample stack to see the code in details.
Install ginkgoβ
Install ginkgo:
go install -mod=mod github.com/onsi/ginkgo/v2/ginkgo
go get github.com/onsi/gomega/...
This fetches Ginkgo and installs the ginkgo executable under $GOBIN
- you'll want that on your $PATH
. It also fetches the core Gomega matcher library and its set of supporting libraries.
Install hlnβ
Install hln by following the previous instructions.
Setup repoβ
In this example, we will use the stacks repo:
git clone https://github.com/h8r-dev/stacks.git
export STACK_REPO=$PWD/stacks
Set up the environment variablesβ
Before testing the stack, you need to specify the inputs for the stack. For example, if you are tesing sample stack, you should set the following environment variables:
export KUBECONFIG=~/.kube/config
export APP_NAME=test-app
export ORGANIZATION=<your-github-org>
export GITHUB_TOKEN=<your-github-token>
Runβ
First create an appl from the stack:
cd $STACK_REPO/official-stack/sample
hln up my-app
Then run the e2e tests:
cd test/ # Go to the test directory
ginkgo
Clean up your app
cd .. # Go to the gin-vue stack directory
hln down my-app