From e085aff9730133f988e344fe603c4428f975ccde Mon Sep 17 00:00:00 2001 From: Luke Roy Date: Wed, 2 Jun 2021 11:46:56 +0200 Subject: [PATCH 1/2] Update Swift Watson action Tests (swift 4.2) to use the Watson service URL testWatsonActionSDK1.swift, testWatsonActionCodableSDK1.swift --- .../dat/actions/integration/testWatsonActionCodableSDK1.swift | 3 ++- tests/dat/actions/integration/testWatsonActionSDK1.swift | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/dat/actions/integration/testWatsonActionCodableSDK1.swift b/tests/dat/actions/integration/testWatsonActionCodableSDK1.swift index f472b39..c58b4ff 100644 --- a/tests/dat/actions/integration/testWatsonActionCodableSDK1.swift +++ b/tests/dat/actions/integration/testWatsonActionCodableSDK1.swift @@ -6,13 +6,14 @@ import LanguageTranslatorV3 struct Input: Codable { let username: String let password: String - let url: String? + let url: String } struct Output: Codable { let translation: String } func main(param: Input, completion: @escaping (Output?, Error?) -> Void) -> Void { let languageTranslator = LanguageTranslator(username: param.username , password: param.password, version: "2018-09-16") + languageTranslator.serviceURL = param.url languageTranslator.translate(text: ["Hello"], source: "en", target: "it") { (response, error) in if let error = error { print(error) diff --git a/tests/dat/actions/integration/testWatsonActionSDK1.swift b/tests/dat/actions/integration/testWatsonActionSDK1.swift index c443461..615ffa4 100644 --- a/tests/dat/actions/integration/testWatsonActionSDK1.swift +++ b/tests/dat/actions/integration/testWatsonActionSDK1.swift @@ -5,8 +5,9 @@ func main(args: [String:Any]) -> [String:Any] { let _whisk_semaphore = DispatchSemaphore(value: 0) let username = args["username"] as! String let password = args["password"] as! String + let url = args["url"] as! String let languageTranslator = LanguageTranslator(username: username, password: password, version: "2018-09-16") - + languageTranslator.serviceURL = url languageTranslator.translate(text: ["Hello"], source: "en", target: "it" ) { (response, error) in if let error = error { From 45a0048b9468a307665e17e52d2f140f0db913d4 Mon Sep 17 00:00:00 2001 From: Luke Roy Date: Wed, 2 Jun 2021 12:07:33 +0200 Subject: [PATCH 2/2] Remove Swift 4.1 From Swift Runtime by removing the entrys form the following files: - .travis.yml - ansible/environments/local/group_vars/all - settings.gradle - dified: tests/build.gradle - remove swift:4.1 entry from tools/travis/build.sh --- .travis.yml | 2 +- ansible/environments/local/group_vars/all | 5 ----- settings.gradle | 2 +- tests/build.gradle | 16 ++++++++++++++++ tools/travis/build.sh | 1 - 5 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index a8eba16..f9e35c8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,7 +27,7 @@ deploy: all_branches: true repo: ibm-functions/runtime-swift - provider: script - script: "./tools/travis/publish.sh ibmfunctions 4.1 master && ./tools/travis/publish.sh ibmfunctions 4.2 master " + script: "./tools/travis/publish.sh ibmfunctions 4.2 master " on: branch: master repo: ibm-functions/runtime-swift diff --git a/ansible/environments/local/group_vars/all b/ansible/environments/local/group_vars/all index bf16a46..822d6b6 100755 --- a/ansible/environments/local/group_vars/all +++ b/ansible/environments/local/group_vars/all @@ -37,11 +37,6 @@ runtimes_manifest: name: "nodejs6action" deprecated: false swift: - - kind: "swift:4.1" - default: false - image: - name: "action-swift-v4.1" - deprecated: false - kind: "swift:4.2" default: true image: diff --git a/settings.gradle b/settings.gradle index 16da88b..017be76 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,6 +1,6 @@ include 'tests' -include 'swift4.1' +// include 'swift4.1' include 'swift4.2' rootProject.name = 'runtime-swift-ibm' diff --git a/tests/build.gradle b/tests/build.gradle index 3c3b96b..2c1676d 100644 --- a/tests/build.gradle +++ b/tests/build.gradle @@ -20,11 +20,19 @@ tasks.withType(Test) { task testWithoutCredentials(type: Test) { exclude '**/*Credentials*' + + // Exclude the swift:4.1 tests as it is deprecated for the blueDeployment. + // Once swift:4.1 is fully removed from this repo, the exclude can also be removed. + exclude '**/*Swift41*' } // intended for mainBlueWhisk pipeline task testBlueCI(type: Test) { exclude 'runtime/sdk/**' + + // Exclude the swift:4.1 tests as it is deprecated for the blueDeployment. + // Once swift:4.1 is fully removed from this repo, the exclude can also be removed. + exclude '**/*Swift41*' } task testBlueDeployment(type: Test) { @@ -38,10 +46,18 @@ task testBlueDeployment(type: Test) { task testSDK(type: Test) { include 'runtime/sdk/**' + + // Exclude the swift:4.1 tests as it is deprecated for the blueDeployment. + // Once swift:4.1 is fully removed from this repo, the exclude can also be removed. + exclude '**/*Swift41*' } task testWithoutSDK(type: Test) { exclude 'runtime/sdk/**' + + // Exclude the swift:4.1 tests as it is deprecated for the blueDeployment. + // Once swift:4.1 is fully removed from this repo, the exclude can also be removed. + exclude '**/*Swift41*' } dependencies { diff --git a/tools/travis/build.sh b/tools/travis/build.sh index 3c02678..398ca14 100755 --- a/tools/travis/build.sh +++ b/tools/travis/build.sh @@ -38,6 +38,5 @@ docker version # Build runtime cd $ROOTDIR TERM=dumb ./gradlew \ -:swift4.1:distDocker \ :swift4.2:distDocker \ -PdockerImagePrefix=${IMAGE_PREFIX}