Commit Graph

208 Commits

Author SHA1 Message Date
Tomas Kral
1970e1183d run all test in verbose mode (#1640) 2019-04-24 05:01:43 -07:00
Tomas Kral
cdb2f0b95a add real e2e test for besic new workflow scenario (#1559) 2019-04-09 23:47:08 -07:00
Tomas Kral
d5f78222dd openshiftci-utnittess: get gox before attemting make cross (#1577) 2019-04-09 00:07:36 -07:00
anmolbabu
c43bc3371e Add --config and --source flags to push (#1529)
* Add `--config` and `--source` flags to push

This commit adds:
1. `--config` flag to update the component with component settings
2. `--source` flag to push only the source to an already existing
   component.
3. If neither `--config` nor `--source` flags are passed, update
   both source and configuration onto the component

fixes #1489
Signed-off-by: anmolbabu <anmolbudugutta@gmail.com>

* Add e2e tests to test push with `--source` and `--config`

Signed-off-by: anmolbabu <anmolbudugutta@gmail.com>

* Incorporate @snarwade comments

Signed-off-by: anmolbabu <anmolbudugutta@gmail.com>

* Fix a rebase error

Signed-off-by: anmolbabu <anmolbudugutta@gmail.com>

* clean and organize context in up e2e test

* Relax timeout for component tests

Signed-off-by: anmolbabu <anmolbudugutta@gmail.com>

* Add `--project` to push tests to workaround the openshift CI failures

Signed-off-by: anmolbabu <anmolbudugutta@gmail.com>

* Incoporate @kadel comments

Signed-off-by: anmolbabu <anmolbudugutta@gmail.com>

* Incorporate @surajnarwade comments

Signed-off-by: anmolbabu <anmolbudugutta@gmail.com>
2019-04-08 11:00:54 -07:00
Tomas Kral
571fdd6d54 Scripts to run on OpenShift CI (#1516)
* Scripts to run on OpenShift CI

* fix makefile and add script for unit tests

* publish binaries as part of unit test job
2019-04-08 08:51:46 -07:00
Amit Rout
63c06901a1 Adding .exe extension for make bin on Windows (#1536) 2019-04-02 06:36:28 -07:00
Tomas Kral
6bd0d73dc6 redhat-developer/odo -> openshift/odo (#1505)
* redhat-developer/odo -> openshift/odo

* gofmt

* add CircleCI tests temporary back to TravisCI
2019-03-21 17:36:28 +01:00
Mohammed Ahmed
631b53d2a3 Adding scripts to handle initialization of cluster for openshift CI. (#1441)
* Adding scripts to handle initialization of cluster for openshift CI.

This also fixes couple of usernames on the side

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

* Adding http-tools to build root so we can use htpasswd

* Adding login as developer and creation of first project

* Moving script to ./scripts and renaming makefile command

* Renaming scripts to incude tests in configure cluster script

* Making script more configurable

* Adding namespace to secret commands.

* Fixing missing username

* Simplifying script by removing unnessasary variables

* Adding TODO and slightly reduction wait time for auth config

* Making assets dir overwritable

* Making configure script executable.

* Fixing message for not existing kubeconfig

* Redirecting out and err of commands where we are not interested in msg

* Updating to 18 secs default sleep which can be overridden

* Adding workaround for missing wildfly in OpenShift 4.0

* Adding basic ci docs for prow

Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>
2019-03-13 11:20:34 +05:30
Chris Laprun
28ffdae02f More component-related improvements (#1295)
* Harmonize recommended command names.

* Extract component tests.

* Remove unused constant.

* Make component tests parameterized so we can vary the command prefix.

* Add sub-command component tests.

* Fix documentation.

* Fix get and set command names.

* Add tests for sub-commands.

* Add generateTimeBasedName function and use it.

* Fix improper target.

* Add getActiveElementFromCommandOutput function and use it

* Add test to validate get and set.

* Activate new component sub-command tests in Travis.

* Fix component tests.

* Fix component tests.

* Trim spaces from getActiveElementFromCommandOutput.
2019-02-11 12:40:30 +01:00
girish ramnani
603f7a2b87 resolved the incorrect PHONY in make file (#1312) 2019-02-09 00:29:39 +05:30
Suraj Narwade
5f2be30b7d Machine Readable Output (#1196)
* Machine Readable Output

Provide machine readable output (json format) so that other applications can easily consume output generated by odo. for example, vscode plugin

fixes #1062

* odo app describe <appname> -o json
* odo app list -o json
* odo describe <componentName> -o json
* odo list -o json
* odo url list -o json

* changed version to v1alpha1

* added status field to component spec

* Added storage machine readable struct

* Added e2e test

* Fixed merged conflict

* fixed golangci issues

* fixed storage e2e tests

* fixed golangci issue

* resolved merge conflict

* proper error handling in storage

* validating -o flag

* updated travis test

* fixed imports

* updated travis job

* updated tests

* Fixed application status field

* Fixed travis test

* added CheckOutputFlag function

* fixed merge conflict due to component refactor

* output flag validation for application

* fixed tkral's comments

* Fixed env var

* Fixed tests
2019-02-04 13:19:37 +01:00
Mohammed Zeeshan Ahmed
6fb1fd474b Fixing #1017: Intercepting login message and customising the message message (#1251)
* Fixing #1017: Intercepting login message and printing custom message

- Adding buffer to replace os.Stdout and intercept output of login
- Customizing a message from odo based on what was intercepted,
so if new-project is present in original message, appropriate
addition is done to odo message
- Printing custom message for login success case.

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

* Changing extra message to more closely immitate openshifts own messaging

* Changing to plan B of string replacement of new-project.

* Replacing "<projectname>" with "<project-name>"

* Splitting replace logic into 2 lines

* Adding tests to odo login

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

* Reducing wait time for project deletetion

* Altering trigger name for odo login test

* Adding failure case with invalid token login

* Adding odo login e2e tests to travis.

* Removing references of second teat project

* Adding explicit timing

* Increasing wait time

* Replacing explicit time with WaitForCmdOut
2019-02-01 14:46:17 +05:30
anmolbabu
7e20c86c43 propagate deletes during odo watch (#1125)
* Watch enhancements + bug fixes

1. This PR fixes the use case of odo watch pushing observed
changes from any level nested in source root directory to
the component source root because of which, the changes
are not reflected in the component.
2. Propagation of deletes in watched source to component pod
3. Back up source dir to work-around the problem with some of the s2i
    images like python where source is mv from destination dir to
    Working dir which means when source is pushed by watch subsequently,
    with this fix, things are expected to work just fine
4. Fix UTs in accordance with the new enhancements
5. Add more e2e tests to cover watch for source and binary
6. Fix minor bug with odoignore and gitignore lookup

Steps to verify this PR:
Test 1:
a. trigger odo watch on a local source
b. make change in a file in a nested dir in the source directory
c. See the change is reflected in the component(perhaps via component url? :) )
Test 2:
Steps in #950

fixes #1099 #988 #1054 #1121 
Signed-off-by: anmolbabu <anmolbudugutta@gmail.com>
2019-01-23 17:34:14 +05:30
Chris Laprun
ce6633af48 Fix #1132: Add debug target. (#1133)
* Fix #1132: Add debug target.

* Factor out common flags.
2019-01-03 10:38:13 +05:30
Georgios Andrianakis
ef02ee62a2 Implement unlink command (#1107) 2018-12-10 14:11:24 +02:00
Tomas Kral
8a8dcc6a66 fix path to GITCOMMIT variable to dislay correct value in 'odo version' 2018-12-04 23:11:20 +01:00
Tomas Kral
73d7c5ac84 fix path to GITCOMMIT variable to dislay correct value in 'odo version' 2018-12-04 18:44:27 +01:00
Georgios Andrianakis
e623e585d3 Add cpu flags to component create (#1038)
Fixes: #908
2018-11-23 16:42:17 +02:00
Chris Laprun
6d05c4ba9d Move commands to where they should be (#1002)
* Move main to cmd/odo.

* Refactor doc generation into one single command.

* Rename for consistency.

* Move commands to pkg/odo/cli.

* Export Add*Flag functions to prepare for move.

* Move validateName to pkg/odo/cli/util/validation.go.

* Move functions used by only one command to the command file.

* Renamed to storage_test since tests are storage-related.

* Move usage template to cmdutils.

* Use RootCmd() instead of var access.

* Move printComponentInfo back to cmdutils and expose.

* Move application to application package.

* Move component to component package. Move componentShortFlag also.
Not sure why it was on delete and not on component.

* Move commands to appropriate packages.

* Rename root to cli.

* Rename main to odo.

* Fix wrong reference to main file.

* Fix(?) generate-coverage.sh.

* Move root command name to cli.go.

* Move Add*Flag functions to genericclioptions/context_flags.
Move adding completion handler to package-specific functions
(duplication >_<)

* Move CmdUsageTemplate and PrintComponentInfo to odo/util package.

* Move VERSION and getLatestReleaseInfo to cli/version package.
Remove now empty cmdutils.

* Start using NewCmd* instead of init. Break import cycle. :)

* Rename client to cmdutils.

* Move to use NewCmd* pattern for all commands.

* Fix cross-compilation target.
2018-11-22 13:22:03 +05:30
syamgk
c43d72363f fix typo 2018-11-16 16:25:06 +05:30
syamgk
c8f4c38fb3 make end to end test less verbose
remove verbose flag from end2end test and add -ginkgo.succinct
2018-11-14 18:08:11 +05:30
Georgios Andrianakis
bddc99c469 Attempt to fix cmp e2e test flakiness (#964)
* Attempt to fix cmp e2e test flakiness

* Fix broken curl commands
2018-11-13 11:07:54 +05:30
Georgios Andrianakis
1356b4f7b6 Add end to end tests that test various runtimes with --local 2018-11-09 17:14:22 +02:00
Georgios Andrianakis
1c7f00eaf0 Add some e2e tests for Java
These tests cover both wildfly and openjdk, and also use both source
(via git) and binary deploys

Fixes: #777
2018-11-08 14:29:09 +02:00
Tomas Kral
6d298039c4 run wwhrd (licence checker) in quiet mode (#876)
It won't show accepted packages.
2018-10-26 17:50:35 +05:30
Mrinal Das
0a0f070964 Set up service-catalog on travis (#809)
* Set up service-catalog on travis

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

* Changed odo commands to oc and moved common parts of wait functions to a new function waitForCmdOut()

Signed-off-by: mik-dass <mrinald7@gmail.com>
2018-10-17 14:04:41 -04:00
anmolbabu
ea174cb57b Add vendor license checks to PR (#744)
* Add vendor license checks to PR

This PR aims to add automatic detection of licenses of vendor-ed packages for every PR raised
to the Odo repository using a tool called [wwhrd](https://github.com/frapposelli/wwhrd) that
iterates on every vendored package, searches for the license file, detects the license type
and validates the detected license type against the different sections of the configuration
file .wwhrd.yml.

fixes #743
Signed-off-by: anmolbabu <anmolbudugutta@gmail.com>

* Incoporate comments from @surajnarwade

Signed-off-by: anmolbabu <anmolbudugutta@gmail.com>

* Incoporate @tkral Comments

Signed-off-by: anmolbabu <anmolbudugutta@gmail.com>

* Add documentation about the license checks

Signed-off-by: anmolbabu <anmolbudugutta@gmail.com>

* Incoporate @codeclimate comments

Signed-off-by: anmolbabu <anmolbudugutta@gmail.com>

* Incoporate @cdrage comments

Signed-off-by: anmolbabu <anmolbudugutta@gmail.com>

* Incoporate @cdrage and @kadel comments

Signed-off-by: anmolbabu <anmolbudugutta@gmail.com>

* Incorporate @cdrage comments

Signed-off-by: anmolbabu <anmolbudugutta@gmail.com>
2018-10-03 11:30:12 -04:00
Anush Shetty
3c4493547d Add provision for running all e2e tests (#766) 2018-10-03 11:16:28 -04:00
Charlie Drage
122b0e1ee4 Adds 'make clean' command
Adds a `make clean` command that removes the odo binary in the folder as
well as the `dist` folder where compiled binaries go.

Closes https://github.com/redhat-developer/odo/issues/102
2018-09-05 15:37:11 -04:00
Anush Shetty
d1a57e598b Refactoring component e2e tests: (#625)
demo_test.go and e2e_test.go have a lot of duplicate tests. With this PR, I am moving all the component related tests to cmp_test.go, and am removing demo_test.go.

We will continue to add more component tests to cmp_test.go
2018-09-05 10:52:53 +05:30
Mrinal Das
3fc7a3998a Merge pull request #671 from surajnarwade/makefile-vendor
Added vendor-update command to makefile
2018-09-03 02:42:24 -07:00
Charlie Drage
3715072ac8 Updates CLI reference Makefile command and doc (#679)
This updates the documentation (it's a tad out of date) as well as
modifies the makefile command to actually modify the
docs/cli-reference.md file
2018-08-30 14:00:29 +05:30
Suraj Narwade
2618a4e012 Added vendor-update command to makefile
This PR adds vendor-update command to Make, so that
we can simply update vendor using `make vendor-update` command
2018-08-27 19:05:34 +05:30
Anush Shetty
b5059c3adf Fixing e2e tests on minishift:
In this PR, we do away with http calls on IP:Port (which failed on minishift),
but instead create a route using `odo url` and then run curl on that url.

This PR also adds a timeout option for tests. Eg. TIMEOUT=20m make test-e2e
2018-08-07 19:52:02 +05:30
mdas
c2ccc3b8e8 Fixed the update issue from the git to local/binary or vice versa.
To achieve this, two functions have been added SetupForSupervisor and CleanupAfterSupervisor in occlient.go. Also some other functions are added in occlient to add and remove initContainers, volumeMounts and volumes to the deploymentConfig. Also updateDcAnnotations in occlient is added to update the annotations in the deploymentConfig.

Signed-off-by: mdas <mrinald7@gmail.com>
2018-07-19 15:12:59 +05:30
Charlie Drage
ce67bb1858 Add more help documentation, automatically generate CLI reference
- Adds more help documentation
- Adds script to generate CLI reference
2018-05-28 10:07:27 -04:00
Anush Shetty
8d37304439 Script for running the demo workflow:
We use --ginkgo.focus to run e2e and demo tests separately
2018-04-24 13:33:43 +05:30
Tomas Kral
4536e071ca Disable golint again 2018-04-24 08:55:18 +02:00
Tomas Kral
727359f134 Revert "travisci - disable golint" 2018-04-23 16:28:09 +02:00
Tomas Kral
dd0df2db87 Temporary disable golint.
Something is wrong with its repo, and it fails to 'go get'.
2018-04-23 14:09:24 +02:00
Tomas Kral
edf7a7c138 make e2e tests verbose 2018-04-12 20:50:08 +02:00
Suraj Narwade
73f6148780 Renaming ocdev to odo
Resolves #336.
I didn't change bintray repo name yet. Others, almost all references are changed to odo.
2018-04-12 20:50:08 +02:00
Anush Shetty
bc6e746402 Fixing error-handling and logging of errors in e2e tests:
With this commit, the `runCmd` function has been modified to \
use GinkgoWriter and gexec.Start.
2018-04-10 13:53:12 +05:30
Charlie Drage
73b3f7ff6f Add a bit of verbosity to e2e tests
Adds verbosity to the tests as well as command-line-outout:

```sh
▶ make test-e2e
go test github.com/redhat-developer/ocdev/tests/e2e -ginkgo.v
$ git clone https://github.com/openshift/nodejs-ex /tmp/ocdev807324634/nodejs-ex

Running Suite: ocdev test suite
===============================
Random Seed: 1522871416
Will run 9 of 9 specs

Usecase #5 ocdev project
  should create a new project
  /home/wikus/seafile/files/dev/go/src/github.com/redhat-developer/ocdev/tests/e2e/e2e_test.go:120
$ ocdev project create ocdev-1522871416
New project created and now using project : ocdev-1522871416

$ ocdev project get --short
ocdev-1522871416

•
------------------------------
Usecase #5 creating an application when application by the same name doesn't exist
  should create an application
  /home/wikus/seafile/files/dev/go/src/github.com/redhat-developer/ocdev/tests/e2e/e2e_test.go:129
$ ocdev application create usecase5
Creating application: usecase5
Switched to application: usecase5

$ ocdev application get --short
usecase5

•
------------------------------
Usecase #5 creating an application when application by the same name doesn't exist
  should be created within the project
  /home/wikus/seafile/files/dev/go/src/github.com/redhat-developer/ocdev/tests/e2e/e2e_test.go:134
$ ocdev project get --short
ocdev-1522871416

```
2018-04-04 15:55:24 -04:00
Anush Shetty
69d7cac992 Minor fixes 2018-03-21 23:50:08 +05:30
Anush Shetty
9c51e36f58 OCDEV e2e tests on travis:
1. Pushing a separate PR with glide changes for depenedencies

2. The e2e tests are run with `oc cluster up` on travis:
   (i) scripts/oc-cluster.sh is used to bring up an Openshift cluster.
   (ii) scripts/travis-check-pods.sh is used to check if the router
        and docker-register pods are running once the oc cluster is
        up.

3. In `.travis.yml`, the e2e tests are run in parallel with the
   other tests
2018-03-21 14:15:51 +05:30
Tomas Kral
17b88a4f73 Switch from dep to glide.
Dep doesn't resolve specific versions of transitive dependecies.
This can make problems with some projects.
For example kubernetes/client-go doesn't not support dep currently.
2018-03-16 15:02:04 +01:00
Tomas Kral
4500d3c419 fix Makefile 2018-02-19 13:07:05 +01:00
Tomas Kral
abba6f1876 upload packages to bintray repositories
there are two types of packages
 - build from master: version number is timestamp
     (YearMonthDateHourMinuteSecond) those are uploaded to
     ocdev-rpm-dev and ocdev-deb-dev repositories
 - build from tag: those are released version and they have normal
     semver version. They are uploaded to ocdev-rpm-releses and
     ocdev-deb-releases
2018-02-19 07:43:34 +01:00
Tomas Kral
e35eee1984 add create-package.sh (make package)
This script uses fpm to create rpm and deb packages.
It creates binary packages, so they can't be used in any of the official distribution's repositories.
But they can be used in our repository to make it easier for users to install ocdev
2018-02-19 07:42:55 +01:00