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

Adds runMode to env for debugging with odo watch. #3597

Merged

Conversation

mik-dass
Copy link
Contributor

@mik-dass mik-dass commented Jul 17, 2020

/kind bug

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

If runMode is debug, odo watch will trigger push with debug settings else it will trigger normal push.

Which issue(s) this PR fixes:

Fixes #3480

PR acceptance criteria:

  • Unit test

  • Integration test

  • Documentation

How to test changes / Special notes to the reviewer:

  • Execute odo push --debug
  • Execute odo watch and check if it detects debug mode for pushing files.
  • Revert to odo push and check if it uses normal mode for pushing files.

@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Jul 17, 2020
@mik-dass mik-dass force-pushed the watch_debug_push branch 2 times, most recently from f03815d to 21ab076 Compare July 17, 2020 15:49
Comment on lines 31 to 36
type RUNMode string

const (
RunMODE RUNMode = "run"
DebugMODE RUNMode = "debug"
)
Copy link
Contributor

Choose a reason for hiding this comment

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

it could be simply

type RunMode string
const (
     Run       RunMode =  "run"
     Debug   RunMode = "run"
)

@@ -37,6 +47,9 @@ const (

// DefaultDebugPort is the default port used for debugging on remote pod
DefaultDebugPort = 5858

// DefaultRunMode is the default run mode of the component
DefaultRunMode = "run"
Copy link
Contributor

Choose a reason for hiding this comment

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

use the constant defined above

@mik-dass
Copy link
Contributor Author

@adisky Fixed

@@ -0,0 +1,7 @@
package envinfo

func GetFakeEnvInfo(settings ComponentSettings) *EnvInfo {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you please add comment what does this function do?

Copy link
Contributor

Choose a reason for hiding this comment

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

can we keep the fake stuff in _test.go files as they are for testing perposes if I am not wrong?

Copy link
Contributor Author

@mik-dass mik-dass Jul 22, 2020

Choose a reason for hiding this comment

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

I tried that but it doesn't work. I think we cannot use functions from _test.go in the main code. I also found this online https://stackoverflow.com/questions/59064256/is-it-possible-to-call-a-test-func-from-another-file-to-start-the-testing

@mik-dass
Copy link
Contributor Author

@prietyc123 Fixed

@openshift-ci-robot
Copy link
Collaborator

openshift-ci-robot commented Jul 21, 2020

@mik-dass: The following tests failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/prow/v4.2-integration-e2e 442dbbd link /test v4.2-integration-e2e
ci/prow/v4.3-integration-e2e 442dbbd link /test v4.3-integration-e2e

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@girishramnani
Copy link
Contributor

what about all the --now flag cases? would those all set the run mode to Push?

@codecov
Copy link

codecov bot commented Jul 21, 2020

Codecov Report

Merging #3597 into master will decrease coverage by 0.02%.
The diff coverage is 25.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3597      +/-   ##
==========================================
- Coverage   45.56%   45.53%   -0.03%     
==========================================
  Files         115      116       +1     
  Lines       11681    11697      +16     
==========================================
+ Hits         5322     5326       +4     
- Misses       5841     5853      +12     
  Partials      518      518              
Impacted Files Coverage Δ
pkg/envinfo/envinfo.go 56.81% <0.00%> (-3.19%) ⬇️
pkg/envinfo/fake.go 0.00% <0.00%> (ø)
pkg/watch/watch.go 64.67% <66.66%> (+0.06%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6c507ec...9e7b138. Read the comment docs.

@mik-dass
Copy link
Contributor Author

what about all the --now flag cases? would those all set the run mode to Push?

Fixed 👍

@girishramnani
Copy link
Contributor

girishramnani commented Jul 22, 2020

what about all the --now flag cases? would those all set the run mode to Push?

Fixed 👍

can we have intg test for this as well?

@mik-dass
Copy link
Contributor Author

can we have intg test for this as well?

Already added in the URL --now scenario.

@girishramnani
Copy link
Contributor

/approve

@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: girishramnani

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. Required by Prow. label Jul 22, 2020
@prietyc123
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. Required by Prow. label Jul 23, 2020
@openshift-merge-robot openshift-merge-robot merged commit 5467310 into redhat-developer:master Jul 23, 2020
@mik-dass mik-dass deleted the watch_debug_push branch August 21, 2020 04:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. Required by Prow. kind/bug Categorizes issue or PR as related to a bug. 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 watch always dismisses debug mode
6 participants