Skip to content
This repository was archived by the owner on Jan 17, 2025. It is now read-only.

Commit dc41530

Browse files
authored
Fix watson tests, remove swift:4.1 build and test. (#78)
* Update Swift Watson action Tests (swift 4.2) to use the Watson service URL testWatsonActionSDK1.swift, testWatsonActionCodableSDK1.swift * 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
1 parent eba752a commit dc41530

File tree

7 files changed

+22
-10
lines changed

7 files changed

+22
-10
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ deploy:
2727
all_branches: true
2828
repo: ibm-functions/runtime-swift
2929
- provider: script
30-
script: "./tools/travis/publish.sh ibmfunctions 4.1 master && ./tools/travis/publish.sh ibmfunctions 4.2 master "
30+
script: "./tools/travis/publish.sh ibmfunctions 4.2 master "
3131
on:
3232
branch: master
3333
repo: ibm-functions/runtime-swift

ansible/environments/local/group_vars/all

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,6 @@ runtimes_manifest:
3737
name: "nodejs6action"
3838
deprecated: false
3939
swift:
40-
- kind: "swift:4.1"
41-
default: false
42-
image:
43-
name: "action-swift-v4.1"
44-
deprecated: false
4540
- kind: "swift:4.2"
4641
default: true
4742
image:

settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
include 'tests'
22

3-
include 'swift4.1'
3+
// include 'swift4.1'
44
include 'swift4.2'
55

66
rootProject.name = 'runtime-swift-ibm'

tests/build.gradle

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,19 @@ tasks.withType(Test) {
2020

2121
task testWithoutCredentials(type: Test) {
2222
exclude '**/*Credentials*'
23+
24+
// Exclude the swift:4.1 tests as it is deprecated for the blueDeployment.
25+
// Once swift:4.1 is fully removed from this repo, the exclude can also be removed.
26+
exclude '**/*Swift41*'
2327
}
2428

2529
// intended for mainBlueWhisk pipeline
2630
task testBlueCI(type: Test) {
2731
exclude 'runtime/sdk/**'
32+
33+
// Exclude the swift:4.1 tests as it is deprecated for the blueDeployment.
34+
// Once swift:4.1 is fully removed from this repo, the exclude can also be removed.
35+
exclude '**/*Swift41*'
2836
}
2937

3038
task testBlueDeployment(type: Test) {
@@ -38,10 +46,18 @@ task testBlueDeployment(type: Test) {
3846

3947
task testSDK(type: Test) {
4048
include 'runtime/sdk/**'
49+
50+
// Exclude the swift:4.1 tests as it is deprecated for the blueDeployment.
51+
// Once swift:4.1 is fully removed from this repo, the exclude can also be removed.
52+
exclude '**/*Swift41*'
4153
}
4254

4355
task testWithoutSDK(type: Test) {
4456
exclude 'runtime/sdk/**'
57+
58+
// Exclude the swift:4.1 tests as it is deprecated for the blueDeployment.
59+
// Once swift:4.1 is fully removed from this repo, the exclude can also be removed.
60+
exclude '**/*Swift41*'
4561
}
4662

4763
dependencies {

tests/dat/actions/integration/testWatsonActionCodableSDK1.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@ import LanguageTranslatorV3
66
struct Input: Codable {
77
let username: String
88
let password: String
9-
let url: String?
9+
let url: String
1010
}
1111
struct Output: Codable {
1212
let translation: String
1313
}
1414
func main(param: Input, completion: @escaping (Output?, Error?) -> Void) -> Void {
1515
let languageTranslator = LanguageTranslator(username: param.username , password: param.password, version: "2018-09-16")
16+
languageTranslator.serviceURL = param.url
1617
languageTranslator.translate(text: ["Hello"], source: "en", target: "it") { (response, error) in
1718
if let error = error {
1819
print(error)

tests/dat/actions/integration/testWatsonActionSDK1.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ func main(args: [String:Any]) -> [String:Any] {
55
let _whisk_semaphore = DispatchSemaphore(value: 0)
66
let username = args["username"] as! String
77
let password = args["password"] as! String
8+
let url = args["url"] as! String
89
let languageTranslator = LanguageTranslator(username: username, password: password, version: "2018-09-16")
9-
10+
languageTranslator.serviceURL = url
1011

1112
languageTranslator.translate(text: ["Hello"], source: "en", target: "it" ) { (response, error) in
1213
if let error = error {

tools/travis/build.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,5 @@ docker version
3838
# Build runtime
3939
cd $ROOTDIR
4040
TERM=dumb ./gradlew \
41-
:swift4.1:distDocker \
4241
:swift4.2:distDocker \
4342
-PdockerImagePrefix=${IMAGE_PREFIX}

0 commit comments

Comments
 (0)