Rafter Integration Tests
Overview
The project is a test scenario for all Rafter subcomponents, such as controllers and the Upload Service.
Prerequisites
Use the following tools to set up the project:
Usage
Run a local version
To run integration tests, follow these instructions:
-
Install Kyma.
-
Build the test image directly on the Docker engine of the Minikube node without pushing it to a registry. Run:
eval $(minikube docker-env)
make build-image
Alternatively, build the image and push it to a registry, such as Docker Hub.
-
Edit the Test Definition CR and update its .spec.template.spec.containers[0].image
field to rafter-test:latest
using this command:
k edit testdefinitions.testing.kyma-project.io -n kyma-system rafter
-
Run the integration test. The command creates a test suite with a name in a form of test-{ID}
. Run:
kyma test run rafter
-
Get the test result using this command:
k logs -n kyma-system oct-tp-test-{ID}-rafter-0 tests
Build a production version
To build the production Docker image, run this command:
make build-image
Environment variables
Use the following environment variables to configure the application:
Name |
Required |
Default |
Description |
APP_KUBECONFIG_PATH |
No |
None |
The path to the kubeconfig file, needed for running an application outside of the cluster. If not supplied in-cluster config will be used |
APP_TEST_WAIT_TIMEOUT |
No |
3m |
The period of time for which the application waits for the resources to meet defined conditions |
APP_TEST_NAMESPACE |
No |
rafter-test |
The name of the Namespace created and deleted during integration tests |
APP_TEST_CLUSTER_BUCKET_NAME |
No |
test-cluster-bucket |
The Cluster Bucket resource name |
APP_TEST_BUCKET_NAME |
No |
test-bucket |
The Bucket resource name |
APP_TEST_ASSET_GROUP_NAME |
No |
test-asset-group |
The Asset Group resource name |
APP_TEST_CLUSTER_ASSET_GROUP_NAME |
No |
test-cluster-asset-group |
The Cluster Asset Group resource name |
APP_TEST_COMMON_ASSET_PREFIX |
No |
test |
The name of the prefix for the Asset and Cluster Asset resources |
APP_TEST_MOCKICE_NAME |
No |
rafter-test-svc |
The name of the pod, service, and configmap used by the test service |
Development
Install dependencies
This project uses dep
as a dependency manager. To install all required dependencies, use the following command:
dep ensure -vendor-only
Verify the code
To check if the code is correct and you can push it, run the before-commit.sh
script. It builds the application, runs tests, and checks the status of the vendored libraries. It also runs the static code analysis and ensures that the formatting of the code is correct.