This directory contains a command-line interface (CLI) to automate the setup, execution, and cleanup of performance tests within a Kubernetes cluster. This uses @kubernetes/client-node to manage Deployments, ConfigMaps, and TestRuns.
user-office-proposal-performance-tests/cluster is a Node.js based cli to manage test runs on cluster.
-
Node.js and npm installed: Ensure Node.js and npm are installed on your local machine.
-
kubectl configured:
kubectlmust be configured to connect to your Kubernetes cluster. This can be achieved by setting theKUBECONFIGenvironment variable. For example:export KUBECONFIG=~/kubeconfig.cluster
-
Cluster configured for K6 load testing: The Kubernetes cluster must be configured to support K6 load testing using the K6 Operator. This configuration is automated using
Jenkinsfile.setupcluster, which executes our Helm chart configurations.
-
Clone the Repository:
git clone https://github.com/UserOfficeProject/user-office-proposal-performance-tests cd user-office-proposal-performance-tests/cluster -
Install Dependencies:
npm install
-
Start the cluster test:
npm run cluster-cli:start
- Check for Running Tests: The CLI checks if tests are running in the specified namespace.
- Confirmation: If tests are running, it prompts the user to stop them.
- User Input: Prompts the user for test configuration parameters.
- Test Cleanup: Deletes any existing test resources.
- Test Setup: Creates ConfigMaps and deploys test setup resources.
- Test Execution: Creates K6 TestRun objects to run the tests.
- Test Monitoring: Monitors test pod status and waits for completion.
- Test Cleanup: Deletes all test resources.