SonarQube - Community Edition - Version 10.4.1 (build 88267) - Docker
Jenkins - 2.470
Java 17
Gradle 7.5.1
I have strange issue. Some of test run in Jenkins for Sonarqube failing, but if the same tests I run in normal pipeline (for example deploy to dev server) or inside my IDE they are passing.
Example of test:
RemoteXsdClient remoteXsdClient = new RemoteXsdClient(httpClient);
String remoteXsdUrl = "https://a-remote-xsd/file.xsd";
URL remoteXsdResource = XmlValidatorServiceTest.class.getResource("/file.xsd");
assertNotNull(remoteXsdResource);
String remoteXsdPath = remoteXsdResource.getFile();
byte[] remoteXsdRaw = Files.readAllBytes(Paths.get(remoteXsdPath)); //this is line 62
this line failing with error:
RemoteXsdClient > should get an xsd schema from a remote source and parse the file into a string FAILED
java.nio.file.NoSuchFileException at RemoteXsdClientTest.java:62
but like I said, running it in other pipeline or even local I don’t get this kind of error.
I search there on forum and google but wasn’t successful yet. Maybe you will have better idea what’s could go wrong? It’s looks like under sonarqube it’s try to read file
I don’t write this tests, I try only implements sonar scans.