Sitespeed.io: Is Slack integration fully functional?

Created on 6 Oct 2016  路  9Comments  路  Source: sitespeedio/sitespeed.io

Hi...I receive the following error when doing a simple slack example. Am I doing something wrong?

c:\sitespeed\sitespeed.io\bin>node sitespeed.js http://www.google.com --slack.hookUrl http
s://hooks.slack.com/services/.../.../...
[2016-10-06 07:41:06] Versions OS: win32 6.1.7601 nodejs: v4.4.4 sitespeed.io: 4.0.0-beta.
4 browsertime: 1.0.0-beta.6 coach: 0.27.1
[2016-10-06 07:41:08] Starting chrome for analysing http://www.google.com 3 time(s)
[2016-10-06 07:41:08] Testing url http://www.google.com run 1
[2016-10-06 07:41:15] Testing url http://www.google.com run 2
[2016-10-06 07:41:21] Testing url http://www.google.com run 3
[2016-10-06 07:41:27] Render HTML for 1 page(s)
[2016-10-06 07:41:28] HTML stored in c:\sitespeed\sitespeed.io\bin\sitespeed-result\www.go
ogle.com\2016-10-06-07-41-06
Warning: a promise was rejected with a non-error: [object Object]
    at runOptionalFunction (c:\sitespeed\sitespeed.io\lib\sitespeed.js:38:6)
    at c:\sitespeed\sitespeed.io\lib\sitespeed.js:104:32
From previous event:
    at c:\sitespeed\sitespeed.io\lib\sitespeed.js:104:16
    at processImmediate [as _immediateCallback] (timers.js:383:17)
From previous event:
    at c:\sitespeed\sitespeed.io\lib\sitespeed.js:89:12
From previous event:
    at Object.run (c:\sitespeed\sitespeed.io\lib\sitespeed.js:86:8)
    at c:\sitespeed\sitespeed.io\bin\sitespeed.js:25:22
From previous event:
    at Object.<anonymous> (c:\sitespeed\sitespeed.io\bin\sitespeed.js:24:4)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Function.Module.runMain (module.js:441:10)
    at startup (node.js:139:18)
    at node.js:968:3

Warning: a promise was rejected with a non-error: [object Object]
    at c:\sitespeed\sitespeed.io\lib\sitespeed.js:104:16
    at processImmediate [as _immediateCallback] (timers.js:383:17)
From previous event:
    at c:\sitespeed\sitespeed.io\lib\sitespeed.js:89:12
From previous event:
    at Object.run (c:\sitespeed\sitespeed.io\lib\sitespeed.js:86:8)
    at c:\sitespeed\sitespeed.io\bin\sitespeed.js:25:22
From previous event:
    at Object.<anonymous> (c:\sitespeed\sitespeed.io\bin\sitespeed.js:24:4)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Function.Module.runMain (module.js:441:10)
    at startup (node.js:139:18)
    at node.js:968:3

[2016-10-06 07:41:28] Error [object Object]
Warning: a promise was rejected with a non-error: [object Object]
    at processImmediate [as _immediateCallback] (timers.js:383:17)
From previous event:
    at Object.run (c:\sitespeed\sitespeed.io\lib\sitespeed.js:113:13)
    at c:\sitespeed\sitespeed.io\bin\sitespeed.js:25:22
From previous event:
    at Object.<anonymous> (c:\sitespeed\sitespeed.io\bin\sitespeed.js:24:4)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Function.Module.runMain (module.js:441:10)
    at startup (node.js:139:18)
    at node.js:968:3
bug

All 9 comments

I thought so but apparently not :) I tried on my local now and it worked, let me see if I or @tobli can make the logging better tonight.

I cannot reproduce the issue on 4.0.0-beta.4@node-v6.7.0 but I think there are a couple of other issues as well:

  • CLI options for channel are missing e.g:
    .option('slack.channel', {
      describe: 'Send the status to this channel',
      group: 'Slack'
    })
  • Passing channel name via the cli (osx, iterm2, oh my zsh), I'm seeing the same behaviour for the docker image 4.0-beta.4, --slack.channel #team-infra resolves to
channel: true

Removing # works since it'll be added by the slack plugin.

_EDIT_ this is probably related to yargs passing this --slack.channel=#team-infra resolved correctly and the same goes for when I'm passing --slack.channel #team-infra as arguments inside WebStorm?

_EDIT_ the reason why --slack.channel #team-infra become true is because #team-infra is treated as inline comment, escaping solves the issue \#team-infra.

  • The slack plugin defaults to #general then it's not possible to use the default channel specified when creating the web-hook in slack. A better approach would perhaps be to no pass a channel if not specified and in that way, default to the one specified in slack.
    screen shot 2016-10-10 at 23 17 40

Yes, cool let us remove the default channel. The cli is fixed in master, however # in front of the will not work, lets fix that too.

Since we're closing in on 4.0 and that the api will be fixed after that I have some questions about the types, e.g:
https://github.com/sitespeedio/sitespeed.io/blob/master/lib/plugins/slack/index.js#L39

We're having url, summary, both what if another type is added? Then both can display all of them but it's perhaps miss leading. Another option is to display all of them as default and take an array of types as arguments, then we're not coupled to a number of types. If we'll need a default summary could be added as a default e.g. ['summary']

@soulgalore @orjan following the latest update this morning, when I run the same command I am getting a different error now and my html files are not generated:

c:\sitespeed\sitespeed.io\bin>node sitespeed.js http://www.google.com --slack.hookUrl http
s://hooks.slack.com/services/xxxxxxx/xxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxx
[2016-10-11 07:39:25] Versions OS: win32 6.1.7601 nodejs: v4.4.4 sitespeed.io: 4.0.0-beta.
4 browsertime: 1.0.0-beta.6 coach: 0.27.1
[2016-10-11 07:39:26] Starting chrome for analysing http://www.google.com 3 time(s)
[2016-10-11 07:39:26] Testing url http://www.google.com run 1
[2016-10-11 07:39:33] Testing url http://www.google.com run 2
[2016-10-11 07:39:39] Testing url http://www.google.com run 3
[2016-10-11 07:39:45] Render HTML for 1 page(s)
[2016-10-11 07:39:46] TypeError: Cannot read property 'startsWith' of undefined
    at Object.close (c:\sitespeed\sitespeed.io\lib\plugins\slack\index.js:32:30)
    at c:\sitespeed\sitespeed.io\lib\sitespeed.js:38:49
From previous event:
    at runOptionalFunction (c:\sitespeed\sitespeed.io\lib\sitespeed.js:38:6)
    at c:\sitespeed\sitespeed.io\lib\sitespeed.js:104:32
From previous event:
    at c:\sitespeed\sitespeed.io\lib\sitespeed.js:104:16
    at processImmediate [as _immediateCallback] (timers.js:383:17)
From previous event:
    at c:\sitespeed\sitespeed.io\lib\sitespeed.js:89:12
From previous event:
    at Object.run (c:\sitespeed\sitespeed.io\lib\sitespeed.js:86:8)
    at c:\sitespeed\sitespeed.io\bin\sitespeed.js:25:22
    at FSReqWrap.oncomplete (fs.js:82:15)
From previous event:
    at Object.<anonymous> (c:\sitespeed\sitespeed.io\bin\sitespeed.js:24:4)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Function.Module.runMain (module.js:441:10)
    at startup (node.js:139:18)
    at node.js:968:3

Running the same command but without the slack switch works as normal.

I upgraded node to v6.7.0 and now I get:

[2016-10-11 07:52:38] Versions OS: win32 6.1.7601 nodejs: v6.7.0 sitespeed.io: 4.0.0-beta.
4 browsertime: 1.0.0-beta.6 coach: 0.27.1
[2016-10-11 07:52:39] Starting chrome for analysing http://www.google.com 3 time(s)
[2016-10-11 07:52:39] Testing url http://www.google.com run 1
[2016-10-11 07:52:46] Testing url http://www.google.com run 2
[2016-10-11 07:52:51] Testing url http://www.google.com run 3
[2016-10-11 07:52:58] Render HTML for 1 page(s)
[2016-10-11 07:52:59] TypeError: Cannot read property 'startsWith' of undefined
    at Object.close (c:\sitespeed\sitespeed.io\lib\plugins\slack\index.js:32:30)
    at Promise.resolve.filter.map (c:\sitespeed\sitespeed.io\lib\sitespeed.js:38:49)
From previous event:
    at runOptionalFunction (c:\sitespeed\sitespeed.io\lib\sitespeed.js:38:6)
    at runOptionalFunction.then.then.tap (c:\sitespeed\sitespeed.io\lib\sitespeed.js:104:3
2)
From previous event:
    at loader.loadPlugins.then (c:\sitespeed\sitespeed.io\lib\sitespeed.js:104:16)
    at runCallback (timers.js:574:20)
    at tryOnImmediate (timers.js:554:5)
    at processImmediate [as _immediateCallback] (timers.js:533:5)
From previous event:
    at storageManager.createDataDir.then.then.then.then (c:\sitespeed\sitespeed.io\lib\sit
espeed.js:89:12)
From previous event:
    at Object.run (c:\sitespeed\sitespeed.io\lib\sitespeed.js:86:8)
    at loader.parsePluginNames.then (c:\sitespeed\sitespeed.io\bin\sitespeed.js:25:22)
    at FSReqWrap.oncomplete (fs.js:123:15)
From previous event:
    at Object.<anonymous> (c:\sitespeed\sitespeed.io\bin\sitespeed.js:24:4)
    at Module._compile (module.js:556:32)
    at Object.Module._extensions..js (module.js:565:10)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)
    at Module.runMain (module.js:590:10)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:509:3

@rschoessler if you are on master, try adding _--slack.channel general_ there's a bug omitting the channel, see the merge request above #1242

adding _--slack.channel _ corrected the problem.

This should work now.

Was this page helpful?
0 / 5 - 0 ratings