From 85818a7d98e9c1dcb9fc88e186ceee001409aac1 Mon Sep 17 00:00:00 2001 From: "ning.yougang" Date: Tue, 2 Aug 2022 09:06:31 +0800 Subject: [PATCH 1/5] Use jcenter together --- build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/build.gradle b/build.gradle index 26f542d7..1c0c6e0e 100644 --- a/build.gradle +++ b/build.gradle @@ -18,6 +18,7 @@ buildscript { repositories { jcenter() + mavenCentral() } dependencies { classpath "cz.alenkacz:gradle-scalafmt:${gradle.scalafmt.version}" From 0f9ca5e84d53373e7b87d6e465b104af41c58817 Mon Sep 17 00:00:00 2001 From: "ning.yougang" Date: Tue, 2 Aug 2022 11:40:51 +0800 Subject: [PATCH 2/5] Solve issue: note: module requires Go 1.18 --- golang1.17/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/golang1.17/Dockerfile b/golang1.17/Dockerfile index 9deecdad..d16866f1 100644 --- a/golang1.17/Dockerfile +++ b/golang1.17/Dockerfile @@ -38,7 +38,7 @@ RUN echo "deb http://deb.debian.org/debian buster-backports main contrib non-fre librdkafka-dev=0.11.6-1.1 &&\ # Cleanup apt data, we do not need them later on. apt-get clean && rm -rf /var/lib/apt/lists/* &&\ - go get -u github.com/go-delve/delve/cmd/dlv@v1.8.1 &&\ + go install github.com/go-delve/delve/cmd/dlv@v1.8.1 &&\ mkdir /action WORKDIR /action From 39e100308dbb401535ea9ad0a8d376a49c1f7183 Mon Sep 17 00:00:00 2001 From: "ning.yougang" Date: Tue, 2 Aug 2022 20:45:13 +0800 Subject: [PATCH 3/5] Upgrade gradle to 6.9.1 --- gradle/wrapper/gradle-wrapper.properties | 2 +- gradlew | 4 ++-- gradlew.bat | 4 ++-- tests/build.gradle | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index d475d272..235e07d2 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -18,4 +18,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.5.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.1-bin.zip diff --git a/gradlew b/gradlew index d4ee78f8..8e25e6c1 100755 --- a/gradlew +++ b/gradlew @@ -7,7 +7,7 @@ # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, @@ -44,7 +44,7 @@ APP_NAME="Gradle" APP_BASE_NAME=`basename "$0"` # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8' +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" diff --git a/gradlew.bat b/gradlew.bat index ad0ff10f..9618d8d9 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -5,7 +5,7 @@ @rem you may not use this file except in compliance with the License. @rem You may obtain a copy of the License at @rem -@rem http://www.apache.org/licenses/LICENSE-2.0 +@rem https://www.apache.org/licenses/LICENSE-2.0 @rem @rem Unless required by applicable law or agreed to in writing, software @rem distributed under the License is distributed on an "AS IS" BASIS, @@ -30,7 +30,7 @@ set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome diff --git a/tests/build.gradle b/tests/build.gradle index 09adf178..de9e0e07 100644 --- a/tests/build.gradle +++ b/tests/build.gradle @@ -34,9 +34,9 @@ tasks.withType(Test) { } dependencies { - compile "org.scala-lang:scala-library:${gradle.scala.version}" - compile "org.apache.openwhisk:openwhisk-tests:${gradle.openwhisk.version}:tests" - compile "org.apache.openwhisk:openwhisk-tests:${gradle.openwhisk.version}:test-sources" + implementation "org.scala-lang:scala-library:${gradle.scala.version}" + implementation "org.apache.openwhisk:openwhisk-tests:${gradle.openwhisk.version}:tests" + implementation "org.apache.openwhisk:openwhisk-tests:${gradle.openwhisk.version}:test-sources" implementation group: 'com.typesafe.akka', name: "akka-http2-support_${gradle.scala.depVersion}", version: "${gradle.akka_http.version}" implementation group: 'com.typesafe.akka', name: "akka-http-xml_${gradle.scala.depVersion}", version: "${gradle.akka_http.version}" implementation group: 'com.typesafe.akka', name: "akka-discovery_${gradle.scala.depVersion}", version: "${gradle.akka.version}" From c0731bcf06967a0e63bea6661d0206fa146e2015 Mon Sep 17 00:00:00 2001 From: "ning.yougang" Date: Wed, 3 Aug 2022 10:33:34 +0800 Subject: [PATCH 4/5] Fix junit issue --- tests/build.gradle | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/build.gradle b/tests/build.gradle index de9e0e07..b718fb84 100644 --- a/tests/build.gradle +++ b/tests/build.gradle @@ -34,7 +34,10 @@ tasks.withType(Test) { } dependencies { + implementation "junit:junit:4.11" implementation "org.scala-lang:scala-library:${gradle.scala.version}" + implementation "org.scalatest:scalatest_${gradle.scala.depVersion}:3.0.8" + implementation "org.apache.openwhisk:openwhisk-common:${gradle.openwhisk.version}" implementation "org.apache.openwhisk:openwhisk-tests:${gradle.openwhisk.version}:tests" implementation "org.apache.openwhisk:openwhisk-tests:${gradle.openwhisk.version}:test-sources" implementation group: 'com.typesafe.akka', name: "akka-http2-support_${gradle.scala.depVersion}", version: "${gradle.akka_http.version}" From 6237f30d0c10f968386494da022fabd7264ab26d Mon Sep 17 00:00:00 2001 From: "ning.yougang" Date: Wed, 3 Aug 2022 13:25:29 +0800 Subject: [PATCH 5/5] Fix test case error --- openwhisk/runHandler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openwhisk/runHandler.go b/openwhisk/runHandler.go index 3a167813..ea8bc5d3 100644 --- a/openwhisk/runHandler.go +++ b/openwhisk/runHandler.go @@ -84,7 +84,7 @@ func (ap *ActionProxy) runHandler(w http.ResponseWriter, r *http.Request) { var objmap map[string]*json.RawMessage err = json.Unmarshal(response, &objmap) if err != nil { - sendError(w, http.StatusBadGateway, "The action did not return a dictionary.") + sendError(w, http.StatusBadGateway, "The action did not return a dictionary or array.") return }