From 823f87a8a3fe4144bcf60e7749a84a06ff191881 Mon Sep 17 00:00:00 2001 From: Grant Timmerman Date: Mon, 27 Sep 2021 14:37:53 -0700 Subject: [PATCH 01/11] ci: java17 Signed-off-by: Grant Timmerman --- .github/workflows/unit.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit.yaml b/.github/workflows/unit.yaml index f93c38fb..e195855a 100644 --- a/.github/workflows/unit.yaml +++ b/.github/workflows/unit.yaml @@ -13,7 +13,7 @@ jobs: 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 }} - name: Build with Maven From 7a94544460ac9e5d8a923dcb014868e85bad50f3 Mon Sep 17 00:00:00 2001 From: Grant Timmerman Date: Mon, 27 Sep 2021 14:40:44 -0700 Subject: [PATCH 02/11] ci: use temurin distro Signed-off-by: Grant Timmerman --- .github/workflows/unit.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/unit.yaml b/.github/workflows/unit.yaml index e195855a..18c24b77 100644 --- a/.github/workflows/unit.yaml +++ b/.github/workflows/unit.yaml @@ -16,6 +16,7 @@ jobs: 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 From ea881ad66881b277d092af14d4bc5b8c588d01b6 Mon Sep 17 00:00:00 2001 From: Grant Timmerman Date: Mon, 27 Sep 2021 14:42:42 -0700 Subject: [PATCH 03/11] ci: enable 17 Signed-off-by: Grant Timmerman --- .github/workflows/unit.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/unit.yaml b/.github/workflows/unit.yaml index 18c24b77..651abefe 100644 --- a/.github/workflows/unit.yaml +++ b/.github/workflows/unit.yaml @@ -7,8 +7,7 @@ jobs: matrix: java: [ 11.x - # 12.x, - # 13.x + 17.x ] steps: - uses: actions/checkout@v2 From 72cca18bfc03047db27e5b9f8bab7736a295daef Mon Sep 17 00:00:00 2001 From: Grant Timmerman Date: Mon, 27 Sep 2021 14:43:27 -0700 Subject: [PATCH 04/11] ci: enable 17 (typo) Signed-off-by: Grant Timmerman --- .github/workflows/unit.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit.yaml b/.github/workflows/unit.yaml index 651abefe..b7446355 100644 --- a/.github/workflows/unit.yaml +++ b/.github/workflows/unit.yaml @@ -6,7 +6,7 @@ jobs: strategy: matrix: java: [ - 11.x + 11.x, 17.x ] steps: From 5a259a0557389125e6810177fcbed2c98993bc06 Mon Sep 17 00:00:00 2001 From: Grant Timmerman Date: Mon, 27 Sep 2021 14:46:02 -0700 Subject: [PATCH 05/11] ci: disable 17 for now Signed-off-by: Grant Timmerman --- .github/workflows/unit.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/unit.yaml b/.github/workflows/unit.yaml index b7446355..83a0ddae 100644 --- a/.github/workflows/unit.yaml +++ b/.github/workflows/unit.yaml @@ -6,8 +6,8 @@ jobs: strategy: matrix: java: [ - 11.x, - 17.x + 11.x + # 17.x ] steps: - uses: actions/checkout@v2 From 488608ae9b35cb74af6b6d8e5cd04622844afcdc Mon Sep 17 00:00:00 2001 From: Grant Timmerman Date: Tue, 28 Sep 2021 16:05:21 -0700 Subject: [PATCH 06/11] ci: disable 17 for background tests Signed-off-by: Grant Timmerman --- .../cloud/functions/invoker/IntegrationTest.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/invoker/core/src/test/java/com/google/cloud/functions/invoker/IntegrationTest.java b/invoker/core/src/test/java/com/google/cloud/functions/invoker/IntegrationTest.java index c6052339..ecc95707 100644 --- a/invoker/core/src/test/java/com/google/cloud/functions/invoker/IntegrationTest.java +++ b/invoker/core/src/test/java/com/google/cloud/functions/invoker/IntegrationTest.java @@ -355,12 +355,18 @@ public void stackDriverLogging() throws Exception { @Test public void background() throws Exception { - backgroundTest("BackgroundSnoop"); + // Only enable background tests for < 17 + if (Integer.valueOf(System.getProperty("java.version")) < 17) { + backgroundTest("BackgroundSnoop"); + } } @Test public void typedBackground() throws Exception { - backgroundTest("TypedBackgroundSnoop"); + // Only enable background tests for < 17 + if (Integer.valueOf(System.getProperty("java.version")) < 17) { + backgroundTest("TypedBackgroundSnoop"); + } } private void backgroundTest(String target) throws Exception { From 0eeb3b1a76159b30890bd4588643d58725368ab9 Mon Sep 17 00:00:00 2001 From: Grant Timmerman Date: Tue, 28 Sep 2021 16:06:14 -0700 Subject: [PATCH 07/11] ci: enable 17 Signed-off-by: Grant Timmerman --- .github/workflows/unit.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/unit.yaml b/.github/workflows/unit.yaml index 83a0ddae..b7446355 100644 --- a/.github/workflows/unit.yaml +++ b/.github/workflows/unit.yaml @@ -6,8 +6,8 @@ jobs: strategy: matrix: java: [ - 11.x - # 17.x + 11.x, + 17.x ] steps: - uses: actions/checkout@v2 From 2e0652d9f697a05e832279f40e6b5a561664e5d1 Mon Sep 17 00:00:00 2001 From: Grant Timmerman Date: Tue, 28 Sep 2021 16:11:00 -0700 Subject: [PATCH 08/11] ci: better jdk version parsing Signed-off-by: Grant Timmerman --- invoker/core/.factorypath | 28 ++++++++ .../functions/invoker/IntegrationTest.java | 14 +++- invoker/function-maven-plugin/.factorypath | 64 +++++++++++++++++++ 3 files changed, 104 insertions(+), 2 deletions(-) create mode 100644 invoker/core/.factorypath create mode 100644 invoker/function-maven-plugin/.factorypath diff --git a/invoker/core/.factorypath b/invoker/core/.factorypath new file mode 100644 index 00000000..13bea6cc --- /dev/null +++ b/invoker/core/.factorypath @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/invoker/core/src/test/java/com/google/cloud/functions/invoker/IntegrationTest.java b/invoker/core/src/test/java/com/google/cloud/functions/invoker/IntegrationTest.java index ecc95707..2bde4faa 100644 --- a/invoker/core/src/test/java/com/google/cloud/functions/invoker/IntegrationTest.java +++ b/invoker/core/src/test/java/com/google/cloud/functions/invoker/IntegrationTest.java @@ -353,10 +353,20 @@ 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 { // Only enable background tests for < 17 - if (Integer.valueOf(System.getProperty("java.version")) < 17) { + if (getJavaVersion() < 17) { backgroundTest("BackgroundSnoop"); } } @@ -364,7 +374,7 @@ public void background() throws Exception { @Test public void typedBackground() throws Exception { // Only enable background tests for < 17 - if (Integer.valueOf(System.getProperty("java.version")) < 17) { + if (getJavaVersion() < 17) { backgroundTest("TypedBackgroundSnoop"); } } diff --git a/invoker/function-maven-plugin/.factorypath b/invoker/function-maven-plugin/.factorypath new file mode 100644 index 00000000..dde5e939 --- /dev/null +++ b/invoker/function-maven-plugin/.factorypath @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 69ab449fd19ffbe3a4f60c7e1cf5516da39c5592 Mon Sep 17 00:00:00 2001 From: Grant Timmerman Date: Tue, 28 Sep 2021 16:11:20 -0700 Subject: [PATCH 09/11] ci: better jdk version parsing Signed-off-by: Grant Timmerman --- invoker/core/.factorypath | 28 ---------- invoker/function-maven-plugin/.factorypath | 64 ---------------------- 2 files changed, 92 deletions(-) delete mode 100644 invoker/core/.factorypath delete mode 100644 invoker/function-maven-plugin/.factorypath diff --git a/invoker/core/.factorypath b/invoker/core/.factorypath deleted file mode 100644 index 13bea6cc..00000000 --- a/invoker/core/.factorypath +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/invoker/function-maven-plugin/.factorypath b/invoker/function-maven-plugin/.factorypath deleted file mode 100644 index dde5e939..00000000 --- a/invoker/function-maven-plugin/.factorypath +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From 34f22385a06f59439db259cdb05d21ede5e7bec6 Mon Sep 17 00:00:00 2001 From: Grant Timmerman Date: Tue, 28 Sep 2021 16:18:56 -0700 Subject: [PATCH 10/11] ci: minor linting Signed-off-by: Grant Timmerman --- .../com/google/cloud/functions/invoker/IntegrationTest.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/invoker/core/src/test/java/com/google/cloud/functions/invoker/IntegrationTest.java b/invoker/core/src/test/java/com/google/cloud/functions/invoker/IntegrationTest.java index 2bde4faa..fdcf817c 100644 --- a/invoker/core/src/test/java/com/google/cloud/functions/invoker/IntegrationTest.java +++ b/invoker/core/src/test/java/com/google/cloud/functions/invoker/IntegrationTest.java @@ -355,11 +355,13 @@ public void stackDriverLogging() throws Exception { private static int getJavaVersion() { String version = System.getProperty("java.version"); - if(version.startsWith("1.")) { + if (version.startsWith("1.")) { version = version.substring(2, 3); } else { int dot = version.indexOf("."); - if(dot != -1) { version = version.substring(0, dot); } + if (dot != -1) { + version = version.substring(0, dot); + } } return Integer.parseInt(version); } From 555dd53b6fc7d6c0cc87fd633a80997c09107ce4 Mon Sep 17 00:00:00 2001 From: Grant Timmerman Date: Thu, 30 Sep 2021 10:56:43 -0700 Subject: [PATCH 11/11] docs: add TODO for disabled java17 tests Signed-off-by: Grant Timmerman --- .../com/google/cloud/functions/invoker/IntegrationTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/invoker/core/src/test/java/com/google/cloud/functions/invoker/IntegrationTest.java b/invoker/core/src/test/java/com/google/cloud/functions/invoker/IntegrationTest.java index fdcf817c..051358f8 100644 --- a/invoker/core/src/test/java/com/google/cloud/functions/invoker/IntegrationTest.java +++ b/invoker/core/src/test/java/com/google/cloud/functions/invoker/IntegrationTest.java @@ -367,7 +367,7 @@ private static int getJavaVersion() { @Test public void background() throws Exception { - // Only enable background tests for < 17 + // TODO: Only enable background tests for < 17 if (getJavaVersion() < 17) { backgroundTest("BackgroundSnoop"); } @@ -375,7 +375,7 @@ public void background() throws Exception { @Test public void typedBackground() throws Exception { - // Only enable background tests for < 17 + // TODO: Only enable background tests for < 17 if (getJavaVersion() < 17) { backgroundTest("TypedBackgroundSnoop"); }