Odo: Tests for devfiles in odo devfile registry

Created on 18 Jun 2020  ยท  15Comments  ยท  Source: openshift/odo

We should have tests for each devfile in https://github.com/odo-devfiles/registry that will verify that they are valid and usable.

There should a common test flow that will be executed using each devfile in the registry.

  • odo create <devfile>
  • odo url create
  • odo push
  • verify that application is accessible in a given url
  • odo push --debug
  • odo debug port-forward
  • verify that it is possible to make a connection to debugger
  • odo delete

The tests should be executed on https://github.com/odo-devfiles/registry repository for every PR

We can start by running this on Travis

/area registry
/kind test
/priority medium

areregistry aretesting point5 prioritHigh

All 15 comments

@kadel: The label(s) area/ cannot be applied, because the repository doesn't have them

In response to this:

We should have tests for each devfile in https://github.com/odo-devfiles/registry that will verify that they are valid and usable.

There should a common test flow that will be executed using each devfile in the registry.

  • odo create <devfile>
  • odo url create
  • odo push
  • verify that application is accessible in a given url
  • odo push --debug
  • odo debug port-forward
  • verify that it is possible to make a connection to debugger
  • odo delete

/area registry
/kind test
/priority medium

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

/remove-priority medium
/priority high

@amitkrout please observe that the tests are to be added in the odo-devfiles/registry

@kadel @girishramnani i started few scripting steps, then thought let me check how you see the requirement and the solution.

  1. We are planning to run each devfile registry test in our each odo pr run, for example when odo pr triggers we need to clone/download https://github.com/odo-devfiles/registry and verifies it through our test script with the flow mentioned in the description.

OR

  1. Something like to another CI setup like we did for https://github.com/openshift/odo-init-image.

NOTE: If we are following the type 1 then we can not guaranty that https://github.com/odo-devfiles/registry master is not broken. In type two we can atleast make sure that odo-devfiles/registry master is not broken.

Can you please confirm ?

This should be another CI setup independent from openshift/odo. Those tests should run for PRs in odo-devfiles/registry

The tests should use latest released odo binary.

This should be another CI setup independent from openshift/odo. Those tests should run for PRs in odo-devfiles/registry

The tests should use latest released odo binary.

@kadel For CI job configuration i need admin access to this repo https://github.com/odo-devfiles/registry. Can you please provide me the required access

@kadel For CI job configuration i need admin access to this repo https://github.com/odo-devfiles/registry. Can you please provide me the required access

done

Hit the issue https://github.com/openshift/odo/issues/3476 while i was applying the test flow through the script.

Hit another issue while accessing the route - https://github.com/openshift/odo/issues/3477

Focus on Travis for now and get tests working on it. Focus on Prow later.

After discussion with @amitkrout Here is what I propose:

Every devfile directory will contain a file test.sh as entry point to testing containing the odo commands to run as part of testing and a directory example, containing an example app to be used for testing in the test.sh script for eg

โฏ tree
.
โ””โ”€โ”€ devfiles
    โ”œโ”€โ”€ devfile1
    โ”‚ย ย  โ”œโ”€โ”€ devfile.yaml
    โ”‚ย ย  โ”œโ”€โ”€ example
    โ”‚ย ย  โ””โ”€โ”€ test.sh
    โ””โ”€โ”€ devfile2
        โ”œโ”€โ”€ devfile.yaml
        โ”œโ”€โ”€ example
        โ””โ”€โ”€ test.sh

In travis script, we will

  1. Setup openshift cluster
  2. Fetch latest odo binary from https://mirror.openshift.com/pub/openshift-v4/clients/odo/latest/ and put it into PATH
  3. for each devfile directory, pushd into it, run test.sh if it exists or fail, popd out of it

Note: to list the directories in a directory shell script, you can either

โฏ cd /path/to/devfiles
โฏ ls -d *
devfile1  devfile2

or

โฏ pwd
some/random/location
โฏ find /path/to/devfiles -maxdepth 1 -mindepth 1 -type d -printf '%f\n'
devfile2
devfile1

cc @kadel

@mohammedzee1000 Actually i was doing over engineering. This looks cool to me ๐Ÿ‘

As per the last discussion with @kadel, steps to be followed

Validation steps remaining

odo push --debug
odo debug port-forward
verify that it is possible to make a connection to debugger

Ping @anandrkskd

  • Test need to be run for specific devfile ie. java-maven, java-quarkus, nodejs.
  • To check if the connection to debugger is possible or not can be done by replicating the integration test for devfile_debug_test in bash script.
Was this page helpful?
0 / 5 - 0 ratings

Related issues

amitkrout picture amitkrout  ยท  3Comments

maysunfaisal picture maysunfaisal  ยท  8Comments

jbpratt picture jbpratt  ยท  5Comments

surajnarwade picture surajnarwade  ยท  5Comments

kadel picture kadel  ยท  5Comments