Skip to content

Commit

Permalink
updated run-tests for new paths
Browse files Browse the repository at this point in the history
  • Loading branch information
kroitor committed Oct 31, 2017
1 parent bb9ff34 commit 4bd79a6
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions run-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ const testExchange = async (exchange) => {
, allTests = [

{ language: 'JavaScript', key: '--js', exec: ['node', 'test/test.js', ...args] },
{ language: 'Python', key: '--python', exec: ['python2', 'test/test.py', ...args] },
{ language: 'Python 3', key: '--python3', exec: ['python3', 'test/test_async.py', ...args] },
{ language: 'PHP', key: '--php', exec: ['php', '-f', 'test/test.php', ...args] }
{ language: 'Python', key: '--python', exec: ['python2', 'python/test/test.py', ...args] },
{ language: 'Python 3', key: '--python3', exec: ['python3', 'python/test/test_async.py', ...args] },
{ language: 'PHP', key: '--php', exec: ['php', '-f', 'php/test/test.php', ...args] }
]
, selectedTests = allTests.filter (t => keys[t.key])
, scheduledTests = selectedTests.length ? selectedTests : allTests
Expand Down Expand Up @@ -177,18 +177,18 @@ const testExchange = async (exchange) => {
/* ------------------------------------------------------------------------ */

function TaskPool (maxConcurrency) {

const pending = []
, queue = []

let numActive = 0

return {

pending,

run (task) {

if (numActive >= maxConcurrency) { // queue task

return new Promise (resolve => queue.push (() => this.run (task).then (resolve)))
Expand All @@ -215,7 +215,7 @@ async function testAllExchanges () {

const taskPool = TaskPool (maxConcurrency)
const results = []

for (const exchange of exchanges) {
taskPool.run (() => testExchange (exchange).then (x => results.push (x)))
}
Expand Down

0 comments on commit 4bd79a6

Please sign in to comment.