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

refactor (jkube-kit-generator-webapp): Migrate all tests from JUnit4 to JUnit5 (#1563) #1691

Merged
merged 4 commits into from Oct 3, 2022

Conversation

anurag-rajawat
Copy link
Contributor

Description

Fixes #1563

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change
  • Chore (non-breaking change which doesn't affect codebase;
    test, version modification, documentation, etc.)

Checklist

  • I have read the contributing guidelines
  • I signed-off my commit with a user that has signed the Eclipse Contributor Agreement
  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I Added CHANGELOG entry
  • I have updated the documentation accordingly
  • No new bugs, code smells, etc. in SonarCloud report
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I tested my code in Kubernetes
  • I tested my code in OpenShift

@manusa
Copy link
Member

manusa commented Aug 3, 2022

Eclipse JKube CI Report

Started new GH workflow run for #1691 (2022-10-03T13:01:17Z)

⚙️ JKube E2E Tests (3174210213)

Test results

✔️ Test reports (Minikube v1.12.0-dockerfile)
[✓] DockerFileITCase - k8sBuild - k8s:build, should create image inferring contextDir from provided dockerFile configuration
[✓] ContextDirITCase - k8sBuild - k8s:build, should create image with docker file and files read from provided contextDir configuration
[✓] ContextDirAndDockerFileITCase - k8sBuild - k8s:build, should create image for configured special dockerFile with files added from provided contextDir
[✓] ContextDirAndCustomAssemblyITCase - k8sBuild - k8s:build, should create image with docker file and files read from provided contextDir configuration (within Dockerfile, files are read from configured Assembly properties)
[✓] SimpleK8sITCase - k8sBuild - k8s:build, should create image
[✓] SimpleK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] SimpleK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] SimpleK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] All tests (8) passed successfully!!!

✔️ Test reports (Minikube v1.12.0-other)
[✓] VertxK8sITCase - k8sBuild - k8s:build, should create image
[✓] ThorntailK8sITCase - k8sBuild - k8s:build, should create image
[✓] KarafK8sITCase - k8sBuild - k8s:build, should create image
[✓] OpenLibertyK8sITCase - k8sBuild - k8s:build, should create image
[✓] WildflyJarK8sITCase - k8sBuild - k8s:build, should create image
[✓] VertxK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] KarafK8sITCase - k8sResource - k8s:resource, should create manifest for Kubernetes
[✓] ThorntailK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] OpenLibertyK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] WildflyJarK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] VertxK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] VertxK8sITCase - k8sLog - k8s:log, should retrieve log
[✓] KarafK8sITCase - K8sApply - k8s:apply, should apply manifests on k8s cluster
[✓] VertxK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] KarafK8sITCase - k8sLog - k8s:log
[✓] ThorntailK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] KarafK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] ThorntailK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] OpenLibertyK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] DslK8sGradleITCase - k8sBuild - k8sBuild, should create image
[✓] OpenLibertyK8sITCase - k8sLog - k8s:log, should retrieve log
[✓] DslK8sGradleITCase - k8sResource - k8sResource, should create manifests
[✓] DslK8sGradleITCase - k8sHelm - k8sHelm, should create Helm charts
[✓] OpenLibertyK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] WildflyJarK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] DslK8sGradleITCase - k8sApply - k8sApply, should deploy pod and service
[✓] DslK8sGradleITCase - k8sLog - k8sLog, should retrieve log
[✓] DslK8sGradleITCase - k8sUndeploy - k8sUndeploy, should delete all applied resources
[✓] WildflyJarK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] All tests (29) passed successfully!!!

✔️ Test reports (Minikube v1.12.0-quarkus)
[✓] QuarkusK8sITCase - k8sBuild - k8s:build, should create image
[✓] QuarkusK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] QuarkusK8sITCase - k8sHelm - k8s:helm, should create Helm charts
[✓] QuarkusK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] QuarkusK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] All tests (5) passed successfully!!!

✔️ Test reports (Minikube v1.12.0-quarkus-native)
[✓] QuarkusNativeK8sITCase - k8sBuild - k8s:build, should create image
[✓] QuarkusNativeK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] QuarkusNativeK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] QuarkusNativeK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] All tests (4) passed successfully!!!

✔️ Test reports (Minikube v1.12.0-springboot)
[✓] HelmConfigITCase - k8sResource - k8s:resource, no specified profile, should create default resource manifests
[✓] MultiProfileITCase - k8sResourceProductionProfile - k8s:resource, production profile, should create production resource manifests
[✓] HelmConfigITCase - k8sHelm - k8s:helm, should create Helm charts
[✓] ZeroConfigK8sITCase - k8sBuild - k8s:build, should create image
[✓] CompleteK8sITCase - k8sBuild - k8s:build, should create image
[✓] MultiProfileITCase - k8sResource - k8s:resource, no specified profile, should create default resource manifests
[✓] CompleteDockerITCase - k8sBuild - k8s:build, should create image and assembly files
[✓] CompleteK8sJibITCase - k8sBuild - k8s:build, should create JIB image
[✓] CompleteK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] ZeroConfigK8sITCase - k8sPush - k8s:push, should push image to remote registry
[✓] CompleteK8sJibITCase - k8sResource - k8s:resource, should create manifests
[✓] CompleteDockerITCase - k8sResource - k8s:resource, should create manifests in specific directory
[✓] CompleteK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] ZeroConfigK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] CompleteK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] ZeroConfigK8sITCase - k8sHelm - k8s:helm, should create Helm charts
[✓] CompleteK8sJibITCase - k8sPush - k8s:push, should push image to remote registry
[✓] CompleteDockerITCase - k8sApply - k8s:apply, should deploy pod and service form manifests in specific directory
[✓] CompleteDockerITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] ZeroConfigK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] ZeroConfigK8sITCase - k8sLog - k8s:log, should retrieve log
[✓] ZeroConfigK8sGradleITCase - k8sBuild - k8sBuild, should create image
[✓] ZeroConfigK8sGradleITCase - k8sResource - k8sResource, should create manifests
[✓] CompleteK8sJibITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] ZeroConfigK8sGradleITCase - k8sHelm - k8sHelm, should create Helm charts
[✓] ZeroConfigK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] CompleteK8sJibITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] ZeroConfigK8sGradleITCase - k8sPush - k8sPush, should push image to remote registry
[✓] ZeroConfigK8sGradleITCase - k8sApply - k8sApply, should deploy pod and service
[✓] ZeroConfigK8sGradleITCase - k8sLog - k8sLog, should retrieve log
[✓] ZeroConfigK8sGradleITCase - k8sUndeploy - k8sUndeploy, should delete all applied resources
[✓] All tests (31) passed successfully!!!

✔️ Test reports (Minikube v1.12.0-webapp)
[✓] JettyK8sITCase - k8sBuild - k8s:build, should create image
[✓] ZeroConfigK8sITCase - k8sBuild - k8s:build, should create image
[✓] JettyK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] WildFlyK8sITCase - k8sBuild - k8s:build, should create image
[✓] ZeroConfigK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] WildFlyK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] JettyK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] JettyK8sITCase - k8sLog - k8s:log, should retrieve log
[✓] ZeroConfigK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] JettyK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] ZeroConfigK8sITCase - k8sLog - k8s:log, should retrieve log
[✓] ZeroConfigK8sITCase - testNodePortResponse - Service as NodePort response should return String
[✓] ZeroConfigK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] WildFlyK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] WildFlyK8sITCase - k8sLog - k8s:log, should retrieve log
[✓] WildFlyK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] All tests (16) passed successfully!!!

✔️ Test reports (Minikube v1.24.0-dockerfile)
[✓] DockerFileITCase - k8sBuild - k8s:build, should create image inferring contextDir from provided dockerFile configuration
[✓] ContextDirAndDockerFileITCase - k8sBuild - k8s:build, should create image for configured special dockerFile with files added from provided contextDir
[✓] ContextDirAndCustomAssemblyITCase - k8sBuild - k8s:build, should create image with docker file and files read from provided contextDir configuration (within Dockerfile, files are read from configured Assembly properties)
[✓] ContextDirITCase - k8sBuild - k8s:build, should create image with docker file and files read from provided contextDir configuration
[✓] SimpleK8sITCase - k8sBuild - k8s:build, should create image
[✓] SimpleK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] SimpleK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] SimpleK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] All tests (8) passed successfully!!!

✔️ Test reports (Minikube v1.24.0-other)
[✓] VertxK8sITCase - k8sBuild - k8s:build, should create image
[✓] KarafK8sITCase - k8sBuild - k8s:build, should create image
[✓] ThorntailK8sITCase - k8sBuild - k8s:build, should create image
[✓] OpenLibertyK8sITCase - k8sBuild - k8s:build, should create image
[✓] WildflyJarK8sITCase - k8sBuild - k8s:build, should create image
[✓] VertxK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] KarafK8sITCase - k8sResource - k8s:resource, should create manifest for Kubernetes
[✓] ThorntailK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] WildflyJarK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] OpenLibertyK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] VertxK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] VertxK8sITCase - k8sLog - k8s:log, should retrieve log
[✓] KarafK8sITCase - K8sApply - k8s:apply, should apply manifests on k8s cluster
[✓] VertxK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] KarafK8sITCase - k8sLog - k8s:log
[✓] ThorntailK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] KarafK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] ThorntailK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] WildflyJarK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] WildflyJarK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] DslK8sGradleITCase - k8sBuild - k8sBuild, should create image
[✓] DslK8sGradleITCase - k8sResource - k8sResource, should create manifests
[✓] DslK8sGradleITCase - k8sHelm - k8sHelm, should create Helm charts
[✓] OpenLibertyK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] DslK8sGradleITCase - k8sApply - k8sApply, should deploy pod and service
[✓] DslK8sGradleITCase - k8sLog - k8sLog, should retrieve log
[✓] DslK8sGradleITCase - k8sUndeploy - k8sUndeploy, should delete all applied resources
[✓] OpenLibertyK8sITCase - k8sLog - k8s:log, should retrieve log
[✓] OpenLibertyK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] All tests (29) passed successfully!!!

✔️ Test reports (Minikube v1.24.0-quarkus)
[✓] QuarkusK8sITCase - k8sBuild - k8s:build, should create image
[✓] QuarkusK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] QuarkusK8sITCase - k8sHelm - k8s:helm, should create Helm charts
[✓] QuarkusK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] QuarkusK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] All tests (5) passed successfully!!!

✔️ Test reports (Minikube v1.24.0-quarkus-native)
[✓] QuarkusNativeK8sITCase - k8sBuild - k8s:build, should create image
[✓] QuarkusNativeK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] QuarkusNativeK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] QuarkusNativeK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] All tests (4) passed successfully!!!

✔️ Test reports (Minikube v1.24.0-springboot)
[✓] HelmConfigITCase - k8sResource - k8s:resource, no specified profile, should create default resource manifests
[✓] MultiProfileITCase - k8sResourceProductionProfile - k8s:resource, production profile, should create production resource manifests
[✓] CustomResourceK8sITCase - k8sBuild - k8s:build, should create image
[✓] HelmConfigITCase - k8sHelm - k8s:helm, should create Helm charts
[✓] ZeroConfigK8sITCase - k8sBuild - k8s:build, should create image
[✓] CompleteK8sITCase - k8sBuild - k8s:build, should create image
[✓] MultiProfileITCase - k8sResource - k8s:resource, no specified profile, should create default resource manifests
[✓] CompleteK8sJibITCase - k8sBuild - k8s:build, should create JIB image
[✓] CompleteK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] CompleteK8sJibITCase - k8sResource - k8s:resource, should create manifests
[✓] CompleteK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] CustomResourceK8sITCase - k8sPush - k8s:push, should push image to remote registry
[✓] ZeroConfigK8sITCase - k8sPush - k8s:push, should push image to remote registry
[✓] CompleteK8sJibITCase - k8sPush - k8s:push, should push image to remote registry
[✓] CustomResourceK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] CompleteK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] ZeroConfigK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] CompleteDockerITCase - k8sBuild - k8s:build, should create image and assembly files
[✓] ZeroConfigK8sITCase - k8sHelm - k8s:helm, should create Helm charts
[✓] CompleteK8sJibITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] CompleteDockerITCase - k8sResource - k8s:resource, should create manifests in specific directory
[✓] CompleteK8sJibITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] CustomResourceK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] CustomResourceK8sITCase - k8sLog - k8s:log, should retrieve log
[✓] ZeroConfigK8sGradleITCase - k8sBuild - k8sBuild, should create image
[✓] ZeroConfigK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] ZeroConfigK8sGradleITCase - k8sResource - k8sResource, should create manifests
[✓] CustomResourceK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] ZeroConfigK8sGradleITCase - k8sHelm - k8sHelm, should create Helm charts
[✓] ZeroConfigK8sITCase - k8sLog - k8s:log, should retrieve log
[✓] CompleteDockerITCase - k8sApply - k8s:apply, should deploy pod and service form manifests in specific directory
[✓] ZeroConfigK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] CompleteDockerITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] ZeroConfigK8sGradleITCase - k8sPush - k8sPush, should push image to remote registry
[✓] ZeroConfigK8sGradleITCase - k8sApply - k8sApply, should deploy pod and service
[✓] ZeroConfigK8sGradleITCase - k8sLog - k8sLog, should retrieve log
[✓] ZeroConfigK8sGradleITCase - k8sUndeploy - k8sUndeploy, should delete all applied resources
[✓] All tests (37) passed successfully!!!

✔️ Test reports (Minikube v1.24.0-webapp)
[✓] ZeroConfigK8sITCase - k8sBuild - k8s:build, should create image
[✓] JettyK8sITCase - k8sBuild - k8s:build, should create image
[✓] WildFlyK8sITCase - k8sBuild - k8s:build, should create image
[✓] JettyK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] ZeroConfigK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] WildFlyK8sITCase - k8sResource - k8s:resource, should create manifests
[✓] JettyK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] JettyK8sITCase - k8sLog - k8s:log, should retrieve log
[✓] ZeroConfigK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] JettyK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] ZeroConfigK8sITCase - k8sLog - k8s:log, should retrieve log
[✓] ZeroConfigK8sITCase - testNodePortResponse - Service as NodePort response should return String
[✓] ZeroConfigK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] WildFlyK8sITCase - k8sApply - k8s:apply, should deploy pod and service
[✓] WildFlyK8sITCase - k8sLog - k8s:log, should retrieve log
[✓] WildFlyK8sITCase - k8sUndeploy - k8s:undeploy, should delete all applied resources
[✓] All tests (16) passed successfully!!!

✔️ Test reports (OpenShift v3.11.0-other)
[✓] KarafOcITCase - ocBuild - oc:build, should create image
[✓] WildflyJarOcITCase - ocBuild - oc:build, should create image
[✓] KarafOcITCase - ocResource - oc:resource, should create resource manifests
[✓] WildflyJarOcITCase - ocResource - oc:resource, should create manifests
[✓] OpenLibertyOcITCase - ocBuild - oc:build, should create image
[✓] OpenLibertyOcITCase - ocResource - oc:resource, should create manifests
[✓] VertxOcITCase - ocBuild - oc:build, should create image
[✓] VertxOcITCase - ocResource - oc:resource, should create manifests
[✓] ThorntailOcITCase - ocBuild - oc:build, should create image
[✓] ThorntailOcITCase - ocResource - oc:resource, should create manifests
[✓] DslOcGradleITCase - ocBuild - ocBuild, should create image
[✓] DslOcGradleITCase - ocResource - ocResource, should create manifests
[✓] KarafOcITCase - ocApply - oc:apply, should create pod, service and route
[✓] KarafOcITCase - ocLog - oc:log, should retrieve log
[✓] KarafOcITCase - ocUndeploy - oc:undeploy, should delete all applied resources
[✓] WildflyJarOcITCase - ocApply - oc:apply, should deploy pod and service
[✓] WildflyJarOcITCase - ocUndeploy - oc:undeploy, should delete all applied resources
[✓] OpenLibertyOcITCase - ocApply - oc:apply, should deploy pod and service
[✓] OpenLibertyOcITCase - ocLog - oc:log, should retrieve log
[✓] VertxOcITCase - ocApply - oc:apply, should deploy pod and service
[✓] OpenLibertyOcITCase - ocUndeploy - oc:undeploy, should delete all applied resources
[✓] VertxOcITCase - k8sLog - oc:log, should retrieve log
[✓] VertxOcITCase - ocUndeploy - oc:undeploy, should delete all applied resources
[✓] ThorntailOcITCase - ocApply - oc:apply, should deploy pod and service
[✓] ThorntailOcITCase - ocUndeploy - oc:undeploy, should delete all applied resources
[✓] DslOcGradleITCase - ocApply - ocApply, should deploy pod and service
[✓] DslOcGradleITCase - ocHelm - ocHelm, should create Helm charts
[✓] DslOcGradleITCase - ocLog - ocLog, should retrieve log
[✓] DslOcGradleITCase - ocUndeploy - ocUndeploy, should delete all applied resources
[✓] All tests (29) passed successfully!!!

✔️ Test reports (OpenShift v3.11.0-quarkus)
[✓] QuarkusOcITCase - ocBuild - oc:build, should create image
[✓] QuarkusOcITCase - ocResource - oc:resource, should create manifests
[✓] QuarkusOcITCase - ocHelm - oc:helm, should create Helm charts
[✓] QuarkusOcITCase - ocApply - oc:apply, should deploy pod and service
[✓] QuarkusOcITCase - ocUndeploy - oc:undeploy, should delete all applied resources
[✓] All tests (5) passed successfully!!!

✔️ Test reports (OpenShift v3.11.0-springboot)
[✓] HelmConfigITCase - ocResource - oc:resource, no specified profile, should create default resource manifests
[✓] MultiProfileITCase - ocResourceProductionProfile - oc:resource, production profile, should create production resource manifests
[✓] HelmConfigITCase - ocHelm - oc:helm, should create Helm charts
[✓] MultiProfileITCase - ocResource - oc:resource, no specified default profile, should create default resource manifests
[✓] ZeroConfigOcITCase - ocBuild - oc:build, should create image
[✓] ZeroConfigOcITCase - ocResource - oc:resource, should create manifests
[✓] ZeroConfigOcITCase - ocApply - oc:apply, should deploy pod and service
[✓] ZeroConfigOcITCase - ocHelm - oc:helm, should create Helm charts
[✓] ZeroConfigOcGradleITCase - ocBuild - ocBuild, should create image
[✓] ZeroConfigOcITCase - ocLog - oc:log, should retrieve log
[✓] ZeroConfigOcGradleITCase - ocResource - ocResource, should create manifests
[✓] ZeroConfigOcITCase - ocUndeploy - oc:undeploy, should delete all applied resources
[✓] ZeroConfigOcGradleITCase - ocApply - ocApply, should deploy pod and service
[✓] ZeroConfigOcGradleITCase - ocHelm - ocHelm, should create Helm charts
[✓] ZeroConfigOcGradleITCase - ocLog - ocLog, should retrieve log
[✓] ZeroConfigOcGradleITCase - ocUndeploy - ocUndeploy, should delete all applied resources
[✓] All tests (16) passed successfully!!!

✔️ Test reports (OpenShift v3.11.0-webapp)
[✓] JettyOcITCase - ocBuild - oc:build, should create image
[✓] JettyOcITCase - ocResource - oc:resource, should create manifests
[✓] ZeroConfigOcITCase - ocBuild - oc:build, should create image
[✓] ZeroConfigOcITCase - ocResource - oc:resource, should create manifests
[✓] JettyOcITCase - ocApply - oc:apply, should deploy pod and service
[✓] JettyOcITCase - ocLog - oc:log, should retrieve log
[✓] JettyOcITCase - ocUndeploy - oc:undeploy, should delete all applied resources
[✓] ZeroConfigOcITCase - ocApply - oc:apply, should deploy pod and service
[✓] ZeroConfigOcITCase - testNodePortResponse - Service as NodePort response should return String
[✓] WildFlyOcDockerModeITCase - ocBuild - oc:build, should create image using docker
[✓] ZeroConfigOcITCase - ocLog - oc:log, should retrieve log
[✓] WildFlyOcDockerModeITCase - ocResource - k8s:resource, should create manifests
[✓] ZeroConfigOcITCase - ocUndeploy - oc:undeploy, should delete all applied resources
[✓] WildFlyOcDockerModeITCase - ocApply - oc:apply, should deploy pod and service
[✓] WildFlyOcDockerModeITCase - ocLog - oc:log, should retrieve logs
[✓] WildFlyOcDockerModeITCase - ocUndeploy - oc:undeploy, should delete all applied resources
[✓] WildFlyOcITCase - ocBuild - oc:build, should create image
[✓] WildFlyOcITCase - ocResource - oc:resource, should create manifests
[✓] WildFlyOcITCase - ocApply - oc:apply, should deploy pod and service
[✓] WildFlyOcITCase - ocLog - oc:log, should retrieve logs
[✓] WildFlyOcITCase - ocUndeploy - oc:undeploy, should delete all applied resources
[✓] All tests (21) passed successfully!!!

✔️ Test reports (OpenShift v3.9.0-other)
[✓] KarafOcITCase - ocBuild - oc:build, should create image
[✓] WildflyJarOcITCase - ocBuild - oc:build, should create image
[✓] KarafOcITCase - ocResource - oc:resource, should create resource manifests
[✓] WildflyJarOcITCase - ocResource - oc:resource, should create manifests
[✓] OpenLibertyOcITCase - ocBuild - oc:build, should create image
[✓] OpenLibertyOcITCase - ocResource - oc:resource, should create manifests
[✓] VertxOcITCase - ocBuild - oc:build, should create image
[✓] VertxOcITCase - ocResource - oc:resource, should create manifests
[✓] ThorntailOcITCase - ocBuild - oc:build, should create image
[✓] ThorntailOcITCase - ocResource - oc:resource, should create manifests
[✓] DslOcGradleITCase - ocBuild - ocBuild, should create image
[✓] DslOcGradleITCase - ocResource - ocResource, should create manifests
[✓] KarafOcITCase - ocApply - oc:apply, should create pod, service and route
[✓] KarafOcITCase - ocLog - oc:log, should retrieve log
[✓] KarafOcITCase - ocUndeploy - oc:undeploy, should delete all applied resources
[✓] WildflyJarOcITCase - ocApply - oc:apply, should deploy pod and service
[✓] WildflyJarOcITCase - ocUndeploy - oc:undeploy, should delete all applied resources
[✓] OpenLibertyOcITCase - ocApply - oc:apply, should deploy pod and service
[✓] OpenLibertyOcITCase - ocLog - oc:log, should retrieve log
[✓] VertxOcITCase - ocApply - oc:apply, should deploy pod and service
[✓] OpenLibertyOcITCase - ocUndeploy - oc:undeploy, should delete all applied resources
[✓] VertxOcITCase - k8sLog - oc:log, should retrieve log
[✓] VertxOcITCase - ocUndeploy - oc:undeploy, should delete all applied resources
[✓] ThorntailOcITCase - ocApply - oc:apply, should deploy pod and service
[✓] DslOcGradleITCase - ocApply - ocApply, should deploy pod and service
[✓] DslOcGradleITCase - ocHelm - ocHelm, should create Helm charts
[✓] DslOcGradleITCase - ocLog - ocLog, should retrieve log
[✓] DslOcGradleITCase - ocUndeploy - ocUndeploy, should delete all applied resources
[✓] ThorntailOcITCase - ocUndeploy - oc:undeploy, should delete all applied resources
[✓] All tests (29) passed successfully!!!

✔️ Test reports (OpenShift v3.9.0-quarkus)
[✓] QuarkusOcITCase - ocBuild - oc:build, should create image
[✓] QuarkusOcITCase - ocResource - oc:resource, should create manifests
[✓] QuarkusOcITCase - ocHelm - oc:helm, should create Helm charts
[✓] QuarkusOcITCase - ocApply - oc:apply, should deploy pod and service
[✓] QuarkusOcITCase - ocUndeploy - oc:undeploy, should delete all applied resources
[✓] All tests (5) passed successfully!!!

✔️ Test reports (OpenShift v3.9.0-springboot)
[✓] HelmConfigITCase - ocResource - oc:resource, no specified profile, should create default resource manifests
[✓] MultiProfileITCase - ocResourceProductionProfile - oc:resource, production profile, should create production resource manifests
[✓] HelmConfigITCase - ocHelm - oc:helm, should create Helm charts
[✓] MultiProfileITCase - ocResource - oc:resource, no specified default profile, should create default resource manifests
[✓] ZeroConfigOcITCase - ocBuild - oc:build, should create image
[✓] ZeroConfigOcITCase - ocResource - oc:resource, should create manifests
[✓] ZeroConfigOcITCase - ocApply - oc:apply, should deploy pod and service
[✓] ZeroConfigOcITCase - ocHelm - oc:helm, should create Helm charts
[✓] ZeroConfigOcGradleITCase - ocBuild - ocBuild, should create image
[✓] ZeroConfigOcITCase - ocLog - oc:log, should retrieve log
[✓] ZeroConfigOcGradleITCase - ocResource - ocResource, should create manifests
[✓] ZeroConfigOcITCase - ocUndeploy - oc:undeploy, should delete all applied resources
[✓] ZeroConfigOcGradleITCase - ocApply - ocApply, should deploy pod and service
[✓] ZeroConfigOcGradleITCase - ocHelm - ocHelm, should create Helm charts
[✓] ZeroConfigOcGradleITCase - ocLog - ocLog, should retrieve log
[✓] ZeroConfigOcGradleITCase - ocUndeploy - ocUndeploy, should delete all applied resources
[✓] All tests (16) passed successfully!!!

✔️ Test reports (OpenShift v3.9.0-webapp)
[✓] JettyOcITCase - ocBuild - oc:build, should create image
[✓] JettyOcITCase - ocResource - oc:resource, should create manifests
[✓] ZeroConfigOcITCase - ocBuild - oc:build, should create image
[✓] JettyOcITCase - ocApply - oc:apply, should deploy pod and service
[✓] ZeroConfigOcITCase - ocResource - oc:resource, should create manifests
[✓] JettyOcITCase - ocLog - oc:log, should retrieve log
[✓] JettyOcITCase - ocUndeploy - oc:undeploy, should delete all applied resources
[✓] ZeroConfigOcITCase - ocApply - oc:apply, should deploy pod and service
[✓] ZeroConfigOcITCase - testNodePortResponse - Service as NodePort response should return String
[✓] WildFlyOcDockerModeITCase - ocBuild - oc:build, should create image using docker
[✓] ZeroConfigOcITCase - ocLog - oc:log, should retrieve log
[✓] WildFlyOcDockerModeITCase - ocResource - k8s:resource, should create manifests
[✓] ZeroConfigOcITCase - ocUndeploy - oc:undeploy, should delete all applied resources
[✓] WildFlyOcDockerModeITCase - ocApply - oc:apply, should deploy pod and service
[✓] WildFlyOcDockerModeITCase - ocLog - oc:log, should retrieve logs
[✓] WildFlyOcDockerModeITCase - ocUndeploy - oc:undeploy, should delete all applied resources
[✓] WildFlyOcITCase - ocBuild - oc:build, should create image
[✓] WildFlyOcITCase - ocResource - oc:resource, should create manifests
[✓] WildFlyOcITCase - ocApply - oc:apply, should deploy pod and service
[✓] WildFlyOcITCase - ocLog - oc:log, should retrieve logs
[✓] WildFlyOcITCase - ocUndeploy - oc:undeploy, should delete all applied resources
[✓] All tests (21) passed successfully!!!

✔️ Test reports (Windows)
[✓] WindowsITCase - k8sBuild - k8s:build, should create image
[✓] WindowsITCase - k8sPush - k8s:push, should push image to remote registry
[✓] WindowsITCase - k8sResource - k8s:resource, should create manifests
[✓] WindowsITCase - ocResource - oc:resource, should create manifests
[✓] WindowsITCase - k8sHelm - k8s:helm, should create Helm charts
[✓] WindowsITCase - ocHelm - oc:helm, should create Helm charts
[✓] All tests (6) passed successfully!!!

@codecov
Copy link

codecov bot commented Aug 3, 2022

Codecov Report

Merging #1691 (eaacf11) into master (dcb3f8b) will decrease coverage by 0.02%.
The diff coverage is n/a.

❗ Current head eaacf11 differs from pull request most recent head 02867c5. Consider uploading reports for the commit 02867c5 to get more accurate results

@@             Coverage Diff              @@
##             master    #1691      +/-   ##
============================================
- Coverage     52.95%   52.92%   -0.03%     
+ Complexity     3937     3936       -1     
============================================
  Files           464      464              
  Lines         20745    20752       +7     
  Branches       2809     2817       +8     
============================================
- Hits          10985    10983       -2     
- Misses         8637     8646       +9     
  Partials       1123     1123              
Impacted Files Coverage Δ
.../generator/api/support/AbstractPortsExtractor.java 86.36% <0.00%> (-4.55%) ⬇️
...eclipse/jkube/kit/config/service/ApplyService.java 22.95% <0.00%> (-0.08%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@manusa manusa left a comment

Choose a reason for hiding this comment

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

Except for the nio Files recommendations, everything looks great.

Copy link
Member

@manusa manusa left a comment

Choose a reason for hiding this comment

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

Please, use the recommended approach.

assertTrue(new File(appDir, "META-INF/").mkdirs());
assertTrue(new File(appDir, "WEB-INF/").mkdirs());
assertTrue(new File(appDir, descriptor).createNewFile());
Path webInf = Files.createDirectories(folder.resolve("webapp" + i).resolve(appDir));
Copy link
Member

Choose a reason for hiding this comment

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

This path is not resolving to webapp$i/META-INF/WEB-INF
Considering L139(L138), we need to keep the other appDir variable too.

#1691 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

On (master branch) debugging this, I found out that on each iteration it is creating a directory webapp$i and inside it creates two different directories META-INF and WEB-INF, not nested as you said webapp$i/META-INF/WEB-INF
After resolving these different directories it resolves descriptor accordingly.

If I do like #1691 (comment) then it gives

java.nio.file.NoSuchFileException: /tmp/junit3247740821297201882/webapp0/META-INF/WEB-INF/WEB-INF/jboss-deployment-structure.xml

because jboss-deployment-structure.xml file needs to be resolved in webapp0/WEB-INF directory instead of webapp0/META-INF/WEB-INF/WEB-INF directory (nested WEB-INF)

and the path resolved in webapp$i/META-INF/WEB-INF after that, it resolved the $descriptor which contains an absolute path to the file, resulting in nested directories. And that causes the exception.

but on doing like

String appDir = descriptor.split("/")[0];
String file = descriptor.split("/")[1];

Path webInf = Files.createDirectories(folder.resolve("webapp" + i).resolve(appDir));
Files.createFile(webInf.resolve(file));

it works because here we create a directory webapp$i and inside it a $appDir directory and inside $appDir a $file file, the $appDir and $file we get from the $descriptor because it contains the absolute path to the $file

Copy link
Member

Choose a reason for hiding this comment

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

The #1691 (comment) code suggestion is wrong.
For some reason I assumed the directories were nested (probably too many iterations over the same issue).
The test should be migrated to keep the previous behavior but using the nio Files utils instead.

final File artifactFile = new File(buildDirectory, "artifact.war");
assertTrue(artifactFile.createNewFile());
assertThat(artifactFile.createNewFile()).isTrue();
Copy link
Member

Choose a reason for hiding this comment

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

Please use nio Files. I'm not sure if you're having trouble with this, or I'm not explaining correctly why we should do so.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry I missed this 😔
Let me be clear should I do something like this?

Files.createFile(buildDirectory.toPath().resolve("artifact.war"));

final File artifactFile = new File(buildDirectory, "artifact.war");
assertTrue(artifactFile.createNewFile());
assertThat(artifactFile.createNewFile()).isTrue();
Copy link
Member

Choose a reason for hiding this comment

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

nio Files

final File artifactFile = new File(buildDirectory, "artifact.war");
assertTrue(artifactFile.createNewFile());
assertThat(artifactFile.createNewFile()).isTrue();
Copy link
Member

Choose a reason for hiding this comment

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

nio Files

Copy link
Member

@manusa manusa left a comment

Choose a reason for hiding this comment

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

I assume you were waiting on my feedback to proceed.
Please, if you're blocked by me at some point, make sure to ping me, especially if it's about quick questions.

@anurag-rajawat
Copy link
Contributor Author

@manusa please review this PR

@anurag-rajawat
Copy link
Contributor Author

@rohanKanojia when I rename WildFlyAppSeverHandlerTest test class to WildFlyAppServerHandlerTest, git shows it was deleted and a new one created but works fine for JettyAppSeverHandlerTest and TomcatAppSeverHandlerTest , why?

Also git mv ... is not working.

@anurag-rajawat anurag-rajawat marked this pull request as ready for review September 16, 2022 05:52
@rohanKanojia
Copy link
Member

Umm, I tried renaming it using IntelliJ, seems to work fine for me:

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
	renamed:    jkube-kit/generator/webapp/src/test/java/org/eclipse/jkube/generator/webapp/handler/WildFlyAppSeverHandlerTest.java -> jkube-kit/generator/webapp/src/test/java/org/eclipse/jkube/generator/webapp/handler/WildFlyAppServerHandlerTest.java

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	modified:   jkube-kit/generator/webapp/src/test/java/org/eclipse/jkube/generator/webapp/handler/WildFlyAppServerHandlerTest.java

@anurag-rajawat
Copy link
Contributor Author

anurag-rajawat commented Sep 16, 2022

Now in changed files on github, it is deleted and a new one created, why?

@rohanKanojia
Copy link
Member

I'm sorry I'm not able to understand.

I don't see any deleted file in eaacf11

@rohanKanojia
Copy link
Member

I think there is some problem in GitHub interface. If you see your commit via git show -1, your changes are displayed correctly

@anurag-rajawat
Copy link
Contributor Author

Yes, it displayed the correct changes.
Thank you!

@@ -121,28 +122,28 @@ public void testDefaultServer() throws IOException {
.build()).build();

AppServerHandler appServerHandler = new AppServerDetector(generatorContext).detect(null);
assertEquals("tomcat", appServerHandler.getName());
assertThat(appServerHandler.getName()).isEqualTo("tomcat");
}

private void assertAppServerDescriptorApplicability(Object[] descriptors) throws IOException {
Copy link
Member

Choose a reason for hiding this comment

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

Maybe this method needs some more explanation (in a comment?). I read it several times but still don't know what it is doing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here we are checking that if the app server is null or not specified, we should get the default server, which is tomcat.

Maybe this method name will explain what it is doing.

detect_withNullServer_shouldReturnTomcatAsDefaultServer()

Copy link
Member

Choose a reason for hiding this comment

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

I was refering to assertAppServerDescriptorApplicability

Copy link
Member

Choose a reason for hiding this comment

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

OK I understand now ... what is confusing is that we are building the tuples (parameter/expectation) that are then extracted to be asserted ... Is it possible to make it simpler to implement and read.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried to make it simple like this

private void assertAppServerDescriptorApplicability(String appDir, String file, boolean expected) throws IOException {
        Random random = new Random();
        int i = random.nextInt(1000);

        Path webInf = Files.createDirectories(folder.resolve("webapp" + i).resolve(appDir));
        Files.createFile(webInf.resolve(file));

        GeneratorContext generatorContext = GeneratorContext.builder().project(JavaProject.builder()
                .buildDirectory(webInf.toFile())
                .plugins(Collections.emptyList())
                .build()).build();

        boolean result = new AppServerDetector(generatorContext).detect(null).isApplicable();
        assertThat(result).isEqualTo(expected);
}

but due to this statement
https://github.com/eclipse/jkube/blob/40ce95a6366986bd005b51420a799f09b5e075f8/jkube-kit/generator/webapp/src/test/java/org/eclipse/jkube/generator/webapp/AppServerAutoDetectionTest.java#L132

we need a random integer or we can change signature of assertAppServerDescriptorApplicability method to accept an additional argument.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can simplify assertAppServerDescriptorApplicability method like this

private void assertAppServerDescriptorApplicability(String appDir, String file, boolean expected) throws IOException {
    File webInf = Files.createDirectories(folder.resolve("webapp").resolve(appDir)).toFile();
    Files.createFile(webInf.toPath().resolve(file));
    try {
      GeneratorContext generatorContext = GeneratorContext.builder().project(JavaProject.builder()
          .buildDirectory(webInf)
          .plugins(Collections.emptyList())
          .build()).build();

      boolean result = new AppServerDetector(generatorContext).detect(null).isApplicable();
      assertThat(result).isEqualTo(expected);
    } finally {
      FileUtils.deleteDirectory(webInf);
    }
  }

will this work?

Copy link
Member

Choose a reason for hiding this comment

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

yes it is better

Copy link
Member

@sunix sunix Sep 27, 2022

Choose a reason for hiding this comment

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

then, If it has to be in another PR it works for me. If this refactor is not related to the migration from JUnit4 to JUnit5 it should be in another PR (I was mentioning that here in case you could use a JUnit5 feature to make that clearer)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, I see #1662 that's why I've not refactored it in this PR.

…to JUnit5 (eclipse-jkube#1563)

Signed-off-by: Anurag Rajawat <anuragsinghrajawat22@gmail.com>
Signed-off-by: Anurag Rajawat <anuragsinghrajawat22@gmail.com>
@anurag-rajawat
Copy link
Contributor Author

@manusa please review this PR

@manusa
Copy link
Member

manusa commented Sep 27, 2022

@manusa please review this PR

There are still some renamed variables that are not OK in this PR, I'll send a PR towards your branch to see if I can explain this better.

@sunix sunix self-requested a review October 3, 2022 09:15
Signed-off-by: Marc Nuri <marc@marcnuri.com>
@manusa
Copy link
Member

manusa commented Oct 3, 2022

@manusa please review this PR

There are still some renamed variables that are not OK in this PR, I'll send a PR towards your branch to see if I can explain this better.

Hi @anurag-rajawat

I created anurag-rajawat#2 with some suggestions

review: refactor: AppServerAutoDetectionTest uses parameters
@anurag-rajawat
Copy link
Contributor Author

I created anurag-rajawat#2 with some suggestions

@manusa thank you so much!

@manusa manusa added this to the 1.10.0 milestone Oct 3, 2022
@sonarcloud
Copy link

sonarcloud bot commented Oct 3, 2022

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
0.0% 0.0% Duplication

@manusa manusa merged commit b73a625 into eclipse-jkube:master Oct 3, 2022
@anurag-rajawat anurag-rajawat deleted the webapp branch October 3, 2022 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(jkube-kit-generator-webapp): Replace JUnit4 with JUnit5
4 participants