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

Display outputs when executing odo run #6865

Conversation

feloy
Copy link
Contributor

@feloy feloy commented Jun 2, 2023

What type of PR is this:

/kind feature

What does this PR do / why we need it:

This PR completes the implementation for #6568.

  • odo run streams logs into the terminal and waits for the command to finish.
  • user can interrupt the command by pressing control-c; cleanup the resources.
  • the exit code of odo run command reflect the exit code of the last devfile command executed. If the last command was apply and it was successful it returns 0, if failed returns 1
  • Because odo dev is running, if Kubernetes/OpenShift resources are created with Apply commands, they should be deployed in "Dev" mode (to be cleanup when odo dev terminates) - make it clear it will be cleaned up.

Which issue(s) this PR fixes:

Fixes #6568

Doc: https://deploy-preview-6865--odo-docusaurus-preview.netlify.app/docs/command-reference/run

PR acceptance criteria:

  • Unit test

  • Integration test

  • Documentation

How to test changes / Special notes to the reviewer:

@netlify
Copy link

netlify bot commented Jun 2, 2023

Deploy Preview for odo-docusaurus-preview ready!

Name Link
🔨 Latest commit 2ee19df
🔍 Latest deploy log https://app.netlify.com/sites/odo-docusaurus-preview/deploys/6486d67ece205b00080265dc
😎 Deploy Preview https://deploy-preview-6865--odo-docusaurus-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@openshift-ci openshift-ci bot added the kind/feature Categorizes issue as a feature request. For PRs, that means that the PR is the implementation label Jun 2, 2023
@openshift-ci openshift-ci bot requested review from anandrkskd and valaparthvi June 2, 2023 14:01
@odo-robot
Copy link

odo-robot bot commented Jun 2, 2023

NoCluster Tests on commit 3f52160 finished successfully.
View logs: TXT HTML

@odo-robot
Copy link

odo-robot bot commented Jun 2, 2023

OpenShift Unauthenticated Tests on commit 3f52160 finished successfully.
View logs: TXT HTML

@odo-robot
Copy link

odo-robot bot commented Jun 2, 2023

Unit Tests on commit 3f52160 finished successfully.
View logs: TXT HTML

@odo-robot
Copy link

odo-robot bot commented Jun 2, 2023

Validate Tests on commit 3f52160 finished successfully.
View logs: TXT HTML

@odo-robot
Copy link

odo-robot bot commented Jun 2, 2023

Windows Tests (OCP) on commit 3f52160 finished with errors.
View logs: TXT HTML

@odo-robot
Copy link

odo-robot bot commented Jun 2, 2023

Kubernetes Tests on commit 3f52160 finished successfully.
View logs: TXT HTML

@odo-robot
Copy link

odo-robot bot commented Jun 2, 2023

OpenShift Tests on commit 3f52160 finished with errors.
View logs: TXT HTML

@feloy feloy force-pushed the feature-6568/odo-run-command-logs-main branch from b265bfb to 13c475b Compare June 2, 2023 19:38
@feloy feloy force-pushed the feature-6568/odo-run-command-logs-main branch from 13c475b to 76e4aa9 Compare June 2, 2023 19:44
@odo-robot
Copy link

odo-robot bot commented Jun 2, 2023

Kubernetes Docs Tests on commit d892e8e finished with errors.
View logs: TXT HTML

@feloy feloy force-pushed the feature-6568/odo-run-command-logs-main branch from 76e4aa9 to 7a3c31a Compare June 2, 2023 20:50
@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

No Coverage information No Coverage information
4.6% 4.6% Duplication

@feloy feloy requested review from rm3l and removed request for anandrkskd June 12, 2023 10:45
Copy link
Member

@rm3l rm3l left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works great!

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. Required by Prow. label Jun 12, 2023
@feloy
Copy link
Contributor Author

feloy commented Jun 12, 2023

/override windows-integration-test/Windows-test

[FAILED] [74.039 seconds]
odo dev command tests when running build and run commands as composite in different containers and a shared volume - without metadata.name [It] should run successfully
C:/Users/Administrator.ANSIBLE-TEST-VS/4139/tests/integration/cmd_dev_test.go:2634
[...]
  [odo] Error occurred on Push - watch command was unable to push component: failed to sync to component with name enluih: failed to sync to component with name enluih: unable to exec command [rm -rf /projects/*]: error while streaming command: error sending request: Post "https://c114-e.eu-de.containers.cloud.ibm.com:30329/api/v1/namespaces/cmd-dev-test2634cpf/pods/enluih-app-5dfbbc59fc-kls8p/exec?command=rm&command=-rf&command=%2Fprojects%2F%2A&container=runtime&stderr=true&stdout=true": dial tcp 161.156.183.218:30329: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

@openshift-ci
Copy link

openshift-ci bot commented Jun 12, 2023

@feloy: Overrode contexts on behalf of feloy: windows-integration-test/Windows-test

In response to this:

/override windows-integration-test/Windows-test

[FAILED] [74.039 seconds]
odo dev command tests when running build and run commands as composite in different containers and a shared volume - without metadata.name [It] should run successfully
C:/Users/Administrator.ANSIBLE-TEST-VS/4139/tests/integration/cmd_dev_test.go:2634
[...]
 [odo] Error occurred on Push - watch command was unable to push component: failed to sync to component with name enluih: failed to sync to component with name enluih: unable to exec command [rm -rf /projects/*]: error while streaming command: error sending request: Post "https://c114-e.eu-de.containers.cloud.ibm.com:30329/api/v1/namespaces/cmd-dev-test2634cpf/pods/enluih-app-5dfbbc59fc-kls8p/exec?command=rm&command=-rf&command=%2Fprojects%2F%2A&container=runtime&stderr=true&stdout=true": dial tcp 161.156.183.218:30329: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

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.

@feloy
Copy link
Contributor Author

feloy commented Jun 12, 2023

/override Kubernetes-Integration-Tests/Kubernetes-Docs-Integration-Tests

doc command reference odo init Non Interactive Mode fetching devfile from a registry when setting up the registry [It] Fetch Devfile from any registry of the list [nocluster]
/go/odo_1/tests/documentation/command-reference/doc_command_reference_init_test.go:176
[...]
[FAILED] registry_list_output.mdx
  Expected
      <string>: Â Â strings.Join({
      Â Â 	... // 106 identical bytes
      Â Â 	"                          VERSIONS\nnodejs-react  StagingRegistry",
      Â Â 	"         React is a free and open-source front-en...  2.0.2, 2.1",
      +Â 	".0, 2.2",
      Â Â 	".0\nnodejs-react  DefaultDevfileRegistry  React is a free and ope",
      Â Â 	"n-source front-en...  2.0.2, 2.1.0\n```\n",
      Â Â }, "")

@openshift-ci
Copy link

openshift-ci bot commented Jun 12, 2023

@feloy: Overrode contexts on behalf of feloy: Kubernetes-Integration-Tests/Kubernetes-Docs-Integration-Tests

In response to this:

/override Kubernetes-Integration-Tests/Kubernetes-Docs-Integration-Tests

doc command reference odo init Non Interactive Mode fetching devfile from a registry when setting up the registry [It] Fetch Devfile from any registry of the list [nocluster]
/go/odo_1/tests/documentation/command-reference/doc_command_reference_init_test.go:176
[...]
[FAILED] registry_list_output.mdx
 Expected
     <string>: Â Â strings.Join({
     Â Â 	... // 106 identical bytes
     Â Â 	"                          VERSIONS\nnodejs-react  StagingRegistry",
     Â Â 	"         React is a free and open-source front-en...  2.0.2, 2.1",
     +Â 	".0, 2.2",
     Â Â 	".0\nnodejs-react  DefaultDevfileRegistry  React is a free and ope",
     Â Â 	"n-source front-en...  2.0.2, 2.1.0\n```\n",
     Â Â }, "")

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.

@feloy
Copy link
Contributor Author

feloy commented Jun 12, 2023

[FAILED] [421.741 seconds]
odo dev command tests when running odo dev with devfile containing volume-component - with metadata.name [BeforeEach] should successfully use the volume components in container components
  [BeforeEach] /go/odo_1/tests/integration/cmd_dev_test.go:2110
  [It] /go/odo_1/tests/integration/cmd_dev_test.go:2135
[...]
       âš   AttachVolume.Attach failed for volume "pvc-86478ada-da97-492a-9bc9-116ce50b27e3" : timed out waiting for external-attacher of vpc.block.csi.ibm.io CSI driver to attach volume r010-6fc7c3f8-d350-4c6f-9875-bf6363f77d83

@feloy
Copy link
Contributor Author

feloy commented Jun 12, 2023

/override "SonarCloud Code Analysis"
Duplication code on Mocks

@openshift-ci
Copy link

openshift-ci bot commented Jun 12, 2023

@feloy: Overrode contexts on behalf of feloy: SonarCloud Code Analysis

In response to this:

/override "SonarCloud Code Analysis"
Duplication code on Mocks

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.

@feloy
Copy link
Contributor Author

feloy commented Jun 12, 2023

/override OpenShift-Integration-tests/OpenShift-Integration-tests

[FAILED] [421.741 seconds]
odo dev command tests when running odo dev with devfile containing volume-component - with metadata.name [BeforeEach] should successfully use the volume components in container components
  [BeforeEach] /go/odo_1/tests/integration/cmd_dev_test.go:2110
  [It] /go/odo_1/tests/integration/cmd_dev_test.go:2135
[...]
       âš   AttachVolume.Attach failed for volume "pvc-86478ada-da97-492a-9bc9-116ce50b27e3" : timed out waiting for external-attacher of vpc.block.csi.ibm.io CSI driver to attach volume r010-6fc7c3f8-d350-4c6f-9875-bf6363f77d83

@openshift-ci
Copy link

openshift-ci bot commented Jun 12, 2023

@feloy: Overrode contexts on behalf of feloy: OpenShift-Integration-tests/OpenShift-Integration-tests

In response to this:

/override OpenShift-Integration-tests/OpenShift-Integration-tests

[FAILED] [421.741 seconds]
odo dev command tests when running odo dev with devfile containing volume-component - with metadata.name [BeforeEach] should successfully use the volume components in container components
 [BeforeEach] /go/odo_1/tests/integration/cmd_dev_test.go:2110
 [It] /go/odo_1/tests/integration/cmd_dev_test.go:2135
[...]
      âš   AttachVolume.Attach failed for volume "pvc-86478ada-da97-492a-9bc9-116ce50b27e3" : timed out waiting for external-attacher of vpc.block.csi.ibm.io CSI driver to attach volume r010-6fc7c3f8-d350-4c6f-9875-bf6363f77d83

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.

@openshift-merge-robot openshift-merge-robot merged commit 6bc3011 into redhat-developer:main Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue as a feature request. For PRs, that means that the PR is the implementation lgtm Indicates that a PR is ready to be merged. Required by Prow.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

odo run <devfile-command> when odo dev is running
3 participants