xtf-cz / xtf

MIT License
12 stars 55 forks source link

No fallback when OCP version does not match #519

Closed dcihak closed 1 year ago

dcihak commented 2 years ago

In case no matching OCP version was found for the client download in ClusterVersionInfo some fallback is expected to be executed to download the OpenShift client binary. E.g. in case no matching OCP version 4.12.0-ec.5 was used the path resolver failed with error

WARN - Version 4.12.0-ec.5 configured in xtf.openshift.version isn't in expected format 'major.minor[.micro]'.
[2022-11-15 11:12:52,114] ERROR- Failed to install operator
java.lang.IllegalStateException: No match found
    at java.util.regex.Matcher.group(Matcher.java:536)
    at cz.xtf.core.openshift.ClusterVersionInfo.isMajorMinorMicro(ClusterVersionInfo.java:73)
    at cz.xtf.core.openshift.ClusterVersionOpenShiftBinaryPathResolver.getVersionOrChannel(ClusterVersionOpenShiftBinaryPathResolver.java:236)
    at cz.xtf.core.openshift.ClusterVersionOpenShiftBinaryPathResolver.getClientUrlBasedOnOcpVersion(ClusterVersionOpenShiftBinaryPathResolver.java:81)
    at cz.xtf.core.openshift.ClusterVersionOpenShiftBinaryPathResolver.determineClientUrl(ClusterVersionOpenShiftBinaryPathResolver.java:42)
    at cz.xtf.core.openshift.ClusterVersionOpenShiftBinaryPathResolver.resolve(ClusterVersionOpenShiftBinaryPathResolver.java:32)
    at cz.xtf.core.openshift.OpenShiftBinaryManagerFactory.getOpenShiftBinaryManager(OpenShiftBinaryManagerFactory.java:19)
    at cz.xtf.core.openshift.OpenShifts.getBinaryPath(OpenShifts.java:77)
    at com.redhat.xpaas.eap.util.OpenShiftBinaryClient.<init>(OpenShiftBinaryClient.java:26)
    at com.redhat.xpaas.eap.util.OpenShiftBinaryClient.getInstance(OpenShiftBinaryClient.java:32)
    at com.redhat.xpaas.eap.operator.junit.listener.OperatorInstaller.installOperator(OperatorInstaller.java:552)
    at com.redhat.xpaas.eap.operator.junit.listener.OperatorInstaller.testPlanExecutionStarted(OperatorInstaller.java:131)
    at org.junit.platform.launcher.core.TestExecutionListenerRegistry$CompositeTestExecutionListener.lambda$testPlanExecutionStarted$12(TestExecutionListenerRegistry.java:115)
    at org.junit.platform.launcher.core.TestExecutionListenerRegistry.lambda$notifyEach$1(TestExecutionListenerRegistry.java:67)
    at java.util.ArrayList.forEach(ArrayList.java:1257)
    at org.junit.platform.launcher.core.TestExecutionListenerRegistry.notifyEach(TestExecutionListenerRegistry.java:65)
    at org.junit.platform.launcher.core.TestExecutionListenerRegistry.access$200(TestExecutionListenerRegistry.java:32)
    at org.junit.platform.launcher.core.TestExecutionListenerRegistry$CompositeTestExecutionListener.testPlanExecutionStarted(TestExecutionListenerRegistry.java:115)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:53)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:67)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:52)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:96)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:75)
    at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:150)
    at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:124)
    at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:384)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:345)
    at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:126)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:418)