208 Commits

Author SHA1 Message Date
Armel Soro
fc2ffce43a Stop testing binding-related code since the Service Binding Operator has been deprecated [1]
Also add warning notes to the corresponding command reference pages.

This section used to cause a bunch of flaky tests,
even if it hasn't seen any changes over the past months/years.

[1] https://redhat-developer.github.io/service-binding-operator/userguide/intro.html
2024-07-18 00:08:12 +02:00
Armel Soro
2508cf7362 Run only of asubset of the integration tests in OpenShift CI
Rationale: All of the integration tests are already covered in GitHb CI
(using Kubernetes), and they tend to be a bit flaky on OpenShift.
2024-05-18 09:15:33 +02:00
Armel Soro
b5ea6f144b Revisit CI to spin up clusters on-demand (#7159)
* Label ServiceBinding tests, so we can run them separately

They require installing additional components in the cluster (OLM, SBO, ...).

* Add GH Workflow for most of our tests (including cluster-related tests)

This allows to easily test even multiple versions of Kubernetes if needed.

For easier reporting and visualisation (and also avoid rebuilding odo many times),
Podman tests have also been relocated in this same Workflow.

Notes:
I tried to spin up lightweight OpenShift clusters but gave up because of several issues:
- MicroShift: I tried to use the aio container image, but this one is no longer maintained and is pretty old version of OCP.
Trying to follow the official guidelines did not work either because a base RHEL OS is mandatory
- CRC/OpenShiftLocal with Microshift preset: didnt pass the pre-checks because it detected an issue with nested virtualization on the GH Runner.

* Drop unused code in helper_oc and use namespace instead of project

When testing on Microshift, it seems that the Project API is purposely not implemented on MicroShift
2023-12-08 23:28:10 +00:00
Armel Soro
15f663f12a Start HTTP server to replace Devfile Registry server in the tests (#7154) 2023-12-01 10:35:15 +01:00
Armel Soro
5d4a6ef325 Use staging Devfile registry for PR tests (#7129)
* Revert using a DEVFILE_PROXY env var

There is no proxy deployed in the internal test cluster.
As such, this env var no longer makes sense.

* To help troubleshoot, display the resolved Devfile registry URL

* Make interactive tests more resilient with stack versions

They are now able to determine if the "Select version" prompt
should be asked by "odo init" or not:

* Make sure doc automation tests do not rely on hard-coded namespaces

* Allow to run doc automation tests with more parallel Ginkgo nodes

This is possible now that those tests no longer
depend on a single hard-coded namespace.

* Remove occurrences of the DEVFILE_REGISTRY env var in IBM Pipelines scripts

* Reuse logic for determining the Devfile Registry URL in "odo registry" tests

* Clarify what openshiftci-config.sh is used for
2023-10-27 07:54:14 +00:00
Armel Soro
725a64014a Display Git commit ID in output of odo commands where the version is shown (#7074)
* Display Git commit ID in output of odo commands where the version is displayed

This covers:
- odo init
- odo dev
- odo deploy

Displaying the commit ID (same as in `odo version`) will help quickly pinpoint the exact commit without having to run `odo version`.

See #6131 for more context

* Append the state of the working tree next to the Git commit ID

`git describe` is much more helpful to quickly understand the state of the working tree.

For backward compatibility, we are defaulting to `git rev-parse`,
just in case `git describe` does not work correctly.

* Fix integration tests

* Fix doc automation tests

Strip the Git commit ID from the full odo version string
prior to comparing the outputs.
We still want to compare the tag displayed.
2023-09-06 20:36:13 +02:00
Philippe Martin
251648998c Serve SwaggerUI (#6989)
* Serve SwaggerUI

* Add api server doc

* Copy swagger.yaml when running `make install`

* Check swagger.yaml if up-to-date

* Script to copy swagger-ui files
2023-07-21 10:39:31 +02:00
Armel Soro
9fd65cd27d Generate static UI files from within a container (#6972)
* Generate static UI files from within a container, for more predictability

For some reason, Angular was not generating the same hash
for the `runtime*.js` file (even with the same content),
causing the 'check-ui-static-files' job to sometimes fail.

Leveraging a container (as we are already doing for the
'generate-apiserver' and 'generate-apifront' tasks)
should allow for more predictable output.

Co-authored-by: Philippe Martin <phmartin@redhat.com>

* Generate static UI

---------

Co-authored-by: Philippe Martin <phmartin@redhat.com>
2023-07-18 08:21:50 +02:00
Philippe Martin
ebe003ede0 Serve UI from api server (#6954)
* Serve UI from api server

* Build UI static files + check generation with GHAction

* Update UI static files

* Use specific commit for verify-changed-files action

* Add pkg/apiserver-impl/ui to .gitattributes

* Ignore pkg/apiserver-impl/ui/** for sonar
2023-07-07 07:07:14 -04:00
Philippe Martin
649181c1dc Implement devfile state in odo api (#6941)
* POST /devstate/container

* Implement POST /devstate/container

* Generate DELETE /devstate/container/{containerName}

* Implement DELETE /devstate/container/{containerName}

* Serve /devstate/image

* Implement /devstate/image

* Serve /devstate/resource

* Implement /devstate/resource

* Move Components specific code to components.go

* Serve /devstate/*command

* Implement /devstate/*command

* Serve /devstate/metadata

* Implement /devstate/metadata

* Serve devstate/chart

* Implement /devstate/chart

* Create a DevfileContent schema reference

* Use `DELETE /command/{name}` instead of `DELETE /*Command/{name}`

* Serve /devstate/command/move

* Implement /devstate/command/move

* Serve /devstate/command/{name}/[un]setDefault

* Implement /devstate/command/{name}/[un]setDefault

* serve /devstate/events

* Implement /devstate/events

* Serve /devstate/quantityValid

* Implement /devstate/quantityValid

* Add json tag to API result value

* Sets a proxy for the API

* Move calls from wasm to api (first part)

* Implement PUT /devsatte/devfile

* Move calls from wasm to api (end)

* Implement GET /devstate/devfile

* Implement DELETE /devstate/devfile

* At startup, get devfile from api, not from localStorage

* Rename service wasmGo -> devstate

* Remove wasm module

* Update to latest devfile-lifecycle version, license compatible

* Apply suggestions from code review

Co-authored-by: Armel Soro <armel@rm3l.org>

* Remove wasm from ui/{Makefile/devfile.yaml}

* Define DevfileContent into apispec

* Define required fields

* Generate API models from front

* Regenerate API server after spec changes

* Fix examples case

* Fix github action e2e tests not running

* Make target for all generated api code

---------

Co-authored-by: Armel Soro <armel@rm3l.org>
2023-07-05 05:19:29 -04:00
Parthvi Vala
0b012f30e5 Implement HTTP Server based on OpenAPI spec (#6835)
* Implement HTTP Server based on OpenAPI spec

Signed-off-by: Parthvi Vala <pvala@redhat.com>
Co-authored-by: Armel Soro <asoro@redhat.com>
Co-authored-by: Philippe Martin <phmartin@redhat.com>

* Starter server when odo dev starts

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Add --api-server and --api-server-port flags to start API Server; write the port to stat file; TODO: make this feature experimental

Signed-off-by: Parthvi Vala <pvala@redhat.com>
Co-authored-by: Armel Soro <asoro@redhat.com>
Co-authored-by: Philippe Martin <phmartin@redhat.com>
Signed-off-by: Parthvi Vala <pvala@redhat.com>

Make the flag experimental

Signed-off-by: Parthvi Vala <pvala@redhat.com>

Make apiserver and apiserverport flag local

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Use container image to run openapi-generator-tool instead of a local CLI

Co-authored-by: Armel Soro <asoro@redhat.com>
Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Add integration test

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Use label podman

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Regenerate the api files with openapitool v6.6.0 and changes from review

Signed-off-by: Parthvi Vala <pvala@redhat.com>
Co-authored-by: Armel Soro <asoro@redhat.com>

---------

Signed-off-by: Parthvi Vala <pvala@redhat.com>
Co-authored-by: Armel Soro <asoro@redhat.com>
Co-authored-by: Philippe Martin <phmartin@redhat.com>
2023-06-19 10:29:36 -04:00
Armel Soro
58969d9eb0 Replace deprecated --slow-spec-threshold Ginkgo flag with --poll-progress-after (#6834)
* Replace deprecated '--slow-spec-threshold' Ginkgo flag with '--poll-progress-after'

Per [1], this instructs Ginkgo to automatically emit a progress report
whenever a node takes too long to complete.
The Progress Report includes information about which node is currently running
and the exact line of code that it is currently executing,
along with any relevant goroutines that were launched by the spec.

[1] https://onsi.github.io/ginkgo/#getting-visibility-into-long-running-specs

* Also set '--poll-progress-interval' flag so as to get progress reports periodically
2023-05-23 06:05:03 -04:00
Parthvi Vala
ef6489c424 Add mockgen installation to the script (#6604)
* Add mockgen installation to the script

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Use go install -mod=readonly instead of installing the binary

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Add mockgen installation to goget-tools target incase the user wants to run the script individually

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Update Makefile

Co-authored-by: Armel Soro <armel@rm3l.org>

---------

Signed-off-by: Parthvi Vala <pvala@redhat.com>
Co-authored-by: Armel Soro <asoro@redhat.com>
Co-authored-by: Armel Soro <armel@rm3l.org>
2023-03-06 15:01:57 +01:00
Philippe Martin
facfb79cca Run Docs tests on CI/CD (#6521)
* Run Docs tests on CI/CD

* Remove warnings from test output

* Replace version in mdx files
2023-01-25 13:50:02 -05:00
Philippe Martin
9ebf766c86 Stop containers after Podman tests (#6535)
* Stop containers after tests

* Use --output-interceptor-mode=none  flag to not wait containers stopped

* Run podman pod inspect after tests

* Dedicated step for listing/stopping containers
2023-01-25 09:19:04 -05:00
Armel Soro
511792a62c Isolate Podman tests in namespaces (#6499)
* Rename SetProjectName into GetProjectName

Co-authored-by: Anand Singh <ansingh@redhat.com>
Co-authored-by: Parthvi Vala <pvala@redhat.com>
Co-authored-by: Philippe Martin <phmartin@redhat.com>

* Generate specific containers.conf file for each test spec using a dedicated engine namespace

Co-authored-by: Anand Singh <ansingh@redhat.com>
Co-authored-by: Parthvi Vala <pvala@redhat.com>
Co-authored-by: Philippe Martin <phmartin@redhat.com>

* Listen on random ports on Podman when '--random-ports' is used

This reduces the risks of port conflicts when running test specs in parallel.

Co-authored-by: Philippe Martin <phmartin@redhat.com>

* Exclude Gosec G404 (use of math/rand) rule

Co-authored-by: Philippe Martin <phmartin@redhat.com>

* Run Podman specs in parallel

* Output the Pod spec to be played by Podman depending on verbosity level

This will help debug potential issues.

* Use random name in 'using devfile that contains K8s resource to run it on podman' test

* Use random component name in sample java-quarkus project used in 'a hotReload capable project is used with odo dev' test

* Revert "Run Podman specs in parallel"

Parallelization works great on GitHub Actions, but I experimented a lot
of issues when running locally with a lot (~11) of parallel test nodes.
Not sure why exactly, but some containers created by Podman had a lot of
networking issues.
We can look into parallelizing the runs later in a subsequent PR.

This reverts commit 64d5d31248a62f355a32ca245ba399a723fdb22f.

* Allow overridding the number of parallel nodes for Podman integration tests

This way, we could be able to run them in parallel on GitHub
but sequentially (default) locally.
This will still benefit us by reducing the time it takes to run such tests on GitHub.

Meanwhile, we can look into the issues we have locally with parallelization.

Note that it is still possible to run them locally in parallel via
the PODMAN_EXEC_NODE env var.

Co-authored-by: Anand Singh <ansingh@redhat.com>
Co-authored-by: Parthvi Vala <pvala@redhat.com>
Co-authored-by: Philippe Martin <phmartin@redhat.com>
2023-01-23 09:25:57 -05:00
Parthvi Vala
7c563b5de3 Doc Automation: Command Reference: odo init (#6442)
* Pilot work

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Add more tests

* CompareDocOutput returns strings missing from cmdout and file

* Finish automating docs for odo init command reference

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Cleanup

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Add make target for doc automation tests; create a separate folder for doc automation tests; add documentation for helper functions

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Attempt at fixing validation test

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Fix validation failures

* Rename ReplaceTimeInString to ReplaceAllTimeInString

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Replace all time strings with a static value for both cmd and mdx output

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Add test suite for command reference tests

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Fix failing test and skip empty directory interactive test; add comment
for tests with specific check

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Fix make target

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* StripSpinner relies on statement to decide if it should strip the line or let it be

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Add check for unicode spinner frames just in case it is present; it is flaky

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Make interactive tests work

* Make it pretty

* Update odo version

Signed-off-by: Parthvi Vala <pvala@redhat.com>
2023-01-05 14:03:26 -05:00
Philippe Martin
83cdda6960 Test with OpenShift cluster non authenticated (#6395)
* Test with OpenShift cluster non authenticated

* Add analyze commands

* Add same tests as with NoCluster

* Do not try to cleanup namespaces

* Assert non authenticated

* Change Makefile target name
2022-12-09 06:41:38 -05:00
Anand Kumar Singh
6172a16fc7 E2e scenario 3 (#6073)
* add e2e test for binding

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* fails on testing binding's

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* update e2e test

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* remove FIt

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* incorporate requested changes

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* incorporate requested changes

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* dont run go sec on example directory

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* fix flaky behaviour

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* fix flaky behaviour

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* nit: cleanup

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* Apply suggestions from code review

Signed-off-by: anandrkskd <anandrkskd@gmail.com>
Co-authored-by: Armel Soro <armel@rm3l.org>
2022-11-25 12:45:26 -05:00
Philippe Martin
120920f868 Integration tests for odo dev running on podman (#6332)
* Change signature of StartDevMode to use options structure

* Add tests for odo dev on podman

* Uncomment commented code

* Update Makefile

Co-authored-by: Armel Soro <armel@rm3l.org>

Co-authored-by: Armel Soro <armel@rm3l.org>
2022-11-24 08:24:00 -05:00
Anand Kumar Singh
ce42ce435e InterOP: enable test report generation for tests (#6307)
* enable test report generation for tests

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* add test-reports to gitignore

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

Signed-off-by: anandrkskd <anandrkskd@gmail.com>
2022-11-16 20:22:49 +00:00
Philippe Martin
5a39eda50e goget-tools install method (#6311) 2022-11-16 08:23:12 +00:00
Dharmit Shah
f062c11a11 Update odo to use go 1.18 (#6166)
* Update odo to use go 1.18

Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>

* Update golangci-lint version in Makefile

Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>

* Use go 1.18, not go 1.19

Erroneously I had used go 1.19 at various places.

Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>

* Rearrange imports; fix golangci-lint errors

Fixed a bunch of golangci-lint errors like below:

`File is not `gofmt`-ed with `-s``

using the command: `golangci-lint run --fix`

Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>

* Use go install instead of go get

This is because with go 1.18, `go get` behaves as `go get -d` by
default. Which means that it will only download, but not install.

Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>

Signed-off-by: Dharmit Shah <shahdharmit@gmail.com>
2022-11-09 05:31:38 -05:00
Philippe Martin
2dab7fbda9 Define label for integration tests not needing cluster (#6242) 2022-10-31 18:16:24 -04:00
Tomas Kral
fd04ea645a add make release-bin target (#6245) 2022-10-31 05:44:21 -04:00
Anand Kumar Singh
39b8c7e4c2 fix flake and use operatorhub to install EDB (#6004)
* fix flake

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* fix flake

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* check if namespace is created

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* check if namespace without sercice is created

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

Signed-off-by: anandrkskd <anandrkskd@gmail.com>
2022-08-29 11:26:57 -04:00
Anand Kumar Singh
41feef4391 increase timeout by 60sec devEnv check (#5978)
Signed-off-by: anandrkskd <anandrkskd@gmail.com>

Co-authored-by: Armel Soro <asoro@redhat.com>
2022-07-27 10:12:22 -04:00
Anand Kumar Singh
7437483d4b download golangci-lint binary with test script (#5934)
* remove golangci-lint installation from test script

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* download golint in test script

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* use makefile to download golangci-lint

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* use official method to install linter

Signed-off-by: anandrkskd <anandrkskd@gmail.com>
2022-07-18 15:09:14 +00:00
Anand Kumar Singh
c7f3f3b1d1 reduce test make targets, organize test file structure (#5931)
* reduce test make targets, organize test file structure

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* remove report collection

Signed-off-by: anandrkskd <anandrkskd@gmail.com>
2022-07-13 05:32:11 +00:00
Anand Kumar Singh
722020678f Migrate to ginkgo v2 (#5809)
* migrate to ginkgo v2 for tests

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* update to ginkgo/v2

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* update to ginkgo v2

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* use ginkgo binary for tests

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* update to ginkgo v2

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* remove GOFLAG while downloading ginkgo

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* remove FlakeAttempts from tests

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* use ginkgo v2.1.4

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* mod cleanup and use mod to run ginkgo

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* remove unnecessary goget-ginkgo from sctipt

Signed-off-by: anandrkskd <anandrkskd@gmail.com>
2022-07-06 10:31:01 +00:00
Anand Kumar Singh
4ba943986d add e2e tests (#5778)
* add e2e tests, add G107 in gosec as exception

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* add error handling

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* incorporate reviews

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* error handling

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* error handling

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* disable G107 for tests only

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* remove commented code

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* remove tests redundant checks

Signed-off-by: anandrkskd <anandrkskd@gmail.com>
2022-06-09 06:24:21 -04:00
Armel Soro
06550eb233 Add additional checks to golangci-lint (#5567) (#5687)
* Document golangci-lint configuration options

* Do not limit the number of issues reported per linter

* Add check preventing the use of the deprecated 'github.com/pkg/errors' package

* Upgrade golangci-lint to 1.37.0, so we can use 'revive' Linter

- revive is a drop-in replacement for the deprecated golint Linter
- revive will allow to check for error strings

Note: We are purposely not using the latest golangci-lint (1.45.0)
but the minimum version from which revive is available.
This is because the latest 1.45.0 reports additional linting issues
(from govet and staticcheck for example). And fixing those side errors
is outside of the scope of this issue.
Also some of those issues are already fixed in #5497 (update to Go 1.17).

* Configure revive to check for error strings

More rules can be added later on if needed

* Fix issues reported by revive's error-strings rule

Some rules are purposely ignored when the
error messages represent top-level errors that are
displayed to be displayed as is to end users

* Fix more error-strings issues

For some reason, those were not reported by revive's error-strings rule,
but only by GoLand inspection tool.

* Fix missing `revive:disable:error-strings` comment directive

Also replace "fmt.Errorf" by "errors.New" when the error message is static
2022-04-25 07:32:20 -04:00
Charlie Drage
9c491b16fe Updates odo init output, fixes colorized output for tests. (#5613)
* Update vendoring for coloring to add NO_COLOR

* Updates odo init output / adds logo

<!--
Thank you for opening a PR! Here are some things you need to know before submitting:

1. Please read our developer guideline: https://github.com/redhat-developer/odo/wiki/Dev:-odo-Dev-Guidelines
2. Label this PR accordingly with the '/kind' line
3. Ensure you have written and ran the appropriate tests: https://github.com/redhat-developer/odo/wiki/Dev:-Writing-and-running-tests
4. Read how we approve and LGTM each PR: https://github.com/redhat-developer/odo/wiki/Pull-Requests:-Review-guideline

Documentation:

If you are pushing a change to documentation, please read: https://github.com/redhat-developer/odo/wiki/Documentation:-Contributing
-->

**What type of PR is this:**

<!--
Add one of the following kinds:
/kind bug
/kind cleanup
/kind tests
/kind documentation

Feel free to use other [labels](https://github.com/redhat-developer/odo/labels) as needed. However one of the above labels must be present or the PR will not be reviewed. This instruction is for reviewers as well.
-->

/kind feature

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

We have the logo appearing in `odo dev` and `odo deploy`

Those 3 commands are the most used with `odo`, and the ones that are
most used. All three should have similar and consistent output that
contains:
  * What the component is doing (first line)
  * What's detected (in odo init, it's the files, in odo deploy and dev
    it's the component name)
  * odo version that is being used / outputted.

```sh
$ odo init
  __
 /  \__     Initializing a new component
 \__/  \    Files: No source code detected, a starter project will be created in the current directory
 /  \__/    odo version: v2.5.0
 \__/

Interactive mode enabled, please answer the following questions:
? Select language: javascript
? Select project type: Next.js
 ✓  Downloading devfile "nodejs-nextjs" from registry "DefaultDevfileRegistry" [450ms]
? Which starter project do you want to use? nodejs-nextjs-starter
? Enter component name: my-nodejs-nextjs-app
 ✓  Downloading starter project "nodejs-nextjs-starter" [516ms]

Your new component 'my-nodejs-nextjs-app' is ready in the current directory.
To start editing your component, use 'odo dev' and open this folder in your favorite IDE.
Changes will be directly reflected on the cluster.
```

**Which issue(s) this PR fixes:**
<!--
Specifying the issue will automatically close it when this PR is merged
-->

N/A

**PR acceptance criteria:**

- [X] Unit test

- [X] Integration test

- [X] Documentation

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

N/A

Signed-off-by: Charlie Drage <charlie@charliedrage.com>

* Update based on reviews

Signed-off-by: Charlie Drage <charlie@charliedrage.com>

* Update based on review

Signed-off-by: Charlie Drage <charlie@charliedrage.com>
2022-04-12 09:41:45 -04:00
Armel Soro
2132cb516f [#5561] Remove odo url (#5571)
* Remove `odo url` from CLI layer

* Adapt tests

* Adapt test from deleted `cmd_devfile_delete_test.go`

This test still makes sense, as it tests the removal
of URL-related resources, like Services and Ingresses.

* Remove call to `odo project set ...` in test, as suggested in review

This command will get removed in the near future.

* Remove places where URL manipulation could modify  Devfiles

Also remove dead code

* Remove unused `updateURL` field from EnvInfo struct

* Adapt test by mimicking some behavior that `odo url create` used to perform

`odo url` used to modify the `env.yaml` file,
and `odo dev` currently creates Kubernetes/OCP resources related to URLs.

We may remove this test later on if `odo dev`
no longer needs to create such Ingresses and Routes.

* Remove all places where URLs, Ingresses and Routes are manipulated

* Port test in cmd_dev_test instead and make sure no Ingress/Route is created

* Remove no-longer `test-cmd-devfile-url` target from Makefile

The corresponding test file has been deleted.

* Remove `create url` command reference from V3 docs, as suggested in review

* Use existing `devfile-with-multiple-endpoints.yaml` Devfile  in test, as suggested in review
2022-03-28 16:39:53 +02:00
Parthvi Vala
80d7cfde30 Create cleanup (#5589)
* Cleanup create code

* Add missing integration tests from odo create to odo init

* Add CreateLocalEnv to create .odo/env/env.yaml file for commands that require it but cannot create it

* Remove 'odo create'  usages from integration tests

* Remove create reference from the Makefile

* REmove create doc from v3

Signed-off-by: Parthvi Vala <pvala@redhat.com>

* Remove test files

* Fix CI failure

Signed-off-by: Parthvi Vala <pvala@redhat.com>
2022-03-25 13:37:52 +01:00
Tomas Kral
614976a0bf remove odo catalog command (#5577)
* remove odo catalog command

- move devfile registry relevant code to pkg/registry

* remove odo catalog page form docs

* remove a few forgotten uses of catalog from clientset.go

* fix typos in docs
2022-03-23 12:15:41 +01:00
Parthvi Vala
312ae310e2 Remove v2delete reference from Makefile (#5580) 2022-03-22 17:30:29 +01:00
Rodolfo Napoles
83f26da94d Reorganized test file directory structure (#5537)
* Rebased was required

* Replicated changes to  openshiftci related scripts to avoid test failure
2022-03-16 01:42:11 -04:00
Armel Soro
dbd88143d3 Make sure Makefile targets for both integration and E2E tests depend on the 'install' target (#5538)
This is because such targets run tests that rely on the `odo` binary
to execute subcommands in separate processes.
While iterating on the code, we could often end up with situations where
the `odo` binary is no longer up-to-date, should we forget to `make install` before.
2022-03-11 04:54:09 -05:00
Anand Kumar Singh
3eb92b6a47 POC for odo interactive testing (#5466)
* POC for odo interactive testing

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* add interactive tests to make target test-integration

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* [WIP] use func to pass test instructions

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* cleanup comments/test

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* cleanup minor changes

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* fix unit test failure

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* skip for windows

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* skip for windows by not compiling, cleanup

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* cleanup, and add the make target to test files

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* incorporate review, adding comments, cleanup

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* fix failing make validate

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* update test dependency, and possible fix for windows

Signed-off-by: anandrkskd <anandrkskd@gmail.com>

* Revert "update test dependency, and possible fix for windows"

This reverts commit 55580b7dc5.

* Final cleanup

Signed-off-by: anandrkskd <anandrkskd@gmail.com>
2022-03-02 13:50:26 -05:00
Philippe Martin
850c7cd723 Remove commands that wont be implemented for v3-alpha1 (#5433)
* Remove odo staorage commands

* Remove "odo service" + "odo catalog * service" commands

* Remove odo link/unlink commands

* Remove related integration tests

* Remove application concept

* fix rebase

* fix test

* Remove config command

* Remove env command

* Remove application package

* Remove config package

* Move odogenerator and unions packages into kclient

* Move notify package to cli/version

* Fix script mockgen

* Remove odo debug command oand debug package

* Remove odo component describe/exec/log/status/test

* Remove operator-hub tests from IBM tests

* Remove operator hub tests from CI

* Fix e2e tests
2022-02-06 23:42:15 -05:00
Philippe Martin
07ef685df7 Use an image with pre-installed oc/kubectl/ibmcloud for IBM Pipelines (#5269)
* Use an image with pre-installed oc/kubectl/ibmcloud for IBM Pipelines

* Increase time for unit tests (very long on single CPU VM)

* Dockerfile for build image
2021-12-03 17:02:46 +01:00
Tomas Kral
5f79c542a8 openshift/odo -> redhat-developer/odo (#5268)
* openshift/odo -> redhat-developer/odo

* update more links to redhat-developer
2021-12-01 16:38:34 +01:00
Mrinal Das
74fc779a4a Removes the s2i flag from the create file (#5023) 2021-09-21 09:18:39 -04:00
Rodolfo Napoles
b9765a4bee Modifies and adds scripts to run K8S tests on IBM Cloud cluster (#5022)
* Scripts for PSI minishift tests

* added line at end of script

* added line at end of script

* emoved info as requested

* Updates as per review feedback

* deleting unwanted script as it was replaced with other files

* Scripts for PSI minishift tests

* Applied workaround to use env variable to select minikube or minishift

* Set CLUSTER env variable to appply workaround for firewall not taking parameters

* added curl for missing script and added misiing /, removed unnecessary cd

* Separating minishift from merged minikube-minishift scripts due to firewall not taking parameters for script execution

* Changes to run tests in IBM Cloud, changed TEST_EXEX_NODES=24

* remove non required changes (old stuff) and remove non required scripts (old stuff)

* Modified and added scripts to run tests in IBM Cloud cluster

* Additional changes for to run K8S test in IBM Cloud

* Removed unnecessary line

* changes to run tests on K8S cluster in IBM Cloud

* ncorportaed changes based on feedback for IBM Cloud tests

* Chnages based in feedback for IBM Cloud

* updated string for home dir

* removing test-integration-devfile as it ends with failures

* Fixed if statement

* changes to Makefile for number of nodes

* added requested comment to Makefile about nodes if running in IBM Cloud
2021-09-08 14:39:21 +02:00
Mohammed Ahmed
0b8b712a99 Dropping support for service catalog based services (#4906)
* Removing cli layer and integration tests related to service catalog

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

* Fixing missing error msg

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

* Fixing golint errors

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

* Fixing error for interactive mode

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

* Moving interactive mode error to top

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

* Fixing

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

* Fixing interactive mode error condition

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

* Removing some more service related code

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

* Fixing golint

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

* Removing service catalog backend part 1

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

* Updating changelogs

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

* Removing some more of the service catalog related code

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

* Updating as per comments in review

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

* Update pkg/odo/cli/service/create.go

Co-authored-by: Parthvi Vala <pvala@redhat.com>

* Fixing gofmt

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

* Adding kube to cli docs

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

* Updating changelog as per comments by @dharmit

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

* Removing some unnessasary stuff

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

* Updating docs based changes as per review

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

* Fixing test

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

* Update pkg/odo/cli/catalog/describe/service.go

Co-authored-by: Philippe Martin <contact@elol.fr>

* Update pkg/odo/cli/service/list.go

Co-authored-by: Philippe Martin <contact@elol.fr>

Co-authored-by: Parthvi Vala <pvala@redhat.com>
Co-authored-by: Philippe Martin <contact@elol.fr>
2021-08-18 11:41:43 +00:00
Mrinal Das
6b03998f5b Adds a column in odo list output to indicate components created by odo (#4962)
* Adds a column in odo list output to indicate components created by odo

* Updates the changelog.md
2021-08-05 08:40:57 +00:00
Philippe Martin
0fd7a11129 Refactor project command tests (#4849) 2021-07-02 03:14:33 -04:00
Philippe Martin
843e520f6b odo link and odo unlink write to devfile without deploying to cluster (#4819)
* Do not deploy sbr at `odo link` time, save it in devfile

* Changelog

* Fix remove duplicates

* Do not set owner references again

* Fix wait for pod terminating

* Simplify env vars deduplication

* Add comment

* Dont use oc

* link type

* fix

* Fix spinner

* Fix tests

* Fic error message for link/unlink

* Review

* No spinner
2021-07-01 06:43:24 -04:00
Philippe Martin
648592e93a Run operator hub tests in parallel (#4846) 2021-06-24 06:16:05 -04:00