Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests for devfiles in odo devfile registry #3378

Closed
kadel opened this issue Jun 18, 2020 · 15 comments · Fixed by odo-devfiles/registry#47
Closed

Tests for devfiles in odo devfile registry #3378

kadel opened this issue Jun 18, 2020 · 15 comments · Fixed by odo-devfiles/registry#47
Assignees
Labels
area/registry Issues or PRs related to Devfile registries area/testing Issues or PRs related to testing, Quality Assurance or Quality Engineering estimated-size/S (5-10) Rough sizing for Epics. Less then one sprint of work for one person priority/High Important issue; should be worked on before any other issues (except priority/Critical issue(s)).

Comments

@kadel
Copy link
Member

kadel commented Jun 18, 2020

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

@openshift-ci-robot openshift-ci-robot added area/registry Issues or PRs related to Devfile registries kind/test priority/Medium Nice to have issue. Getting it done before priority changes would be great. labels Jun 18, 2020
@openshift-ci-robot
Copy link
Collaborator

@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.

@kadel
Copy link
Member Author

kadel commented Jul 1, 2020

/remove-priority medium
/priority high

@girishramnani
Copy link
Contributor

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

@amitkrout
Copy link
Contributor

@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 ?

@kadel
Copy link
Member Author

kadel commented Jul 1, 2020

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.

@amitkrout
Copy link
Contributor

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
Copy link
Member Author

kadel commented Jul 1, 2020

@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

@amitkrout
Copy link
Contributor

Hit the issue #3476 while i was applying the test flow through the script.

@amitkrout
Copy link
Contributor

Hit another issue while accessing the route - #3477

@kadel kadel added area/testing Issues or PRs related to testing, Quality Assurance or Quality Engineering and removed kind/test labels Jul 10, 2020
@amitkrout amitkrout added priority/High Important issue; should be worked on before any other issues (except priority/Critical issue(s)). and removed priority/Medium Nice to have issue. Getting it done before priority changes would be great. labels Jul 13, 2020
@dharmit
Copy link
Member

dharmit commented Jul 15, 2020

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

@dharmit dharmit added the estimated-size/S (5-10) Rough sizing for Epics. Less then one sprint of work for one person label Jul 15, 2020
@mohammedzee1000
Copy link
Contributor

mohammedzee1000 commented Jul 29, 2020

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

@amitkrout
Copy link
Contributor

@mohammedzee1000 Actually i was doing over engineering. This looks cool to me 👍

@amitkrout
Copy link
Contributor

amitkrout commented Aug 4, 2020

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

@amitkrout amitkrout assigned anandrkskd and unassigned amitkrout Aug 20, 2020
@amitkrout
Copy link
Contributor

Validation steps remaining

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

Ping @anandrkskd

@anandrkskd
Copy link
Contributor

  • 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/registry Issues or PRs related to Devfile registries area/testing Issues or PRs related to testing, Quality Assurance or Quality Engineering estimated-size/S (5-10) Rough sizing for Epics. Less then one sprint of work for one person priority/High Important issue; should be worked on before any other issues (except priority/Critical issue(s)).
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants