Commit Graph

40 Commits

Author SHA1 Message Date
Cornelius Riemenschneider
f12310cb86 The java-version-too-old relies on a Java 8 installation.
We don't have a Java 8 build on the M1 machines, therefore skip this test.
2023-11-08 10:36:47 +01:00
Cornelius Riemenschneider
137403f649 Java: Move more tests to use the try_use_java11() helper.
This is in preparation of executing these tests on GH-hosted M1 runners,
where we need to have architecture-specific path handling.
It's nicer to fix all of this in one place (the helper), than to run around
fixing individual tests.
2023-11-08 10:33:50 +01:00
Cornelius Riemenschneider
ccaa792343 Address on-slack review. 2023-11-07 11:07:37 +01:00
Cornelius Riemenschneider
cff9bcfabc Revert "Revert "Java: Make integration test more robust wrt recent Java versions.""
This reverts commit 4e70e674fd.
2023-11-06 23:29:33 +01:00
Cornelius Riemenschneider
4e70e674fd Revert "Java: Make integration test more robust wrt recent Java versions."
This reverts commit ae21bbf0b2.
2023-11-06 23:26:21 +01:00
Cornelius Riemenschneider
ae21bbf0b2 Java: Make integration test more robust wrt recent Java versions.
I've been investigating moving the Java integration tests to a
GH-hosted macos runner, instead of a self-hosted one.
This test is not compatible with a GH-hosted runners Java setup.
It is also not compatible to being exposed to JAVA_21_HOME_X64 variable yet.

This PR fixes both issues.
2023-11-06 23:22:05 +01:00
Chris Smowton
a123f62a38 Add Java buildless diagnostic expectations 2023-09-26 15:25:58 +01:00
Chris Smowton
0b5727f1d1 Add test re: buildless mode interaction with snapshot repositories 2023-09-21 19:46:28 +01:00
Arthur Baars
2d44724acd Merge pull request #14281 from aibaars/aibaars/java-standalone-test
Java: standalone: add basic integration tests
2023-09-21 20:09:02 +02:00
Chris Smowton
04258f8cfc Remove actual file 2023-09-21 16:41:17 +01:00
Chris Smowton
14998606b7 Add test for the case of a module definition in a file not named module-info.java in a buildless extraction 2023-09-21 14:40:42 +01:00
Arthur Baars
722ee165d7 Java: standalone: add basic integration tests 2023-09-21 15:09:40 +02:00
Kasper Svendsen
7c59f5ac18 Merge pull request #13578 from kaspersv/kaspersv/java-remaining-implicit-this
Java: Enable implicit this warnings for remaining packs
2023-06-28 14:27:24 +02:00
Kasper Svendsen
7fcdefbe70 Java: Enable implicit this warnings for remaining packs 2023-06-27 11:54:20 +02:00
Ian Lynagh
8a43fc81ee Java: Tweak some android tests
They were all failing for me like:

[autobuild] /home/ian/code/dev/target/codeql-java-integration-tests/ql/java/ql/integration-tests/all-platforms/java/android-sample-old-style-no-wrapper/project/src/main/AndroidManifest.xml:5: Error: Main must extend android.app.Activity [Instantiatable]
[autobuild]         <activity android:name="Main" android:exported="true">
[autobuild]                                 ~~~~
[autobuild]    Explanation for issues of type "Instantiatable":
[autobuild]    Activities, services, broadcast receivers etc. registered in the manifest
[autobuild]    file (or for custom views, in a layout file) must be "instantiatable" by
[autobuild]    the system, which means that the class must be public, it must have an
[autobuild]    empty public constructor, and if it's an inner class, it must be a static
[autobuild]    inner class.

I'm not sure why it works on CI but not locally, but either way this
works around the issue.
2023-06-26 15:52:52 +01:00
Michael B. Gale
2d80302108 Use empty toolchains.xml for java-version-too-old 2023-05-16 16:54:19 +01:00
Michael B. Gale
9660b47879 Hide GHA variables in java-version-too-old test 2023-05-16 14:20:17 +01:00
Chris Smowton
2876b4aa5d maven-httpo-repository: add Maven wrapper
Maven 3.9.1 changes the format of the error message this test is looking for (though it still matches the target regex). Use the Maven wrapper to avoid such sensitivity to the precise version present in the environment.
2023-03-21 09:25:33 +00:00
Henry Mercer
6fbc8261f2 Java: Add a full stop 2023-03-14 17:03:42 +00:00
Henry Mercer
770924455e Java: Use Dotcom help links 2023-03-14 17:00:48 +00:00
Henry Mercer
ce96f009b7 Java: Capitalise HTTPS 2023-03-14 16:58:24 +00:00
Henry Mercer
819e0dfbf0 Java: Use "relevant" instead of "suspicious" 2023-03-14 16:54:14 +00:00
Henry Mercer
110cb64b7a Java: Avoid reference to other diagnostics 2023-03-14 16:52:58 +00:00
Henry Mercer
4c329b7b62 Java: Remove "please" in diagnostics
Per review from docs team
2023-03-14 16:46:06 +00:00
Chris Smowton
b234bbd119 Accept test changes 2023-03-03 14:46:21 +00:00
Chris Smowton
560a341e87 Fix multiple-candidate-builds message 2023-02-22 17:43:08 +00:00
Chris Smowton
c4640a6a9a Fix diagnostic markdown links 2023-02-22 17:43:08 +00:00
Chris Smowton
73e4480cc6 Update test expectations 2023-02-22 17:43:08 +00:00
Chris Smowton
2c216793a4 Diagnostics tests: don't create own diagnostics directory
The CLI does this now. Also omit default arguments to the integration test script.
2023-02-22 17:43:08 +00:00
Chris Smowton
53ac1e0133 Replace test absolute directory 2023-02-22 17:43:08 +00:00
Chris Smowton
57ac951451 Add tests for Java autobuilder errors 2023-02-22 17:43:08 +00:00
Chris Smowton
fd1ce5d12c Switch to using language-specific diagnostic environment variable 2023-02-22 17:43:08 +00:00
Chris Smowton
7a2c6b5645 Java no-build-system test: switch to single-file diagnostics.expected format 2023-02-22 17:43:07 +00:00
Chris Smowton
40e45d3636 Add test for missing Java build system 2023-02-22 17:43:07 +00:00
alexet
1b0952c512 Use Java 11 for some integration tests 2023-01-27 13:51:44 +00:00
Chris Smowton
a2e7b83411 Add additional note to Android tests 2023-01-21 11:57:54 +00:00
Chris Smowton
81e59e9005 Force Gradle tests to run sequentially
Otherwise starting multiple Gradle daemons in parallel can fail
2023-01-21 11:57:53 +00:00
Chris Smowton
4197d7bd20 Android tests: use Java 11 under Actions
Some runners still default to Java 8 (e.g. windows-2022 and macos-12), so we need to manually pull Java 11 in in such cases.
2023-01-21 11:57:53 +00:00
Chris Smowton
b6df415fe8 Add Android and Kotlin build script tests
This adds a single plain Gradle project that uses a modern Kotlin build script (i.e. settings.gradle.kts and no build.gradle.kts), plus basic Android samples exercising the possible permutations of: (old vs. new-style build script, Groovy vs. Kotlin build script, wrapper present vs. absent)

Old vs. new style tests our recognition of different cues that this is likely a Droid project and requires `gradle assemble` not `gradle testClasses` (the example given at https://developer.android.com/studio/build/#top-level changed style as of plugin version ~7.3.0).

Groovy vs. Kotlin build script language checks that the regexes recognising Android dependencies and versions work for both build script kinds.

Wrapper present vs. absent exercises the autobuilder logic that guesses an appropriate Gradle version and sets it up in the event the Gradle wrapper isn't provided.
2023-01-21 11:57:53 +00:00
Chris Smowton
52297c0b23 Add Java autobuilder integration tests 2023-01-05 12:19:25 +00:00