Golang API test suite for Konveyor
This repository contains application-level tests for Konveyor. That means test focusing on integration of multiple components and real-world Koveyor use-cases. Basic components tests should be placed and executed in their own repositories.
Test are organized in packages/directories by the high-level Konveyor features.
Tests require running Konveyor/MTA installation (e.g. Minikube works great for test development purposes).
Contribution guidelines
Background for this test suite come from Hub API tests https://github.com/konveyor/tackle2-hub/pull/268.
There is a binding
package providing API client methods https://github.com/konveyor/tackle2-hub/tree/main/binding.
Feel free to follow application analysis integration test directory as an example.
Konveyor CI status
More details at https://github.com/konveyor/ci
Local test suite execution
Clone this repo
git clone https://github.com/aufi/go-konveyor-tests && cd go-konveyor-tests
Prepare environment
$ make setup # start minikube&tackle using David's scripts - local env only
OpenShift cluster
These tests can be executed against OpenShift cluster with Konveyor installed by setting KUBECONFIG
variable:
KUBECONFIG=<kubeconfig file>
NOTE: You might be required to download and import the certificate chain. Please see Hub API test README for more information.
Run test suite
Set $HUB_BASE_URL
environment variable to point to Konveyor installation before running tests. More options could be found in Hub API test README.
$ HUB_BASE_URL="http://<KONVEYOR_HOST>/hub" make test-tier0
Run test manually example:
$ export HUB_BASE_URL="http://`minikube ip`/hub"
$ go test -count=1 -v ./analysis/
Test tiers
To provide maximum information about the project functionality, tests were separated into three tiers. From core functionality to nice to haves.
Tier 0
Very basic and core functionality. A bug here would lead to mostly useless project. This tier should never fail. Examples: Hub API or a basic application analysis flow.
$ make test-tier0
Tier 1
Features of the project expected to work to satifly most of end-users expectations. Examples: real-world use cases of application analysis, Jira integrations or metrics.
$ make test-tier1
Tier 2
More advanced features like complex application analysis or some edge cases. This tier should be kept green, but a failure should not affect most of users.
$ make test-tier2
Tier 3
Tests involving credentials or private resources which are supplied as part of the test configuration. It should be excluded from PR runs and will be run through Jenkins.
$ make test-tier3
Test execution options
DEBUG
For debug output like printing full analysis results, set export DEBUG=1
.
KEEP
For keep data created by test e.g. for debugging purposes, set export KEEP=1
.
PARALLEL
For parallel test execution, set export PARALLEL=1
.
Configuration
NOTE: Before running tests, ensure that the required configuration variables are set as environment variables
You can edit the configuration file go-konveyor-tests.config and run:
source go-konveyor-tests.config
Test-Specific Configuration
Refer to the README.md
files in each folder for test-specific configuration details.
Code of Conduct
Refer to Konveyor's Code of Conduct here.