Skip to content

Commit ffd7006

Browse files
committed
Fix flaky ProxyTest
Seems the communication with the ESLint bridge was affected by the JVM proxy configuration on the LTS axis.
1 parent 36f35d4 commit ffd7006

4 files changed

Lines changed: 9 additions & 14 deletions

File tree

.cirrus.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ build_task:
3434
eks_container:
3535
<<: *CONTAINER_DEFINITION
3636
cpu: 2
37-
memory: 1G
37+
memory: 2G
3838
env:
3939
SONAR_TOKEN: VAULT[development/kv/data/next data.token]
4040
SONAR_HOST_URL: https://next.sonarqube.com/sonarqube
@@ -87,7 +87,7 @@ qa_task:
8787
<<: *CONTAINER_DEFINITION
8888
image: ${CIRRUS_AWS_ACCOUNT}.dkr.ecr.eu-central-1.amazonaws.com/base:j17-latest
8989
cpu: 2
90-
memory: 3G
90+
memory: 4G
9191
env:
9292
matrix:
9393
- SQ_VERSION: LATEST_RELEASE

its/it-tests/src/test/java/com/sonar/scanner/lib/it/ProxyTest.java

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -202,23 +202,20 @@ public void simple_analysis_with_proxy_auth() throws Exception {
202202
SimpleScanner scanner = new SimpleScanner();
203203

204204
Map<String, String> params = new HashMap<>();
205-
// By default no request to localhost will use proxy
206-
params.put("http.nonProxyHosts", "");
207-
params.put("http.proxyHost", "localhost");
208-
params.put("http.proxyPort", "" + httpProxyPort);
205+
params.put("sonar.scanner.proxyHost", "localhost");
206+
params.put("sonar.scanner.proxyPort", "" + httpProxyPort);
209207

210208
BuildResult buildResult = scanner.executeSimpleProject(project("js-sample"), ORCHESTRATOR.getServer().getUrl(), params, Map.of());
211209
assertThat(buildResult.getLastStatus()).isEqualTo(1);
212210
assertThat(buildResult.getLogs()).contains("Error status returned by url", ": 407");
213211
assertThat(seenByProxy).isEmpty();
214212

215-
params.put("http.proxyUser", PROXY_USER);
216-
params.put("http.proxyPassword", PROXY_PASSWORD);
213+
params.put("sonar.scanner.proxyUser", PROXY_USER);
214+
params.put("sonar.scanner.proxyPassword", PROXY_PASSWORD);
217215
buildResult = scanner.executeSimpleProject(project("js-sample"), ORCHESTRATOR.getServer().getUrl(), params, Map.of());
218216
assertThat(seenByProxy).isNotEmpty();
219-
if (ORCHESTRATOR.getServer().version().isGreaterThanOrEquals(6, 1)) {
220-
assertThat(buildResult.getLastStatus()).isZero();
221-
}
217+
System.out.println(buildResult.getLogs());
218+
assertThat(buildResult.getLastStatus()).isZero();
222219
}
223220

224221
}

its/it-tests/src/test/java/com/sonar/scanner/lib/it/ScannerJavaLibraryTestSuite.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ public class ScannerJavaLibraryTestSuite {
3939
public static final OrchestratorRule ORCHESTRATOR = OrchestratorRule.builderEnv()
4040
.setSonarVersion(System.getProperty(SONAR_RUNTIME_VERSION, "DEV"))
4141
.useDefaultAdminCredentialsForBuilds(true)
42-
// We need to use a plugin compatible with both SonarQube DEV & SonarQube version defined in .cirrus.yml (currently SQ 7.9)
43-
.addPlugin(MavenLocation.of("org.sonarsource.javascript", "sonar-javascript-plugin", "7.4.4.15624"))
42+
.addBundledPluginToKeep("sonar-javascript")
4443
.build();
4544

4645
public static void resetData(OrchestratorRule orchestrator) {

pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949

5050
<properties>
5151
<maven.compiler.release>11</maven.compiler.release>
52-
<maven.test.redirectTestOutputToFile>true</maven.test.redirectTestOutputToFile>
5352

5453
<!-- used for deployment to SonarSource Artifactory -->
5554
<gitRepositoryName>sonar-scanner-java-library</gitRepositoryName>

0 commit comments

Comments
 (0)