Giter VIP home page Giter VIP logo

jkube-integration-tests's Introduction

JKube Integration Tests

This project hosts Integration test suites for https://github.com/eclipse-jkube/jkube.

Test Structure

In order to be able to run the tests in a CI environment without hogging the resources and to provide specific tests for OpenShift clusters, test suites are divided in the following way.

Tags

There are three tags which match with a maven profile (Kubernetes, OpenShift, OpenShiftOSCI & Windows).

Each of these tags should be applied to a specific test case suite in order to execute the given tests only when that profile is specified.

e.g. when running with a standard k8s cluster mvn verify -PKubernetes

Suite groups

Tests are divided into several groups in order to run only a set of tests.

As of now, test groups are: dockerfile, other, quarkus, quarkus-native, springboot, webapp

Following the same principle as with tags, in order to activate a given set of tests, a profile matching the group name defined above must be specified-

e.g. Spring Boot tests when running in an Open Shift cluster mvn verify -POpenShift,springboot

Warning: If you've run any other suite in your local environment run a "profile-less" mvn clean command prior to anything else so that all target directories get deleted, else other profiles will get triggered.

Running a specific test

In addition to selecting a test group, you can run a specific test, or a set of tests, by providing the it.test Maven Failsafe Plugin configuration property.

For example, to run just the Vert.x tests you can run:

mvn verify -PKubernetes,other -Dit.test="*Vertx*"

Gradle

The Gradle tests run using the local Gradle installation. This approach was selected due to issues when running the tests on the GitHub Actions CI pipeline environment.

jkube-integration-tests's People

Contributors

manusa avatar dependabot[bot] avatar rohankanojia avatar anandrkskd avatar jfdenise avatar sunix avatar jurrie avatar

Stargazers

 avatar Darsh Nair avatar LeeWaiKung avatar Anyul Rivas avatar Ramazan Kara avatar  avatar  avatar

Watchers

Ondrej Skutka avatar  avatar  avatar James Cloos avatar Alex Soto avatar Devang Gaur avatar  avatar Kostas Georgiou avatar  avatar

jkube-integration-tests's Issues

E2E tests failing with Cache not found for input keys

This morning I'm seeing unrelated failures in all E2E tests, it seems to be happening in all tests:

Run JKUBE_VERSION=$(mvn -f jkube/pom.xml -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec) \
POM file jkube/pom.xml specified with the -f/--file command line argument does not exist

These are the PRs I updated this morning:

False positive assertion. ServiceAssertion#assertNodePortResponse. Corrupted channel by directly writing to native stream in forked JVM 1.

I am facing a weird issue while adding a new test.

[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running org.eclipse.jkube.integrationtests.webapp.tomcatjakartaee.TomcatJakartaEEK8sITCase
[OkHttp https://192.168.99.131:8443/...] WARN io.fabric8.kubernetes.client.readiness.Readiness - Service is not a Readiable resource. It needs to be one of [Node, Deployment, ReplicaSet, StatefulSet, Pod, ReplicationController]
[OkHttp https://192.168.99.131:8443/...] WARN io.fabric8.kubernetes.client.readiness.Readiness - Service is not a Readiable resource. It needs to be one of [Node, Deployment, ReplicaSet, StatefulSet, Pod, ReplicationController]
[OkHttp https://192.168.99.131:8443/...] WARN io.fabric8.kubernetes.client.readiness.Readiness - Service is not a Readiable resource. It needs to be one of [Node, Deployment, ReplicaSet, StatefulSet, Pod, ReplicationController]
[OkHttp https://192.168.99.131:8443/...] WARN io.fabric8.kubernetes.client.readiness.Readiness - Service is not a Readiable resource. It needs to be one of [Node, Deployment, ReplicaSet, StatefulSet, Pod, ReplicationController]
[ERROR] </pre><p><b>Note</b> The full stack trace of the root cause is available in the server logs.</p><hr class="line" /><h3>Apache Tomcat/10.1.0-M14</h3></body></html>": �:java.lang.AssertionError: 
[INFO] Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 38.609 s - in org.eclipse.jkube.integrationtests.webapp.tomcatjakartaee.TomcatJakartaEEK8sITCase
[INFO] 
[INFO] Results:
[INFO] 
[INFO] Tests run: 5, Failures: 0, Errors: 0, Skipped: 0
[INFO] 
[WARNING] Corrupted channel by directly writing to native stream in forked JVM 1. See FAQ web page and the dump file /home/sunix/github/jkubeio/jkube-integration-tests/it/target/failsafe-reports/2022-07-22T16-51-11_734-jvmRun1.dumpstream
[INFO] 

When calling in a test an endpoint that returns 500. it is supposed to fail but the test succeeded.

  @Test
  @Order(3)
  @DisplayName("Service as NodePort response should return String")
  void testNodePortResponse() throws Exception {
    // Given
    final Service service = serviceSpecTypeToNodePort();
    // Then
    awaitService(this, service.getMetadata().getNamespace())
      .assertNodePortResponse("http", containsString("ssfasdfasdfasdfsadf"), "HelloWorld"); // this is supposed to fail because of 500 http error, a query parameter is required in this request.
  }

the problem is when it tries to call ResponseBody#string().
For some reason, okhttpclient seems first to print in the standard output. We see the first lines of the responseBody content in the console:

[ERROR] </pre><p><b>Note</b> The full stack trace of the root cause is available in the server logs.</p><hr class="line" /><h3>Apache Tomcat/10.1.0-M14</h3></body></html>": �:java.lang.AssertionError: 

And then ... somehow the rest of the content is redirected to the dumpstream file. Is the thread dead somehow?

the dumstream file:

 Created at 2022-07-22T16:51:45.097
Corrupted channel by directly writing to native stream in forked JVM 1. Stream 't.getParameter(String)&quot; is null'.

# Created at 2022-07-22T16:51:45.098
Corrupted channel by directly writing to native stream in forked JVM 1. Stream '	org.eclipse.jkube.tests.samples.HelloWorld.doGet(HelloWorld.java:15)'.

# Created at 2022-07-22T16:51:45.098
Corrupted channel by directly writing to native stream in forked JVM 1. Stream '	jakarta.servlet.http.HttpServlet.service(HttpServlet.java:690)'.

# Created at 2022-07-22T16:51:45.098
Corrupted channel by directly writing to native stream in forked JVM 1. Stream '	jakarta.servlet.http.HttpServlet.service(HttpServlet.java:799)'.

# Created at 2022-07-22T16:51:45.099
Corrupted channel by directly writing to native stream in forked JVM 1. Stream '	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)'.

# Created at 2022-07-22T16:51:45.105
Corrupted channel by directly writing to native stream in forked JVM 1. Stream '</pre><p><b>Note</b> The full stack trace of the root cause is available in the server logs.</p><hr class="line" /><h3>Apache Tomcat/10.1.0-M14</h3></body></html>":�\00\00��:\00\00��:'.

# Created at 2022-07-22T16:51:45.106
Corrupted channel by directly writing to native stream in forked JVM 1. Stream 'Expected: a string containing "ssfasdfasdfasdfsadf"'.

# Created at 2022-07-22T16:51:45.111
Corrupted channel by directly writing to native stream in forked JVM 1. Stream '     but: was "<!doctype html><html lang="en"><head><title>HTTP Status 500 – Internal Server Error</title><style type="text/css">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 500 – Internal Server Error</h1><hr class="line" /><p><b>Type</b> Exception Report</p><p><b>Message</b> Cannot invoke &quot;String.trim()&quot; because the return value of &quot;jakarta.servlet.http.HttpServletRequest.getParameter(String)&quot; is null</p><p><b>Description</b> The server encountered an unexpected condition that prevented it from fulfilling the request.</p><p><b>Exception</b></p><pre>java.lang.NullPointerException: Cannot invoke &quot;String.trim()&quot; because the return value of &quot;jakarta.servlet.http.HttpServletRequest.getParameter(String)&quot; is null'.

# Created at 2022-07-22T16:51:45.112
Corrupted channel by directly writing to native stream in forked JVM 1. Stream '	org.eclipse.jkube.tests.samples.HelloWorld.doGet(HelloWorld.java:15)'.

# Created at 2022-07-22T16:51:45.112
Corrupted channel by directly writing to native stream in forked JVM 1. Stream '	jakarta.servlet.http.HttpServlet.service(HttpServlet.java:690)'.

# Created at 2022-07-22T16:51:45.113
Corrupted channel by directly writing to native stream in forked JVM 1. Stream '	jakarta.servlet.http.HttpServlet.service(HttpServlet.java:799)'.

# Created at 2022-07-22T16:51:45.113

The test is marked as OK but should fail.

My workaround for this test is to add a check on the error code.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.