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

Unit tests/inject test clientset #6874

Conversation

feloy
Copy link
Contributor

@feloy feloy commented Jun 8, 2023

What type of PR is this:

/kind code-refactoring
/area testing

What does this PR do / why we need it:

  • Add the possibility to inject (fake) dependencies when running unit tests on the CLI part.
  • Add unit tests for testing odo anlyze CLI and replace integration tests

Which issue(s) this PR fixes:

Fixes #6888

PR acceptance criteria:

  • Unit test

  • Integration test

  • Documentation

How to test changes / Special notes to the reviewer:

@feloy feloy requested a review from rm3l June 8, 2023 09:14
@netlify
Copy link

netlify bot commented Jun 8, 2023

Deploy Preview for odo-docusaurus-preview canceled.

Name Link
🔨 Latest commit 44d58a5
🔍 Latest deploy log https://app.netlify.com/sites/odo-docusaurus-preview/deploys/64887a28673e140008dbeb50

@feloy feloy requested a review from valaparthvi June 8, 2023 09:14
@openshift-ci openshift-ci bot added kind/code-refactoring area/testing Issues or PRs related to testing, Quality Assurance or Quality Engineering labels Jun 8, 2023
@openshift-ci openshift-ci bot requested review from anandrkskd and rnapoles-rh June 8, 2023 09:14
@odo-robot
Copy link

odo-robot bot commented Jun 8, 2023

OpenShift Unauthenticated Tests on commit 323bceb finished successfully.
View logs: TXT HTML

@odo-robot
Copy link

odo-robot bot commented Jun 8, 2023

Unit Tests on commit 323bceb finished successfully.
View logs: TXT HTML

@odo-robot
Copy link

odo-robot bot commented Jun 8, 2023

Validate Tests on commit 85c5c5f finished successfully.
View logs: TXT HTML

@odo-robot
Copy link

odo-robot bot commented Jun 8, 2023

Kubernetes Tests on commit 323bceb finished successfully.
View logs: TXT HTML

@odo-robot
Copy link

odo-robot bot commented Jun 8, 2023

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

@odo-robot
Copy link

odo-robot bot commented Jun 8, 2023

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

@odo-robot
Copy link

odo-robot bot commented Jun 8, 2023

OpenShift Tests on commit 323bceb finished with errors.
View logs: TXT HTML

@odo-robot
Copy link

odo-robot bot commented Jun 8, 2023

NoCluster Tests on commit 323bceb finished successfully.
View logs: TXT HTML

cmd/odo/common_test.go Show resolved Hide resolved
cmd/odo/common_test.go Show resolved Hide resolved
cmd/odo/common_test.go Show resolved Hide resolved
@feloy feloy force-pushed the unit-tests/inject-test-clientset branch 6 times, most recently from f2f1290 to 30f4dcb Compare June 9, 2023 11:58
@feloy feloy force-pushed the unit-tests/inject-test-clientset branch 3 times, most recently from 6d5a997 to 44d58a5 Compare June 13, 2023 14:16
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
2.8% 2.8% Duplication

@feloy feloy requested a review from rm3l June 13, 2023 15:09
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. Required by Prow. label Jun 13, 2023
@feloy
Copy link
Contributor Author

feloy commented Jun 13, 2023

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

[FAILED] [423.437 seconds]
E2E Test starting with non-empty Directory [It] should verify developer workflow from non-empty Directory
/go/odo_1/tests/e2escenarios/e2e_test.go:197
[...]
  [odo]  âš   Unable to attach or mount volumes: unmounted volumes=[m2-suypzb-app-vol], unattached volumes=[odo-projects odo-shared-data m2-suypzb-app-vol kube-api-access-v6dgn]: timed out waiting for the condition

@openshift-ci
Copy link

openshift-ci bot commented Jun 13, 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] [423.437 seconds]
E2E Test starting with non-empty Directory [It] should verify developer workflow from non-empty Directory
/go/odo_1/tests/e2escenarios/e2e_test.go:197
[...]
 [odo]  âš   Unable to attach or mount volumes: unmounted volumes=[m2-suypzb-app-vol], unattached volumes=[odo-projects odo-shared-data m2-suypzb-app-vol kube-api-access-v6dgn]: timed out waiting for the condition

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 13, 2023

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

  [FAILED] registry_list_output.mdx
  Expected
      <string>:   strings.Join({
        	... // 108 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 open-",
        	"source front-en...  2.0.2, 2.1.0\n```\n",
        }, "")
      
  to be empty
  In [It] at: /go/odo_1/tests/documentation/command-reference/doc_command_reference_init_test.go:189 @ 06/13/23 14:54:19.598

@openshift-ci
Copy link

openshift-ci bot commented Jun 13, 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

 [FAILED] registry_list_output.mdx
 Expected
     <string>:   strings.Join({
       	... // 108 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 open-",
       	"source front-en...  2.0.2, 2.1.0\n```\n",
       }, "")
     
 to be empty
 In [It] at: /go/odo_1/tests/documentation/command-reference/doc_command_reference_init_test.go:189 @ 06/13/23 14:54:19.598

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 13, 2023

/override windows-integration-test/Windows-test

+ [FAILED] [27.013 seconds]
odo add binding command tests [BeforeEach] when the component is bootstrapped when adding a binding (other namespace) when odo dev is run should successfully bind component and service
  [BeforeEach] C:/Users/Administrator.ANSIBLE-TEST-VS/4149/tests/integration/cmd_add_binding_test.go:22
  [It] C:/Users/Administrator.ANSIBLE-TEST-VS/4149/tests/integration/cmd_add_binding_test.go:260

FAILED] [221.415 seconds]
odo logs command tests when component is created and odo logs is executed when running in both Dev and Deploy mode [BeforeEach] should successfully show logs of the running component
  [BeforeEach] C:/Users/Administrator.ANSIBLE-TEST-VS/4149/tests/integration/cmd_logs_test.go:235
  [It] C:/Users/Administrator.ANSIBLE-TEST-VS/4149/tests/integration/cmd_logs_test.go:247



  [oc] ''Unable to connect to the server: dial tcp 149.81.180.114: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 13, 2023

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

In response to this:

/override windows-integration-test/Windows-test

+ [FAILED] [27.013 seconds]
odo add binding command tests [BeforeEach] when the component is bootstrapped when adding a binding (other namespace) when odo dev is run should successfully bind component and service
 [BeforeEach] C:/Users/Administrator.ANSIBLE-TEST-VS/4149/tests/integration/cmd_add_binding_test.go:22
 [It] C:/Users/Administrator.ANSIBLE-TEST-VS/4149/tests/integration/cmd_add_binding_test.go:260

FAILED] [221.415 seconds]
odo logs command tests when component is created and odo logs is executed when running in both Dev and Deploy mode [BeforeEach] should successfully show logs of the running component
 [BeforeEach] C:/Users/Administrator.ANSIBLE-TEST-VS/4149/tests/integration/cmd_logs_test.go:235
 [It] C:/Users/Administrator.ANSIBLE-TEST-VS/4149/tests/integration/cmd_logs_test.go:247



 [oc] ''Unable to connect to the server: dial tcp 149.81.180.114: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.

@openshift-merge-robot openshift-merge-robot merged commit aabbded into redhat-developer:main Jun 13, 2023
@rm3l rm3l added the area/refactoring Issues or PRs related to code refactoring label Jun 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/refactoring Issues or PRs related to code refactoring area/testing Issues or PRs related to testing, Quality Assurance or Quality Engineering 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.

Rewrite analyze integration tests as unit tests
3 participants