fabric8io / kubernetes-client

Java client for Kubernetes & OpenShift
http://fabric8.io
Apache License 2.0
3.38k stars 1.46k forks source link

Not able to build io.fabric8:kubernetes-client-api:6.12.1 from source #6209

Open imtavish04 opened 1 month ago

imtavish04 commented 1 month ago

Hi team,

I am trying to build io.fabric8:kubernetes-client-api:6.12.1 from source using the command "./mvnw clean install".

Java version: 1.8.0_382

I am getting the following error, UT is not getting passed -->

[ERROR] Failures: [ERROR] OpenIDConnectionUtilsBehaviorTest$WithRefreshToken.withInvalidCertDataInAuthProviderConfig:165 Expecting actual throwable to be an instance of: java.lang.RuntimeException but was: java.lang.AssertionError: Missing expectation for path: /.well-known/openid-configuration at io.fabric8.kubernetes.client.http.TestStandardHttpClient.find(TestStandardHttpClient.java:98) at io.fabric8.kubernetes.client.http.TestStandardHttpClient.consumeBytesDirect(TestStandardHttpClient.java:78) at io.fabric8.kubernetes.client.http.StandardHttpClient.consumeBytesOnce(StandardHttpClient.java:110) ...(99 remaining lines not displayed - this can be changed with Assertions.setMaxStackTraceElementsDisplayed) [ERROR] OpenIDConnectionUtilsBehaviorTest$WithRefreshToken.withInvalidCertDataInConfig:153 Expecting actual throwable to be an instance of: java.lang.RuntimeException but was: java.lang.AssertionError: Missing expectation for path: /.well-known/openid-configuration at io.fabric8.kubernetes.client.http.TestStandardHttpClient.find(TestStandardHttpClient.java:98) at io.fabric8.kubernetes.client.http.TestStandardHttpClient.consumeBytesDirect(TestStandardHttpClient.java:78) at io.fabric8.kubernetes.client.http.StandardHttpClient.consumeBytesOnce(StandardHttpClient.java:110) ...(99 remaining lines not displayed - this can be changed with Assertions.setMaxStackTraceElementsDisplayed) [ERROR] OpenIDConnectionUtilsBehaviorTest$WithRefreshToken.withInvalidCertFileInConfig:180 Expecting actual throwable to be an instance of: java.lang.RuntimeException but was: java.lang.AssertionError: Missing expectation for path: /.well-known/openid-configuration at io.fabric8.kubernetes.client.http.TestStandardHttpClient.find(TestStandardHttpClient.java:98) at io.fabric8.kubernetes.client.http.TestStandardHttpClient.consumeBytesDirect(TestStandardHttpClient.java:78) at io.fabric8.kubernetes.client.http.StandardHttpClient.consumeBytesOnce(StandardHttpClient.java:110) ...(99 remaining lines not displayed - this can be changed with Assertions.setMaxStackTraceElementsDisplayed) [ERROR] Errors: [ERROR] HttpClientUtilsTest$GetProxyUrl.withNoHttpProxyProvidedReturnsNull:235 ? IllegalArgument Failure in creating proxy URL. Proxy port is required! [ERROR] HttpClientUtilsTest.testConfigureSocksProxy:87 ? MalformedURL NO_PROXY URL contains invalid entry: '*.oracle.com|localhost|*.oraclecorp.com' [INFO] [ERROR] Tests run: 476, Failures: 3, Errors: 2, Skipped: 3

Please advise if anything I am doing is wrong here.

rohanKanojia commented 1 month ago

@imtavish04 : Could you please share some information about your use case? May I know why you need a custom build of KubernetesClient v6.12.1 ?

rohanKanojia commented 1 month ago

@imtavish04 : I just tried building v6.12.1 tag on Eclipse Temurin JDK 1.8.0_412 and I was able to build test successfully.

Looking at your stack trace it looks like test is failing due to defined NO_PROXY URL:

MalformedURL NO_PROXY URL contains invalid entry: '*.oracle.com|localhost|*.oraclecorp.com' 
imtavish04 commented 1 month ago

Hi @rohanKanojia , I removed the proxies but I am still not able to run it successfully

[ERROR] Failures: [ERROR] OpenIDConnectionUtilsBehaviorTest$WithRefreshToken.withInvalidCertDataInAuthProviderConfig:165 Expecting actual throwable to be an instance of: java.lang.RuntimeException but was: java.lang.AssertionError: Missing expectation for path: /.well-known/openid-configuration at io.fabric8.kubernetes.client.http.TestStandardHttpClient.find(TestStandardHttpClient.java:98) at io.fabric8.kubernetes.client.http.TestStandardHttpClient.consumeBytesDirect(TestStandardHttpClient.java:78) at io.fabric8.kubernetes.client.http.StandardHttpClient.consumeBytesOnce(StandardHttpClient.java:110) ...(99 remaining lines not displayed - this can be changed with Assertions.setMaxStackTraceElementsDisplayed) [ERROR] OpenIDConnectionUtilsBehaviorTest$WithRefreshToken.withInvalidCertDataInConfig:153 Expecting actual throwable to be an instance of: java.lang.RuntimeException but was: java.lang.AssertionError: Missing expectation for path: /.well-known/openid-configuration at io.fabric8.kubernetes.client.http.TestStandardHttpClient.find(TestStandardHttpClient.java:98) at io.fabric8.kubernetes.client.http.TestStandardHttpClient.consumeBytesDirect(TestStandardHttpClient.java:78) at io.fabric8.kubernetes.client.http.StandardHttpClient.consumeBytesOnce(StandardHttpClient.java:110) ...(99 remaining lines not displayed - this can be changed with Assertions.setMaxStackTraceElementsDisplayed) [ERROR] OpenIDConnectionUtilsBehaviorTest$WithRefreshToken.withInvalidCertFileInConfig:180 Expecting actual throwable to be an instance of: java.lang.RuntimeException but was: java.lang.AssertionError: Missing expectation for path: /.well-known/openid-configuration at io.fabric8.kubernetes.client.http.TestStandardHttpClient.find(TestStandardHttpClient.java:98) at io.fabric8.kubernetes.client.http.TestStandardHttpClient.consumeBytesDirect(TestStandardHttpClient.java:78) at io.fabric8.kubernetes.client.http.StandardHttpClient.consumeBytesOnce(StandardHttpClient.java:110) ...(99 remaining lines not displayed - this can be changed with Assertions.setMaxStackTraceElementsDisplayed) [INFO]

imtavish04 commented 1 month ago

We need to build io.fabric8:kubernetes-client-api:6.12.1 from source, pack it as a jar and push it in our own repo. Then we'll use that package.

rohanKanojia commented 1 month ago

@imtavish04 : Could you please provide details about your environment? We have CI established for linux and windows and the test passes there.

If you just want to release the version, maybe you can skip running tests during release -DskipTests ?

imtavish04 commented 1 month ago

we are running on linux. We have to run the tests also

rohanKanojia commented 1 month ago

@imtavish04 : Then you need to debug why this test is failing on your environment.

manusa commented 1 month ago

@imtavish04 : I just tried building v6.12.1 tag on Eclipse Temurin JDK 1.8.0_412 and I was able to build test successfully.

Looking at your stack trace it looks like test is failing due to defined NO_PROXY URL:

MalformedURL NO_PROXY URL contains invalid entry: '*.oracle.com|localhost|*.oraclecorp.com' 

Could you try to override this environment variable in you CI/release environment?

Another option is for you to disable the tests for the release process (-DskipTests)

imtavish04 commented 1 week ago

Hi, yes. I did try overriding the proxy url but then I got the error ->

[ERROR] HttpClientUtilsTest.testConfigureSocksProxy:89

Argument(s) are different! Wanted:

builder.proxyType(SOCKS5);

-> at io.fabric8.kubernetes.client.utils.HttpClientUtilsTest.testConfigureSocksProxy(HttpClientUtilsTest.java:89)

Actual invocations have different arguments:

builder.proxyType(DIRECT);