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

Commit 680a6fd

Browse files
committed
fix for wsk api tests against non-local openwhisk
Fixes #981
1 parent 8e8fc7b commit 680a6fd

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

app/content/js/repl.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1043,7 +1043,7 @@ self.exec = (commandUntrimmed, execOptions) => {
10431043
}
10441044
})
10451045
.catch(err => {
1046-
console.error('error in command execution', err)
1046+
// console.error('error in command execution', err)
10471047

10481048
if (ui.headless) {
10491049
throw err

tests/tests/passes/04/apis.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,19 @@ describe('Create api gateway', function() {
6060
.then(res => cli.expectOKWithOnly('/hello/world')(res)
6161
.then(() => res.count)
6262
.then(N => this.app.client.getAttribute(`${ui.selectors.LIST_RESULTS_N(N)} [data-key="url"]`, "data-value")))
63+
64+
// for localhost openwhisk, we have to make sure that the href is of the form http://${apihost}/...
6365
.then(href => href.replace(/(http:\/\/)?172\.17\.0\.1/, ui.apiHost.replace(/http(s)?:\/\//, '')))
66+
.then(href => {
67+
if (!href.startsWith('http')) {
68+
return `http://${href}`
69+
} else {
70+
return href
71+
}
72+
})
6473
.then(href => { console.error('api href', href); return href; })
65-
.then(href => rp({ url: `http://${href}?foo=bar`, rejectUnauthorized: false }))
74+
75+
.then(href => rp({ url: `${href}?foo=bar`, rejectUnauthorized: false }))
6676
.then(ui.expectSubset({foo: 'bar'}))
6777
.catch(common.oops(this)))
6878
})

0 commit comments

Comments
 (0)