Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

18 GA tests and version utils #813

Merged
merged 3 commits into from
Apr 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/AITs-Basic-Features-Special-JREs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,11 @@ jobs:
run: |
echo "ORG_GRADLE_PROJECT_jdk17=${JAVA_HOME}" >> $GITHUB_ENV

- name: Set up Java 18-ea
- name: Set up Java 18
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: 18-ea
java-version: 18

- name: Save JAVA_HOME as JDK18 for later usage
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/AITs-Basic-Features.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,11 @@ jobs:
echo "ORG_GRADLE_PROJECT_jdk17=${JAVA_HOME}" >> $GITHUB_ENV

# Install 18 EA
- name: Set up Java 18-ea
- name: Set up Java 18
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: 18-ea
java-version: 18

- name: Save JAVA_HOME as JDK18 for later usage
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/AITs-Datastores.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,11 @@ jobs:
run: |
echo "ORG_GRADLE_PROJECT_jdk17=${JAVA_HOME}" >> $GITHUB_ENV

- name: Set up Java 18-ea
- name: Set up Java 18
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: 18-ea
java-version: 18

- name: Save JAVA_HOME as JDK18 for later usage
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/AITs-Frameworks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,11 @@ jobs:
echo "ORG_GRADLE_PROJECT_jdk17=${JAVA_HOME}" >> $GITHUB_ENV

# Install 18 EA
- name: Set up Java 18-ea
- name: Set up Java 18
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: 18-ea
java-version: 18

- name: Save JAVA_HOME as JDK18 for later usage
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/AITs-Security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,11 @@ jobs:
echo "ORG_GRADLE_PROJECT_jdk17=${JAVA_HOME}" >> $GITHUB_ENV

# Install 18 EA
- name: Set up Java 18-ea
- name: Set up Java 18
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: 18-ea
java-version: 18

- name: Save JAVA_HOME as JDK18 for later usage
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/AITs-Servers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,11 @@ jobs:
echo "ORG_GRADLE_PROJECT_jdk17=${JAVA_HOME}" >> $GITHUB_ENV

# Install 18 EA
- name: Set up Java 18-ea
- name: Set up Java 18
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: 18-ea
java-version: 18

- name: Save JAVA_HOME as JDK18 for later usage
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/AITs-Traces.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,11 @@ jobs:
echo "ORG_GRADLE_PROJECT_jdk17=${JAVA_HOME}" >> $GITHUB_ENV

# Install 18 EA
- name: Set up Java 18-ea
- name: Set up Java 18
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: 18-ea
java-version: 18

- name: Save JAVA_HOME as JDK18 for later usage
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/GHA-Functional-Tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ jobs:
echo "Current JAVA_HOME = ${JAVA_HOME}"
echo "ORG_GRADLE_PROJECT_jdk17=$JAVA_HOME" >> $GITHUB_ENV

- name: Set up Java 18-ea
- name: Set up Java 18
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: 18-ea
java-version: 18

- name: Save JAVA_HOME as JDK18 for later usage
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/GHA-Unit-Tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ jobs:
echo "Current JAVA_HOME = ${JAVA_HOME}"
echo "ORG_GRADLE_PROJECT_jdk17=$JAVA_HOME" >> $GITHUB_ENV

- name: Set up Java 18-ea
- name: Set up Java 18
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: 18-ea
java-version: 18

- name: Save JAVA_HOME as JDK18 for later usage
run: |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Java 18ea Instrumentation Tests
name: Java 18 Instrumentation Tests

on:
pull_request:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/X-Reusable-Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ jobs:
echo "Current JAVA_HOME = ${JAVA_HOME}"
echo "ORG_GRADLE_PROJECT_jdk17=$JAVA_HOME" >> $GITHUB_ENV

# Install 18-ea
- name: Set up Java 18-ea
# Install 18
- name: Set up Java 18
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: 18-ea
java-version: 18

# Save new JDK variable
- name: Save JAVA_HOME as JDK18ea for later usage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
* Simple set of utilities to help us validate that the agent is being run on a supported version of Java.
*/
public class JavaVersionUtils {
private static final Pattern SUPPORTED_JAVA_VERSION_PATTERN = Pattern.compile("^(1\\.8|9|1[0-7])$");
private static final Pattern SUPPORTED_JAVA_VERSION_PATTERN = Pattern.compile("^(1\\.8|9|1[0-8])$");
private static final Pattern EXCLUSIVE_MIN_JAVA_VERSION_PATTERN = Pattern.compile("^1\\.7$");
private static final Pattern EXCLUSIVE_MAX_JAVA_VERSION_PATTERN = Pattern.compile("^18$");
private static final String MAX_SUPPORTED_VERSION = "17";
private static final Pattern EXCLUSIVE_MAX_JAVA_VERSION_PATTERN = Pattern.compile("^19$");
private static final String MAX_SUPPORTED_VERSION = "18";

public static final String JAVA_7 = "1.7";
public static final String JAVA_8 = "1.8";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public void supportAgentJavaSpecVersions() {
assertTrue(JavaVersionUtils.isAgentSupportedJavaSpecVersion(JavaVersionUtils.JAVA_15));
assertTrue(JavaVersionUtils.isAgentSupportedJavaSpecVersion(JavaVersionUtils.JAVA_16));
assertTrue(JavaVersionUtils.isAgentSupportedJavaSpecVersion(JavaVersionUtils.JAVA_17));
assertTrue(JavaVersionUtils.isAgentSupportedJavaSpecVersion(JavaVersionUtils.JAVA_18));

}

Expand All @@ -53,14 +54,14 @@ public void unsupportedAgentVersionsLessThanJava8() {

@Test
public void javaVersionHigherThanSupported() {
assertFalse(JavaVersionUtils.isAgentSupportedJavaSpecVersion("18.0"));
assertFalse(JavaVersionUtils.isAgentSupportedJavaSpecVersion("18+181"));
assertFalse(JavaVersionUtils.isAgentSupportedJavaSpecVersion("18.0+181"));
assertFalse(JavaVersionUtils.isAgentSupportedJavaSpecVersion("18.0_b181"));
assertFalse(JavaVersionUtils.isAgentSupportedJavaSpecVersion("18.0.1"));
assertFalse(JavaVersionUtils.isAgentSupportedJavaSpecVersion("18.0.1+11"));
assertFalse(JavaVersionUtils.isAgentSupportedJavaSpecVersion("18.0.1_11"));
assertFalse(JavaVersionUtils.isAgentSupportedJavaSpecVersion("18.0.1_11-b11"));
assertFalse(JavaVersionUtils.isAgentSupportedJavaSpecVersion("19.0"));
assertFalse(JavaVersionUtils.isAgentSupportedJavaSpecVersion("19+181"));
assertFalse(JavaVersionUtils.isAgentSupportedJavaSpecVersion("19.0+181"));
assertFalse(JavaVersionUtils.isAgentSupportedJavaSpecVersion("19.0_b181"));
assertFalse(JavaVersionUtils.isAgentSupportedJavaSpecVersion("19.0.1"));
assertFalse(JavaVersionUtils.isAgentSupportedJavaSpecVersion("19.0.1+11"));
assertFalse(JavaVersionUtils.isAgentSupportedJavaSpecVersion("19.0.1_11"));
assertFalse(JavaVersionUtils.isAgentSupportedJavaSpecVersion("19.0.1_11-b11"));
}

@Test
Expand All @@ -87,9 +88,9 @@ public void unsupportedJavaVersionMessageWhenLessThanMinimalSupportedVersion() {

@Test
public void unsupportedJavaVersionMessageWhenGreaterThanMaxSupportedVersion() {
String msg = JavaVersionUtils.getUnsupportedAgentJavaSpecVersionMessage(JavaVersionUtils.JAVA_18);
assertThat(msg, containsString(JavaVersionUtils.JAVA_18));
assertThat(msg, containsString("Java greater than 17."));
String msg = JavaVersionUtils.getUnsupportedAgentJavaSpecVersionMessage(JavaVersionUtils.JAVA_19);
assertThat(msg, containsString(JavaVersionUtils.JAVA_19));
assertThat(msg, containsString("Java greater than 18."));
}

@Test
Expand Down