Skip to content
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
8 changes: 4 additions & 4 deletions .github/workflows/unit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ jobs:
strategy:
matrix:
java: [
11.x
# 12.x,
# 13.x
11.x,
17.x
]
steps:
- uses: actions/checkout@v2
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v1
uses: actions/setup-java@v2
with:
java-version: ${{ matrix.java }}
distribution: temurin
- name: Build with Maven
run: (cd functions-framework-api/ && mvn install)
- name: Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,14 +353,32 @@ public void stackDriverLogging() throws Exception {
fullTarget("Log"), ImmutableList.of(simpleTestCase, quotingTestCase, exceptionTestCase));
}

private static int getJavaVersion() {
String version = System.getProperty("java.version");
if (version.startsWith("1.")) {
version = version.substring(2, 3);
} else {
int dot = version.indexOf(".");
if (dot != -1) {
version = version.substring(0, dot);
}
} return Integer.parseInt(version);
}

@Test
public void background() throws Exception {
backgroundTest("BackgroundSnoop");
// TODO: Only enable background tests for < 17
if (getJavaVersion() < 17) {
backgroundTest("BackgroundSnoop");
}
}

@Test
public void typedBackground() throws Exception {
backgroundTest("TypedBackgroundSnoop");
// TODO: Only enable background tests for < 17
if (getJavaVersion() < 17) {
backgroundTest("TypedBackgroundSnoop");
}
}

private void backgroundTest(String target) throws Exception {
Expand Down