Skip to content

Commit 32a2ea1

Browse files
authored
Merge pull request github#15413 from smowton/smowton/admin/buildless-sibling-project-tests
Add tests for Java buildless w/sibling projects
2 parents cbcc090 + ed9abdd commit 32a2ea1

File tree

44 files changed

+1268
-18
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1268
-18
lines changed

java/ql/integration-tests/all-platforms/java/buildless-gradle/diagnostics.expected

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@
4141
}
4242
}
4343
{
44-
"markdownMessage": "Reading the dependency graph from Gradle build files provided 1 classpath entries",
44+
"markdownMessage": "Reading the dependency graph from build files provided 1 classpath entries",
4545
"severity": "unknown",
4646
"source": {
4747
"extractorName": "java",
4848
"id": "java/autobuilder/buildless/depgraph-provided-by-gradle",
49-
"name": "Java buildless mode extracted precise dependency graph information from Gradle"
49+
"name": "Java buildless mode extracted precise dependency graph information from tool Gradle"
5050
},
5151
"visibility": {
5252
"cliSummaryTable": true,

java/ql/integration-tests/all-platforms/java/buildless-maven-multimodule/diagnostics.expected

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@
4141
}
4242
}
4343
{
44-
"markdownMessage": "Reading the dependency graph from Maven build files provided 3 classpath entries",
44+
"markdownMessage": "Reading the dependency graph from build files provided 3 classpath entries",
4545
"severity": "unknown",
4646
"source": {
4747
"extractorName": "java",
4848
"id": "java/autobuilder/buildless/depgraph-provided-by-maven",
49-
"name": "Java buildless mode extracted precise dependency graph information from Maven"
49+
"name": "Java buildless mode extracted precise dependency graph information from tool Maven"
5050
},
5151
"visibility": {
5252
"cliSummaryTable": true,

java/ql/integration-tests/all-platforms/java/buildless-maven/diagnostics.expected

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@
4141
}
4242
}
4343
{
44-
"markdownMessage": "Reading the dependency graph from Maven build files provided 2 classpath entries",
44+
"markdownMessage": "Reading the dependency graph from build files provided 2 classpath entries",
4545
"severity": "unknown",
4646
"source": {
4747
"extractorName": "java",
4848
"id": "java/autobuilder/buildless/depgraph-provided-by-maven",
49-
"name": "Java buildless mode extracted precise dependency graph information from Maven"
49+
"name": "Java buildless mode extracted precise dependency graph information from tool Maven"
5050
},
5151
"visibility": {
5252
"cliSummaryTable": true,

java/ql/integration-tests/all-platforms/java/buildless-maven/test.actual

-10
This file was deleted.

java/ql/integration-tests/all-platforms/java/buildless-maven/buildless-fetches.actual renamed to java/ql/integration-tests/all-platforms/java/buildless-sibling-projects/buildless-fetches.expected

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
https://jcenter.bintray.com/junit/junit/4.12/junit-4.12.jar
2+
https://jcenter.bintray.com/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar
3+
https://jcenter.bintray.com/org/slf4j/slf4j-api/1.7.21/slf4j-api-1.7.21.jar
14
https://repo.maven.apache.org/maven2/com/feiniaojin/naaf/naaf-graceful-response-example/1.0/naaf-graceful-response-example-1.0.jar
25
https://repo.maven.apache.org/maven2/com/github/MoebiusSolutions/avro-registry-in-source/avro-registry-in-source-tests/1.8/avro-registry-in-source-tests-1.8.jar
36
https://repo.maven.apache.org/maven2/com/github/MoebiusSolutions/avro-registry-in-source/example-project/1.5/example-project-1.5.jar
@@ -22,5 +25,3 @@ https://repo.maven.apache.org/maven2/org/minijax/minijax-example-websocket/0.5.1
2225
https://repo.maven.apache.org/maven2/org/scalamock/scalamock-examples_2.10/3.6.0/scalamock-examples_2.10-3.6.0.jar
2326
https://repo.maven.apache.org/maven2/org/somda/sdc/glue-examples/4.0.0/glue-examples-4.0.0.jar
2427
https://repo.maven.apache.org/maven2/us/fatehi/schemacrawler-examplecode/16.20.2/schemacrawler-examplecode-16.20.2.jar
25-
https://repo1.maven.org/maven2/junit/junit/4.11/junit-4.11.jar
26-
https://repo1.maven.org/maven2/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
{
2+
"markdownMessage": "Java buildless mode dropped the following dependencies because a sibling project depends on a higher version:\n\n* `junit/junit-4.11`",
3+
"severity": "unknown",
4+
"source": {
5+
"extractorName": "java",
6+
"id": "java/autobuilder/buildless/dependencies-disagree",
7+
"name": "Java buildless mode found sibling projects that disagree about some of their direct dependency versions"
8+
},
9+
"visibility": {
10+
"cliSummaryTable": true,
11+
"statusPage": false,
12+
"telemetry": true
13+
}
14+
}
15+
{
16+
"markdownMessage": "Java buildless mode used JDK version 11.0.0 as recommended by build tool Gradle",
17+
"severity": "unknown",
18+
"source": {
19+
"extractorName": "java",
20+
"id": "java/autobuilder/buildless/jdk-selected",
21+
"name": "Java buildless mode used JDK version 11.0.0 as recommended by build tool Gradle"
22+
},
23+
"visibility": {
24+
"cliSummaryTable": true,
25+
"statusPage": false,
26+
"telemetry": true
27+
}
28+
}
29+
{
30+
"markdownMessage": "Java buildless mode used the highest recommended Java version out of:\n\n* Gradle at `<test-root-directory>/./gradle-sample` recommends version 8.0.0\n* Gradle at `<test-root-directory>/./gradle-sample2` recommends version 11.0.0",
31+
"severity": "unknown",
32+
"source": {
33+
"extractorName": "java",
34+
"id": "java/autobuilder/buildless/jdk-version-disagree",
35+
"name": "Java buildless mode found sibling projects that disagree about the needed Java version. The highest recommended version will be used"
36+
},
37+
"visibility": {
38+
"cliSummaryTable": true,
39+
"statusPage": false,
40+
"telemetry": true
41+
}
42+
}
43+
{
44+
"markdownMessage": "Java buildless mode will combine recommended JDK versions and/or external dependency information from:\n\n* Gradle at `<test-root-directory>/./gradle-sample`\n* Gradle at `<test-root-directory>/./gradle-sample2`\n* Maven at `<test-root-directory>/./maven-project-1`\n* Maven at `<test-root-directory>/./maven-project-2`",
45+
"severity": "unknown",
46+
"source": {
47+
"extractorName": "java",
48+
"id": "java/autobuilder/buildless/using-build-tool-advice-multiple",
49+
"name": "Java buildless mode found several sibling projects and will combine their recommended JDK versions and/or external dependency information"
50+
},
51+
"visibility": {
52+
"cliSummaryTable": true,
53+
"statusPage": false,
54+
"telemetry": true
55+
}
56+
}
57+
{
58+
"markdownMessage": "Java was extracted in buildless mode. 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.",
59+
"severity": "note",
60+
"source": {
61+
"extractorName": "java",
62+
"id": "java/autobuilder/buildless/mode-active",
63+
"name": "Java was extracted in buildless mode"
64+
},
65+
"visibility": {
66+
"cliSummaryTable": true,
67+
"statusPage": true,
68+
"telemetry": true
69+
}
70+
}
71+
{
72+
"markdownMessage": "Reading the dependency graph from build files provided 3 classpath entries",
73+
"severity": "unknown",
74+
"source": {
75+
"extractorName": "java",
76+
"id": "java/autobuilder/buildless/depgraph-provided-by-multiple",
77+
"name": "Java buildless mode extracted precise dependency graph information from multiple build tools"
78+
},
79+
"visibility": {
80+
"cliSummaryTable": true,
81+
"statusPage": false,
82+
"telemetry": true
83+
}
84+
}
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.
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+
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
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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+
}
31+
32+
java {
33+
sourceCompatibility = JavaVersion.VERSION_1_8
34+
}
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>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)