Skip to content

Commit d76182b

Browse files
authored
Merge pull request #16468 from smowton/smowton/admin/add-buildless-timeout-tests
Java: add test cases for Maven and Gradle stalling in buildless mode
2 parents 8297075 + 61cd93f commit d76182b

File tree

32 files changed

+1302
-0
lines changed

32 files changed

+1302
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#
2+
# https://help.github.com/articles/dealing-with-line-endings/
3+
#
4+
# These are explicitly windows files and should use crlf
5+
*.bat text eol=crlf
6+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Ignore Gradle project-specific cache directory
2+
.gradle
3+
4+
# Ignore Gradle build output directory
5+
build
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* This build file was auto generated by running the Gradle 'init' task
3+
* by 'arthur' at '28/11/20 22:29' with Gradle 3.0
4+
*
5+
* This generated file contains a sample Java project to get you started.
6+
* For more details take a look at the Java Quickstart chapter in the Gradle
7+
* user guide available at https://docs.gradle.org/3.0/userguide/tutorial_java_projects.html
8+
*/
9+
10+
// Apply the java plugin to add support for Java
11+
apply plugin: 'java'
12+
13+
// In this section you declare where to find the dependencies of your project
14+
repositories {
15+
// Use 'jcenter' for resolving your dependencies.
16+
// You can declare any Maven/Ivy/file repository here.
17+
jcenter()
18+
}
19+
20+
// In this section you declare the dependencies for your production and test code
21+
dependencies {
22+
// The production code uses the SLF4J logging API at compile time
23+
compile 'org.slf4j:slf4j-api:1.7.21'
24+
25+
// Declare the dependency for your favourite test framework you want to use in your tests.
26+
// TestNG is also supported by the Gradle Test task. Just change the
27+
// testCompile dependency to testCompile 'org.testng:testng:6.8.1' and add
28+
// 'test.useTestNG()' to your build script.
29+
testCompile 'junit:junit:4.12'
30+
}
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
{
2+
"markdownMessage": "A Gradle process was aborted because it didn't write to the console for 5 seconds. Consider either lengthening the timeout if appropriate by setting CODEQL_EXTRACTOR_JAVA_BUILDLESS_CHILD_PROCESS_IDLE_TIMEOUT to a higher value or zero for no timeout, or else investigate why Gradle timed out. Java analysis will continue, but the analysis may be of reduced quality.",
3+
"severity": "warning",
4+
"source": {
5+
"extractorName": "java",
6+
"id": "java/autobuilder/buildless/gradle-timed-out",
7+
"name": "Java analysis timed out running Gradle"
8+
},
9+
"visibility": {
10+
"cliSummaryTable": true,
11+
"statusPage": true,
12+
"telemetry": true
13+
}
14+
}
15+
{
16+
"markdownMessage": "Build tool(s) should have been able to provide a recommended classpath but the attempt failed. Extraction will continue, but external dependencies will be inferred from the Java package names used. Consider troubleshooting the build tool error or using a build mode other than 'none'.",
17+
"severity": "warning",
18+
"source": {
19+
"extractorName": "java",
20+
"id": "java/autobuilder/buildless/classpath-from-tool-failed",
21+
"name": "Failed to extract dependency information from build tool tool Gradle"
22+
},
23+
"visibility": {
24+
"cliSummaryTable": true,
25+
"statusPage": true,
26+
"telemetry": true
27+
}
28+
}
29+
{
30+
"markdownMessage": "Java analysis used build tool Gradle to pick a JDK version and/or to recommend external dependencies.",
31+
"severity": "unknown",
32+
"source": {
33+
"extractorName": "java",
34+
"id": "java/autobuilder/buildless/using-build-tool-advice",
35+
"name": "Java analysis used build tool Gradle to pick a JDK version and/or to recommend external dependencies"
36+
},
37+
"visibility": {
38+
"cliSummaryTable": true,
39+
"statusPage": false,
40+
"telemetry": true
41+
}
42+
}
43+
{
44+
"markdownMessage": "Java analysis used the system default JDK.",
45+
"severity": "unknown",
46+
"source": {
47+
"extractorName": "java",
48+
"id": "java/autobuilder/buildless/jdk-system-default",
49+
"name": "Java analysis used the system default JDK"
50+
},
51+
"visibility": {
52+
"cliSummaryTable": true,
53+
"statusPage": false,
54+
"telemetry": true
55+
}
56+
}
57+
{
58+
"markdownMessage": "Java analysis with build-mode 'none' completed.",
59+
"severity": "unknown",
60+
"source": {
61+
"extractorName": "java",
62+
"id": "java/autobuilder/buildless/complete",
63+
"name": "Java analysis with build-mode 'none' completed"
64+
},
65+
"visibility": {
66+
"cliSummaryTable": true,
67+
"statusPage": false,
68+
"telemetry": true
69+
}
70+
}
71+
{
72+
"markdownMessage": "Java was extracted with build-mode set to 'none'. This means that all Java source in the working directory will be scanned, with build tools such as Maven and Gradle only contributing information about external dependencies.",
73+
"severity": "note",
74+
"source": {
75+
"extractorName": "java",
76+
"id": "java/autobuilder/buildless/mode-active",
77+
"name": "Java was extracted with build-mode set to 'none'"
78+
},
79+
"visibility": {
80+
"cliSummaryTable": true,
81+
"statusPage": true,
82+
"telemetry": true
83+
}
84+
}
85+
{
86+
"markdownMessage": "Running the Gradle plugin `org.gradle:github-dependency-graph-gradle-plugin` failed. This means precise dependency information will be unavailable, and so dependencies will be guessed based on Java package names. Consider investigating why this plugin fails to run.",
87+
"severity": "warning",
88+
"source": {
89+
"extractorName": "java",
90+
"id": "java/autobuilder/buildless/github-dependency-graph-gradle-plugin-failed",
91+
"name": "Java analysis failed to extract a dependency graph from Gradle"
92+
},
93+
"visibility": {
94+
"cliSummaryTable": true,
95+
"statusPage": true,
96+
"telemetry": true
97+
}
98+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# We currently have a bug where gradle tests become flaky when executed in parallel
2+
# - sometimes, gradle fails to connect to the gradle daemon.
3+
# Therefore, force this test to run sequentially.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<verification-metadata>
3+
<configuration>
4+
<verify-metadata>true</verify-metadata>
5+
<verify-signatures>false</verify-signatures>
6+
</configuration>
7+
</verification-metadata>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://192.0.2.0/distributions/gradle-99.99.99-bin.zip
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists

java/ql/integration-tests/all-platforms/java/buildless-gradle-timeout/gradlew

Lines changed: 185 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)