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

Set 'mountSources' to 'true' in some example SpringBoot multi-container Devfiles #6761

Conversation

rm3l
Copy link
Member

@rm3l rm3l commented Apr 21, 2023

What type of PR is this:
/kind bug
/area testing

What does this PR do / why we need it:

In those examples, the build and run commands are running in
different container components.
Without mounting sources in the container used for the 'run' command,
this command will not start because Maven would not be able
to resolve the 'spring-boot' plugin:

 ✓  Building your application in container (command: defaultbuild) [39s]
 •  Executing the application (command: defaultrun)  ...
 ✗  Finished executing the application (command: defaultrun) [151ms]
 ⚠  Devfile command "defaultrun" exited with an error status in 20 second(s)
 ⚠  Last 100 lines of log:
 ✗  Waiting for the application to be ready [1m]
 ⚠  Port forwarding might not work correctly: timeout while checking for ports; ports not listening: (8080 in container "runtime"): context deadline exceeded
 ⚠  Running `odo logs --follow` might help in identifying the problem.

 -  Forwarding from 127.0.0.1:20001 -> 8080

This was not caught in the tests because failing to run the
'run' command currently does not prevent the Dev session from starting.

This change might actually make the test faster as we would not have to wait 1 minute
to find out that the application port is not reachable.

 ✓  Building your application in container (command: defaultbuild) [44s]
 •  Executing the application (command: defaultrun)  ...
 ✓  Waiting for the application to be ready [1s]
 -  Forwarding from 127.0.0.1:20002 -> 8080

Which issue(s) this PR fixes:
Related to #6754

PR acceptance criteria:

  • Unit test

  • Integration test

  • Documentation

How to test changes / Special notes to the reviewer:

odo init --name test-java-springboot \
  --devfile-path /path/to/odo/tests/examples/source/devfiles/springboot/devfile-with-missing-projectType-and-language-metadata.yaml \
  --starter springbootproject

odo dev

…er Devfiles

In those examples, the build and run commands are running in
different container components.
Without mounting sources in the container used for the 'run' command,
this command will not start because Maven would not be able
to resolve the 'spring-boot' plugin:

```
 ✓  Building your application in container (command: defaultbuild) [39s]
 •  Executing the application (command: defaultrun)  ...
 ✗  Finished executing the application (command: defaultrun) [151ms]
 ⚠  Devfile command "defaultrun" exited with an error status in 20 second(s)
 ⚠  Last 100 lines of log:
 ✗  Waiting for the application to be ready [1m]
 ⚠  Port forwarding might not work correctly: timeout while checking for ports; ports not listening: (8080 in container "runtime"): context deadline exceeded
 ⚠  Running `odo logs --follow` might help in identifying the problem.

 -  Forwarding from 127.0.0.1:20001 -> 8080
```

This was not caught in the tests because failing to run the
'run' command current does not prevent the Dev session from starting.

This change might actually make the test faster as we would not have to wait 1 minute
to find out that the application port is not reachable.
@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Apr 21, 2023
@netlify
Copy link

netlify bot commented Apr 21, 2023

Deploy Preview for odo-docusaurus-preview canceled.

Name Link
🔨 Latest commit 7f9d41c
🔍 Latest deploy log https://app.netlify.com/sites/odo-docusaurus-preview/deploys/644244a3d3fa99000734866f

@openshift-ci openshift-ci bot added the area/testing Issues or PRs related to testing, Quality Assurance or Quality Engineering label Apr 21, 2023
@odo-robot
Copy link

odo-robot bot commented Apr 21, 2023

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

@odo-robot
Copy link

odo-robot bot commented Apr 21, 2023

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

@odo-robot
Copy link

odo-robot bot commented Apr 21, 2023

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

@odo-robot
Copy link

odo-robot bot commented Apr 21, 2023

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

@odo-robot
Copy link

odo-robot bot commented Apr 21, 2023

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

@odo-robot
Copy link

odo-robot bot commented Apr 21, 2023

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

@odo-robot
Copy link

odo-robot bot commented Apr 21, 2023

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

@feloy feloy closed this Apr 21, 2023
@feloy feloy reopened this Apr 21, 2023
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. Required by Prow. label Apr 24, 2023
@rm3l rm3l closed this Apr 24, 2023
@rm3l rm3l reopened this Apr 24, 2023
@sonarcloud
Copy link

sonarcloud bot commented Apr 24, 2023

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 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@rm3l
Copy link
Member Author

rm3l commented Apr 24, 2023

  << Timeline

  [FAILED] Expected
      <*url.Error | 0xc000870c30>: {
          Op: "Post",
          URL: "http://127.0.0.1:60116/api/newuser",
          Err: <*errors.errorString | 0xc00008a130>{s: "EOF"},
      }
  to be nil
  In [It] at: C:/Users/Administrator.ANSIBLE-TEST-VS/3776/tests/e2escenarios/e2e_test.go:431 @ 04/24/23 08:13:25.417

  There were additional failures detected.  To view them in detail run ginkgo -vv

Flaky E2E test (#6582)

/override windows-integration-test/Windows-test

@openshift-ci
Copy link

openshift-ci bot commented Apr 24, 2023

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

In response to this:

 << Timeline

 [FAILED] Expected
     <*url.Error | 0xc000870c30>: {
         Op: "Post",
         URL: "http://127.0.0.1:60116/api/newuser",
         Err: <*errors.errorString | 0xc00008a130>{s: "EOF"},
     }
 to be nil
 In [It] at: C:/Users/Administrator.ANSIBLE-TEST-VS/3776/tests/e2escenarios/e2e_test.go:431 @ 04/24/23 08:13:25.417

 There were additional failures detected.  To view them in detail run ginkgo -vv

Flaky E2E test (#6582)

/override windows-integration-test/Windows-test

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.

@rm3l
Copy link
Member Author

rm3l commented Apr 24, 2023

[...]

Ran 452 of 824 Specs in 2110.872 seconds
SUCCESS! -- 452 Passed | 0 Failed | 0 Pending | 372 Skipped

Ginkgo ran 1 suite in 36m16.200276075s
Test Suite Passed

[...]

  [odo] I0421 14:09:07.330501   20288 exec.go:49] ExecuteCommand returned an an err: error while streaming command: error sending request: Post "https://c100-e.eu-de.containers.cloud.ibm.com:31988/api/v1/namespaces/e2e-test197ilv/pods/kvvtbv-app-5786ddc7bd-ftx2h/exec?command=%2Fbin%2Fsh&command=-c&command=cat+%2Fopt%2Fodo%2F.odo_cmd_run.pid+%7C%7C+true&container=tools&stderr=true&stdout=true": dial tcp: lookup c100-e.eu-de.containers.cloud.ibm.com: operation was canceled. for command '[/bin/sh -c cat /opt/odo/.odo_cmd_run.pid || true]'
[...]

  [FAILED] Expected
      <[]string | len:1, cap:1>: ["m2-kvvtbv-app"]
  to be empty
  In [It] at: /go/odo_1/tests/e2escenarios/e2e_test.go:264 @ 04/21/23 14:10:09.351
------------------------------

Summarizing 1 Failure:
  [FAIL] E2E Test starting with non-empty Directory [It] should verify developer workflow from non-empty Directory
  /go/odo_1/tests/e2escenarios/e2e_test.go:264

Ran 4 of 4 Specs in 451.506 seconds
FAIL! -- 3 Passed | 1 Failed | 0 Pending | 0 Skipped

Network issue in E2E tests.
Overriding because all integration tests passed and because the Devfiles changed in this PR are not used in E2E tests.

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

@openshift-ci
Copy link

openshift-ci bot commented Apr 24, 2023

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

In response to this:

[...]

Ran 452 of 824 Specs in 2110.872 seconds
SUCCESS! -- 452 Passed | 0 Failed | 0 Pending | 372 Skipped

Ginkgo ran 1 suite in 36m16.200276075s
Test Suite Passed

[...]

 [odo] I0421 14:09:07.330501   20288 exec.go:49] ExecuteCommand returned an an err: error while streaming command: error sending request: Post "https://c100-e.eu-de.containers.cloud.ibm.com:31988/api/v1/namespaces/e2e-test197ilv/pods/kvvtbv-app-5786ddc7bd-ftx2h/exec?command=%2Fbin%2Fsh&command=-c&command=cat+%2Fopt%2Fodo%2F.odo_cmd_run.pid+%7C%7C+true&container=tools&stderr=true&stdout=true": dial tcp: lookup c100-e.eu-de.containers.cloud.ibm.com: operation was canceled. for command '[/bin/sh -c cat /opt/odo/.odo_cmd_run.pid || true]'
[...]

 [FAILED] Expected
     <[]string | len:1, cap:1>: ["m2-kvvtbv-app"]
 to be empty
 In [It] at: /go/odo_1/tests/e2escenarios/e2e_test.go:264 @ 04/21/23 14:10:09.351
------------------------------

Summarizing 1 Failure:
 [FAIL] E2E Test starting with non-empty Directory [It] should verify developer workflow from non-empty Directory
 /go/odo_1/tests/e2escenarios/e2e_test.go:264

Ran 4 of 4 Specs in 451.506 seconds
FAIL! -- 3 Passed | 1 Failed | 0 Pending | 0 Skipped

Network issue in E2E tests.
Overriding because all integration tests passed and because the Devfiles changed in this PR are not used in E2E tests.

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

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-ci openshift-ci bot merged commit f62a433 into redhat-developer:main Apr 24, 2023
@rm3l rm3l added this to the v3.10.0 🚀 milestone May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/testing Issues or PRs related to testing, Quality Assurance or Quality Engineering 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.

2 participants