This repository contains files related to integration tests for devfile.
NOTE:
All related issues are being tracked under the main devfile API repo https://github.com/devfile/api with the label area/integration-tests
- Github actions workflows is configured to run nightly integration tests and also when a PR is opened against 'main' branch.
- Additional integration tests are configured with OpenShift CI system to run ODO and ODC tests with devfile.
OCP version | Prow Test Status |
---|---|
4.15 | devfile-integration-tests-main-v4.15.odo |
4.12 | devfile-integration-tests-main-v4.12.odo |
4.11 | devfile-integration-tests-main-v4.11.odo |
OCP version | Prow Test Status |
---|---|
4.15 | devfile-integration-tests-main-v4.15.console |
4.12 | devfile-integration-tests-main-v4.12.console |
4.11 | devfile-integration-tests-main-v4.11.console |
NOTE: This section covers the required test environment for macOS specifically, however the similar steps can be used for other OSes.
NOTE: This test is based on devfile library tests
- clone the repository
- cd integration-tests
- Run
Make test
- The test creates the following files:
./tmp/test.log
contains log output from the tests../tmp/library_test/Test_*.yaml
and./tmp/integration_test/Test_*.yaml
are the devfiles that are randomly generated at runtime. The file name matches the name of the test function which resulted in them being created.- If a test detects an error when comparing properties returned by the parser with expected properties
./tmp/library_test/Test_*_<property id>_Parser.yaml
- property as returned by the parser./tmp/library_test/Test_*_<property id>_Test.yaml
- property as expected by the test
NOTE: each run of the test removes the existing contents of the ./tmp
directory
- Python 3.9.10
- pipenv : run
pip install --user pipenv
- Minikube or OpenShift
- odo
- clone the repository
- cd integration-tests
- run
pipenv install --dev
- Start Minikube or OpenShift (e.g. crc)
- run
pipenv run pytest tests/odo -v
to test all, orpipenv run pytest tests/odo/<target test>.py -v
to test target test cases. - [Optional] In order run integration tests with the latest Odo build
- Build and install by following the instruction on 'odo.dev'
- run
pipenv run pytest tests/odo_300 -v
to test all, orpipenv run pytest tests/odo_300/<target test>.py -v
to test target test cases.
- Go 1.21 and Ginkgo latest version
- git
- OpenShift Cluster. e.g. crc environment for 4.* local cluster
- [Optional] xunit-viewer
and jrm : required to get performance test results in a merged html format in addition to
junit*.xml
.
- cd
local/odo
- run
./odo-integration-tests.sh
: it runsodo catalog command
test by default. In order to run other test cases, modify./odo-integration-tests.sh
by enabling other test options. e.g.make test-cmd-devfile-create
-
Open
Makefile
and remove--skipMeasurements
option fromGINKGO_FLAGS_ALL
flag. -
Add Ginkgo's Measure block for the spec that you want to measure the performance. A sample
Measure
block can be found fromhttps://github.com/devfile/integration-tests/tree/main/local/odo/tests/integration/devfile/cmd_devfile_catalog_test.go
-
[Optional] In order to get test results in html format, uncomment
jrm...
andxunit-viewer...
command calls fromodo-integration-tests.sh
. -
run
./odo-integration-tests.sh
A sample performance test output in console.
A sample test output in html format
Tests in this repository are based on ODC integration tests.
- node.js >= 14 & yarn >= 1.20
- go >= 1.21+
- oc or kubectl and an OpenShift or Kubernetes cluster. In this document, CRC is used.
- jq (for
contrib/environment.sh
) - Google Chrome/Chromium or Firefox for integration tests
- Cypress - integration tests are implemented in Cypress.io.
-
install CRC
-
run
crc setup
-
run
crc start
and record credentials forkubeadmin
. You may obtain the credentials by runningcrc console --credentials
-
run
crc oc-env
to configure your shell -
git clone OpenShift console repository
-
build
console
. Login askubeadmin
and start a local console.cd console ./build.sh # Backend binaries are output to `./bin` oc login -u kubeadmin -p <kubeadmin_password> source ./contrib/oc-environment.sh ./bin/bridge
The console will be running at http://localhost:9000
-
Update
console/frontend/packages/dev-console/integration-tests/features/addFlow/create-from-devfile.feature
by adding TAG (@smoke) for scenarios to run tests. -
Launch Cypress test runner
cd console/frontend yarn run test-cypress-dev-console
For more detail, see https://github.com/openshift/console#integration-tests.