Commit Graph

208 Commits

Author SHA1 Message Date
Dharmit Shah
51544e2342 Adds ability to list Operators available in the cluster (#2593)
* Add dependency on operator-lifecycle-manager (release-4.1)

* Add Operator Hub client to kclient package

* Add function to list installed operators

To be more specific, it lists the `ClusterServiceVersions` in the
cluster. But a `ClusterServiceVersion` is available only when
Operator(s) is/are installed by the cluster admin.

* List the CSVs in the cluster using odo commands

* Add dependency on github.com/golang/groupcache

* Removes futile call to get services from catalog

We're already getting services from the catalog in `Complete` function
and storing it in `o.services`.

* List the Operators only if experimental mode is enabled

* Update CI cluster setup script to setup operators

* Add OperatorHub tests to test-cmd-service

* Integration tests for listing operators

* Remove specific CSV version to let it be automatically selected

* Add test suite for OperatorHub tests to run

* Separate PHONY for OperatorHub tests and run it on 4.x cluster

* Use a CRD's kind instead of DisplayName to make service creation simpler in future

* Set environment variable for experimental mode

* Modify cluster setup to install operators on 4.1

* Execute different steps to setup OperatorHub if running on OCP 4.1

* Fix operator setup script for OCP 4.x

* Changes as per the PR review

https://github.com/openshift/odo/pull/2593#pullrequestreview-363449893

* Added klog dependency through `glide update -v`

* Changes as per the PR review

https://github.com/openshift/odo/pull/2593#pullrequestreview-372480988
https://github.com/openshift/odo/pull/2593#pullrequestreview-372484636
2020-03-11 05:06:15 -04:00
Tomas Kral
bf899459ce run validate with unit tests on OpenShift CI (#2649)
* run validate with unit tests on OpenShift CI

* goget-tools before validate

* tests on prow: add GOPATH/bin to PATH

* make golangci-lint part of 'make validate' target

* fix golangci-lint download

* set GOLANGCI_LINT_CACHE on OpenShiftCI

* Update openshiftci-presubmit-unittests.sh
2020-03-10 18:50:04 +01:00
Mrinal Das
2a8a25629d Adds auto selection of port if the default port is occupied (#2648)
* Adds auto selection of port if the default port is occupied

* Fixed typo
2020-03-02 20:25:58 +01:00
Mrinal Das
265c965cf7 Exports ODO_LOG_LEVEL env variable in integration tests (#2595)
* Exports ODO_LOG_LEVEL env variable in integration tests

* Turns off ODO_LOG_LEVEL if a valid json flag is passed
2020-02-19 03:20:49 +01:00
Amit Rout
bba04d2aeb Use env variable for unit test verbose mode (#2572)
* Use env variable for unit test vervose mode

* Making env var more generic

* Fixing ginkgo env var aswell
2020-02-13 12:38:19 +01:00
Priti Kumari
379a82a470 E2E test for every supported images (#2402)
* E2E test for every supported images

* Rebase pr

* Added docker hub supported images

* Verify odo commands flow for supported images

* Fixing golint error

* check for registry.redhat.io

* checking particular test

* modified e2e test for supported images

* Waiting for https://github.com/openshift/release/pull/6341 odo-secret to be volume mounted

* Updating review comments

* Modified the file content according to review change request

* PR rebase
2020-02-12 12:21:29 +01:00
Amit Rout
96b2cb6881 Including testingutil package in test coverage report (#2552) 2020-01-31 10:08:56 -08:00
Tomas Kral
4fa3ec4c89 fix git commit in odo version (#2505)
path to GITCOMMIT variable in ldflags was incorrect
2020-01-17 23:51:23 +01:00
Charlie Drage
29937f6931 Add check for "FIt" script (#2435)
**What kind of PR is this?**
<!--
DELETE the kind(s) which are not applicable before opening the PR.
-->

/kind enhancement

**What does does this PR do / why we need it**:

Adds a small script to check for instances of `FIt(` being in the code.
This helps with regards to not merging in tests with FIt in integration.

**Which issue(s) this PR fixes**:

N/A

**How to test changes / Special notes to the reviewer**:

N/A

Signed-off-by: Charlie Drage <charlie@charliedrage.com>
2019-12-10 13:12:45 +01:00
Mrinal Das
c281978f9c Adds golintCI to travis job (#2332)
* What kind of PR is this?

/kind cleanup

What does does this PR do / why we need it:

It adds golangci-lint as a travis job
It also adds the golangci-lint as make target.
It also fixes the current lint errors in our code base.

Which issue(s) this PR fixes:

Fixes #1927

How to test changes / Special notes to the reviewer:

run `golangci-lint run` and check that no errors occur

Signed-off-by: mik-dass <mrinald7@gmail.com>

* Fixes watch test by adding timeout
2019-11-07 18:24:54 +01:00
Priti Kumari
b14cd3a0e1 Separating out link tests from service catalog dependent tests (#2300)
* Separating out link tests from service catalog dependent tests

* Updated the change requested by @amitkrout

* Changed the naming format of the function setup and removeSetup requested by @amitkrout
2019-11-07 13:09:40 +01:00
Charlie Drage
76f5e178d3 Add managed-by labels (#2273)
This PR:
  - Moves versioning information to `pkg/version/version.go` so other
  parts of odo is able to use the versioning information (namely
  `pkg/component/labels/labels.go`.
  - Updates documentation on the versioning move
  - Adds `app.kubernetes.io/managed-by-version` label
  - Adds `app.kubernetes.io/managed-by` label

See example below of the changes:

```yaml
apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
metadata:
  annotations:
    app.kubernetes.io/component-source-type: local
    app.openshift.io/vcs-uri: file://./
  creationTimestamp: 2019-10-10T21:15:55Z
  generation: 2
  labels:
    app: app
    app.kubernetes.io/instance: foobar
    app.kubernetes.io/managed-by: odo
    app.kubernetes.io/managed-by-version: v1.0.0-beta6
    app.kubernetes.io/name: nodejs
    app.kubernetes.io/part-of: app
    app.openshift.io/runtime-version: latest
  name: foobar-app
  namespace: foo
  resourceVersion: "526665225"
  selfLink: /apis/apps.openshift.io/v1/namespaces/foo/deploymentconfigs/foobar-app
  uid: 25e6bf2c-eba3-11e9-98ab-123dee44c1c5
```

Closes https://github.com/openshift/odo/issues/2017
2019-11-07 10:13:43 +01:00
Amit Rout
db8d5c2bc1 Making debug command test target in sync (#2268) 2019-10-10 02:12:14 -07:00
Amit Rout
2bf3f386f7 Include service and link command tests (#2263) 2019-10-09 11:05:57 -07:00
Mrinal Das
f569be9f60 Fixes project wait flag (#2221)
* Fixes project wait flag

* Fix project create unit test in occlient
2019-10-04 11:56:09 -07:00
Amit Rout
ef844cbf00 Disable ginkgo verbose mode (#2145)
* Disable ginkgo verbose mode

* Sync Makefile

* Introduced env var GINKGO_VERBOSE_MODE

* Fix doc indentation

* Remove extra spacing in doc

* Updated .travis.yml

* making GINKGO_VERBOSE_MODE global var in travis.yml

* Fixing rebasing issue
2019-10-01 01:46:47 -07:00
Alan Conway
303ba8205f Fix slowSpecThreshold flag in Makefile (#2036)
The Makefile was passing slowSpecThreshold=$(SLOW_SPEC_THRESHOLD)
without a leading '-' so was ignoring SLOW_SPEC_THRESHOLD.

Fixed and put common flags in a single variable so they can be changed
in one place. Also you can now say `make VERBOSE=` to turn off -v
output from ginkgo.
2019-09-23 22:36:49 +02:00
Girish Ramnani
8b253d0c8a odo experimental debug port-forward command (#2043)
* add port-forward code from oc

* added command for debug and experimental

* integrating with odo - in progress

* add build portfoward request in occlient

* resolved all references

* extract the port forwarder into a different package

* some cleanup

* integrating the portforward command in odo cli

* removed i18n

* add debug port support in the config

* use the debug port in portforward cli

* resolved failing unit test

* added debug_port in the env var list

* remove the pod timeout option

* resolved long desc for port forward

* sending corrupt debug port

* better logging

* add tests for odo debug

* minor cleanup

* removed focus

* resolved failing tests

* added comments

* small error in tests

* removed experimental, changed the tests and add warning for tech preview

* added logging for debugging

* added more comments

* removed the port forward interface

* use init:0.12.0 bootstrap image

* made port forwarder more independent and added comment

* major refactor to resolve mrinal's comments

* moved logging

* doc typo

* doc typo
2019-09-20 18:51:50 +02:00
Mohammed Ahmed
567ad811de Setting up rpm spec for odo for rpm build (#2107)
* Setting up rpm spec for odo for rpm build

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Fixing typo

* Printing envs for debugging

* Removing -rpm suffix for rpm target

* Update rpm prepare script to store version information alongside rpmbuild artifacts

* Adding script to create tarball of the source. To be run after rpm-prepare is done

* Fixing dist git tarball generator

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Removing script from commit as its not yet perfect

* Updating redistributable to use name-redistributable

* Removing version replacement in version.go

* Some minor fixes to spec and script

* Record the need to update version in rpm-prepare script into release process

* Renaming atomic-openshift-odo to openshift-odo
2019-09-20 16:59:19 +02:00
Priti Kumari
e2ca944a16 Fixing wrong info provided for integration test comment (#2152) 2019-09-20 15:22:40 +02:00
Priti Kumari
1d9c768ecb Delete .PHONY openshiftci-presubmit-e2e From Makefile (#2151) 2019-09-20 13:38:24 +02:00
Mrinal Das
a0a0a5f220 Removes apps from project specs and speeds up the query (#2099)
* Removes apps from project specs and speeds up the query

* Adds comments

* Adds e2e test
2019-09-20 00:44:28 +02:00
Amit Rout
832a6d7dcc Fixing e2e vs integration test naming (#1878)
* Fixing e2e vs integration test naming

* Fixing link test failure

* Updated test file location

* Updated travis file

* Updated doc

* Fixed test failure

* Updated test file

* Updated test and Makefile

* Broke down json test file

* Update test

* Update Makefile

* Updated doc

* Updated doc

* Updated openshiftci-presubmit-integrationtests.sh file

* Fixed failures

* Fixed travis failure

* Updated doc

* Updated generic test

* Renamed e2e test suite file name

* Added new presubmit e2e/integration testfile

* Updated doc

* Updated app test file

* Fixed failure

* Updated generic test file

* Updated url test file
2019-09-05 14:36:19 +02:00
Charlie Drage
a2b51999a2 Add cross compiling script (#2083)
Adds a cross-compiling script rather than having it in the Makefile.

To test:

```sh
github.com/openshift/odo  fix-cross ✔                                                                                                                                                                                                                                                                                                                                   0m
▶ make cross
./scripts/cross-compile.sh '-X github.com/openshift/odo/pkg/odo/cli/version.GITCOMMIT=91599ec5'
Cross compiling linux-amd64 and placing binary at dist/bin/linux-amd64/
Cross compiling darwin-amd64 and placing binary at dist/bin/darwin-amd64/
Cross compiling windows-amd64 and placing binary at dist/bin/windows-amd64/
```
2019-09-04 16:47:58 +02:00
Tomas Kral
01dc6245ca Update test to reflect changes done in odo-supervisord-image#27 (#1974)
* update test to work with dev-scripts

* fix tests after rebase
2019-09-03 00:06:04 -07:00
Amit Rout
2fbb154aec Making cross compile independent of gox vender package (#2047)
* Making cross compile indepedent of gox vender package

* Fixing Makefile failure

* Updated Makefile

* Updated Makefile

* Updated Makefile as per review comment

* Updated Makefile

* Update Makefile

* Remove gox reference
2019-08-28 16:35:05 +02:00
Amit Rout
baf308be44 Run all integration test in parallel (#1912)
* Run all integration test in parallel

* Checking how integration all behaves in CI

* Updated preference path

* Fixing error

* Updated preference file as per girish

* Fixing test failure

* Updated travis file

* Fixed test failure

* Fixed some more test failure

* Fixed some more test failure

* Increasing CI timeout

* Updating test

* Separating service catalog tests

* Updated Makefile

* Fixed context dir

* Fixed context dir per spec

* Updated CI files and doc

* Updated doc and Makefile comment

* Review comments are addressed

* Updated preference text

* Updated Makefile

* Updated docs

* Updated as per review comment

* Updated tests

* Updated doc

* Updated Makefile
2019-08-16 10:18:30 +02:00
Juan Osorio Robles
d2aaf5d508 Introduce gosec for security checks (#1958)
* Introduce gosec for security checks

gosec does static code analysis and checks for common security issues in
golang codebases.

This PR introduces the tool, and sets it up as a test target in the Makefile.

* Address gosec warnings

This:

* Makes the default directory and file permissions more restrictive.
* Comments out with #nosec a warning that's not relevant, given that
  the function is only used for testing.

* Add "sec" to the validate makefile target

This way, security static analysis checks will be ran as part of regular CI.
2019-07-31 14:56:15 +02:00
Amit Rout
93e11dec03 Enabled component sub test in Makefile (#1962) 2019-07-30 16:39:54 +02:00
Amit Rout
38f455335b Update login test in sync with other test (#1875)
* Run login scenarios test in parallel

* Updated doc

* Commented odo command in travis file

* Updated .travis file

* Updated .travis CI file

* Updated helper file

* Fixed OpenShift CI file

* Updated OpenShift CI file

* Updated travis and Makefile

* Updated OpenShift CI file

* Made login and logout part of Makefile

* Update login test in sync with other test

* Fixing odo login logout as per review comment

* Updated Makefile comment

* Updated test file

* Updated use of token flag

* Updated doc as per review comments

* Updated test file

* Removed new line

* Decrease the test node to 2

* Updated doc
2019-07-26 18:21:35 +02:00
Mrinal Das
bbee9156eb Implementation of a walker for smart odo push (#1849)
* This PR adds a file walker for smart odo push.

The file walker walks the entire directory and builds a map of filename as key and it's size and last modified date as value and compares them to find added/deleted/modified/renamed files and folders in the source context directory.

* Adds comments and parallelizes the tests

* Added more checks in push e2e

* Fixed root directory for windows and info message
2019-07-24 17:51:29 +02:00
Amit Rout
881a0a0fe3 Run source test specs in parallel (#1843)
* Run source test specs in parallel

* Updated doc

* Updated doc

* Commenting e2e test spec due to an open issue

* Commenting e2e test spec due to an open issue

* Updated spec comment
2019-07-11 07:35:16 +02:00
Amit Rout
4505cac7ac Run e2e scenarios test in parallel (#1851)
* Run e2e scenarios test in parallel

* Updated ginkgo path

* Updated doc

* Fixed OpenShift CI file
2019-07-10 11:55:03 +02:00
Amit Rout
ff81dcbb48 Run java test specs in parallel (#1844)
* Run java test specs in parallel

* Updated binary path

* Updated doc

* Commented one spec

* Commented one more spec

* Updated test file

* Updated doc
2019-07-09 12:47:46 +02:00
Amit Rout
9c89ffef6d Run generic test file in parallel (#1830)
* Run generic test file in parallel

* Fixing test failure

* Updated doc

* Updated test file
2019-07-02 15:24:05 +02:00
Amit Rout
842a4e58f7 Run link command test in parallel (#1827)
* Run link command test in parallel

* Updated oc helper test file

* Updated Makefile

* Updated doc

* Updated test file
2019-07-01 11:52:19 +02:00
Mohammed Ahmed
7ed7b03c32 Updating url to indicate if url is present or absent in config and cluster respectively (#1743)
* Adding function to ensure common messaging for push command.

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>

* Updating push message and listing deleted from config urls

 - URLS list now indicate if they are present in config
 - Push message is updated accordingly

* Adding comment and fixing push message object.

* Adding url integration tests

* Updating tests scripts to include url int tests.

* Fixing test URLS -> URLs

* Shortening test spec strings to match

* Removing url checks from generic tests

* Adding helper function to be able to provide array to strings to match.

* Updatng url tests to make use of the helper match functions as needed.

* Fixing match for test.

* Moving pushmessage.go to more generic name and renaming func

The function now returns a message, also making it more easy to
test.

* Adding unit tests to printtemplates

* Updating usage of PushMessage template

* Fixing errors introduced during rebase

* Fixing issues after rebase

* Fixing test templates.

* Updating url tests to parallel run.

* Cleaning up tests
2019-06-28 16:58:53 +02:00
Amit Rout
54b9a583f3 Run preference and config command test in parallel (#1829)
* Run preference and config command test in parallel

* Updated doc

* Updated test file
2019-06-27 10:23:36 +02:00
Amit Rout
5d96478f41 Run service test specs in parallel (#1839)
* Run service test specs in parallel

* Updated doc

* Updated doc
2019-06-26 12:30:47 +02:00
Tomas Kral
628532d6cb Add benchmark tests (#1841)
* Add benchmark tests

Tests are measuring speed of various odo commands for Java and NodeJS
components.
Results are displeyed on the output and also send to the Google Sheet table
https://docs.google.com/spreadsheets/d/1o-GIoYlZoEyW1F25kAwvvEXzbW4tLck0x3EGCC4_L_A/

* add script for running benchmark on openshiftci
2019-06-25 18:28:01 +02:00
Amit Rout
a883a8bb1f Run json format test in parallel (#1789)
* Run json format test in parallel

* Added ginkgo in travis CI

* Added doc and updated Makefile

* Updated doc
2019-06-25 13:22:33 +02:00
Amit Rout
54d7887f6d Run watch command test in parallel (#1826)
* Run watch command test in parallel

* Updated Makefile

* Updated doc
2019-06-25 11:16:29 +02:00
Amit Rout
2dc1176517 Run storage command test in parallel (#1816)
* Run storage command test in parallel

* Updated oc helper file

* Updated stotage test file

* Updated doc and Makefile

* Updated CI files

* Updated travis file
2019-06-24 11:57:12 +02:00
Amit Rout
d062438588 Run app command test in parallel (#1804)
* Run app command test in parallel

* Removed similar app test from json_test file

* Added travis and prow config file

* Updated json output

* Updated doc
2019-06-21 11:38:52 +02:00
Amit Rout
7d496328d6 Run component test in parallel (#1797)
* Run component test in parallel

* Updated other files

* Added doc

* Updated component test

* Updated doc changes and renamed test file
2019-06-19 19:33:04 +02:00
Amit Rout
4eeaaf9578 Running spec parallelly for clean test template (#1759)
* Running spec parallelly for clean test template

* Exporting GOPATH

* Installing ginkgo binary

* Removed debug line

* Removed clean test template reference from travis

* Updated test comment in Makefile

* Updated doc changes for env var SPEC_EXEC_METHOD

* Adding more info to test description

* Updated description

* Added TIMEOUT

* Added GLOBALODOCONFIG for global config isolation

* Fixed review comments

* Added test node env var and updated doc

* Added pwd in PATH

* Removed test template form Makefile

* Updated doc

* Documentation and description updated

* Added ginkgo in travis CI

* Made ginkgo installation part of goget-tools

* Added doc for test-integration

* Updated doc and Makefile
2019-06-12 18:56:52 +02:00
Mrinal Das
ee0c829523 Modifies odo app commands to work outside a directory (#1779)
* Modifies odo app commands to work outside a directory

* Adds a error message

Signed-off-by: mik-dass <mrinald7@gmail.com>

* Adds e2e test

* Removed unused oc helper in app e2e test

* Splits a e2e test into 2 specs

* Fixed error message

* Moves CheckApplicationName and CheckProjectName to cmd utils

* removes os.exit(1)

* Formats ThrowContextError
2019-06-10 16:38:09 +02:00
Girish Ramnani
f52ac9fc9c resolved development docs and bump-version.sh script (#1747)
* resolved development docs and bump-version.sh script

Currently the Readme.adoc doesn't actually show any version for odo but we still try to update that using the bump-version script and also it has been mentioned in the dev docs. so changed that.

* fixed extension of cli-reference file
2019-05-20 12:50:57 +02:00
Mrinal Das
ffcde3baa0 Storage workflow (#1547)
* Modifies storage according to the new workflow

Adds test

Signed-off-by: mik-dass <mrinald7@gmail.com>

* Added e2e tests

Signed-off-by: mik-dass <mrinald7@gmail.com>

* Added comments for CreateArgs and DeleteFromConfigurationList

* Rebased the PR

Signed-off-by: mik-dass <mrinald7@gmail.com>

* Mereged storage e2e test with watch test
2019-05-16 11:46:32 +02:00
Amit Rout
1af22f3b5f Organize the tests in a proper way (#1612) 2019-05-09 15:07:45 +02:00