Exemplo n.º 1
0
  function index(){
    const head = is.arr(globals) ? globals.join('\n') : globals
        , html = file(local(`./client/${runner}/index.html`))
            .replace('<!-- { extra scripts } -->', head || '')

    return (req, res) => res.send(html)
  }
Exemplo n.º 2
0
  function reload(uid) { 
    const uids = uid ? [uid] : ripple.server.ws.sockets.map(d => d.platform.uid)
    
    uids
      .map(uid => update(`${uid}.stats.running`, true)(ripple('results')))

    const agents = ripple.server.ws.sockets
      .filter(not(by('handshake.url', '/dashboard')))
      .filter(by('platform.uid', is.in(uids)))
      .map(emitReload)
      .length 

    log('reloading', str(agents).cyan, 'agents', uid || '')
  }
Exemplo n.º 3
0
  function generate() {
    log('generating tests')

    const bundle = write(local('./client/tests.js'))
        , stream = is.fn(tests) 
            ? tests()
            : run('sh', ['-c', tests], { stdio: 'pipe' })

    if (stream.stderr) 
      stream.stderr.pipe(process.stderr)

    ;((stream.stdout || stream)
      .on('end', debounce(500)(reload))
      .pipe(bundle)
      .flow || noop)()
  }
Exemplo n.º 4
0
const canonical = farm => browser => is.str(browser) 
  ? farms[farm].browsers[browser]
  : browser