diff --git a/packages/grpc-native-core/package.json b/packages/grpc-native-core/package.json index 44b029d6..4aa34635 100644 --- a/packages/grpc-native-core/package.json +++ b/packages/grpc-native-core/package.json @@ -34,8 +34,16 @@ "protobufjs": "^5.0.0" }, "devDependencies": { + "async": "^2.0.1", + "body-parser": "^1.15.2", "electron-mocha": "^3.1.1", - "istanbul": "^0.4.4" + "express": "^4.14.0", + "google-auth-library": "^0.9.2", + "google-protobuf": "^3.0.0", + "istanbul": "^0.4.4", + "lodash": "^4.17.4", + "minimist": "^1.1.0", + "poisson-process": "^0.2.1" }, "engines": { "node": ">=4" diff --git a/test/api/async_test.js b/packages/grpc-native-core/test/async_test.js similarity index 94% rename from test/api/async_test.js rename to packages/grpc-native-core/test/async_test.js index 86cd62e2..786e50bf 100644 --- a/test/api/async_test.js +++ b/packages/grpc-native-core/test/async_test.js @@ -20,9 +20,9 @@ var assert = require('assert'); -var grpc = require('../any_grpc'); +var grpc = require('..'); var math = grpc.load( - __dirname + '/../../packages/grpc-native-core/deps/grpc/src/proto/math/math.proto').math; + __dirname + '/../deps/grpc/src/proto/math/math.proto').math; /** diff --git a/test/api/credentials_test.js b/packages/grpc-native-core/test/credentials_test.js similarity index 98% rename from test/api/credentials_test.js rename to packages/grpc-native-core/test/credentials_test.js index f9bdefaf..58dddb50 100644 --- a/test/api/credentials_test.js +++ b/packages/grpc-native-core/test/credentials_test.js @@ -22,7 +22,7 @@ var assert = require('assert'); var fs = require('fs'); var path = require('path'); -var grpc = require('../any_grpc'); +var grpc = require('..'); /** * This is used for testing functions with multiple asynchronous calls that @@ -67,9 +67,9 @@ var fakeFailingGoogleCredentials = { var key_data, pem_data, ca_data; before(function() { - var key_path = path.join(__dirname, '../data/server1.key'); - var pem_path = path.join(__dirname, '../data/server1.pem'); - var ca_path = path.join(__dirname, '../data/ca.pem'); + var key_path = path.join(__dirname, '/data/server1.key'); + var pem_path = path.join(__dirname, '/data/server1.pem'); + var ca_path = path.join(__dirname, '/data/ca.pem'); key_data = fs.readFileSync(key_path); pem_data = fs.readFileSync(pem_path); ca_data = fs.readFileSync(ca_path); diff --git a/packages/grpc-native-core/test/data/README b/packages/grpc-native-core/test/data/README new file mode 100644 index 00000000..888d95b9 --- /dev/null +++ b/packages/grpc-native-core/test/data/README @@ -0,0 +1 @@ +CONFIRMEDTESTKEY diff --git a/packages/grpc-native-core/test/data/ca.pem b/packages/grpc-native-core/test/data/ca.pem new file mode 100644 index 00000000..6c8511a7 --- /dev/null +++ b/packages/grpc-native-core/test/data/ca.pem @@ -0,0 +1,15 @@ +-----BEGIN CERTIFICATE----- +MIICSjCCAbOgAwIBAgIJAJHGGR4dGioHMA0GCSqGSIb3DQEBCwUAMFYxCzAJBgNV +BAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX +aWRnaXRzIFB0eSBMdGQxDzANBgNVBAMTBnRlc3RjYTAeFw0xNDExMTEyMjMxMjla +Fw0yNDExMDgyMjMxMjlaMFYxCzAJBgNVBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0 +YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQxDzANBgNVBAMT +BnRlc3RjYTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAwEDfBV5MYdlHVHJ7 ++L4nxrZy7mBfAVXpOc5vMYztssUI7mL2/iYujiIXM+weZYNTEpLdjyJdu7R5gGUu +g1jSVK/EPHfc74O7AyZU34PNIP4Sh33N+/A5YexrNgJlPY+E3GdVYi4ldWJjgkAd +Qah2PH5ACLrIIC6tRka9hcaBlIECAwEAAaMgMB4wDAYDVR0TBAUwAwEB/zAOBgNV +HQ8BAf8EBAMCAgQwDQYJKoZIhvcNAQELBQADgYEAHzC7jdYlzAVmddi/gdAeKPau +sPBG/C2HCWqHzpCUHcKuvMzDVkY/MP2o6JIW2DBbY64bO/FceExhjcykgaYtCH/m +oIU63+CFOTtR7otyQAWHqXa7q4SbCDlG7DyRFxqG0txPtGvy12lgldA2+RgcigQG +Dfcog5wrJytaQ6UA0wE= +-----END CERTIFICATE----- diff --git a/packages/grpc-native-core/test/data/server1.key b/packages/grpc-native-core/test/data/server1.key new file mode 100644 index 00000000..143a5b87 --- /dev/null +++ b/packages/grpc-native-core/test/data/server1.key @@ -0,0 +1,16 @@ +-----BEGIN PRIVATE KEY----- +MIICdQIBADANBgkqhkiG9w0BAQEFAASCAl8wggJbAgEAAoGBAOHDFScoLCVJpYDD +M4HYtIdV6Ake/sMNaaKdODjDMsux/4tDydlumN+fm+AjPEK5GHhGn1BgzkWF+slf +3BxhrA/8dNsnunstVA7ZBgA/5qQxMfGAq4wHNVX77fBZOgp9VlSMVfyd9N8YwbBY +AckOeUQadTi2X1S6OgJXgQ0m3MWhAgMBAAECgYAn7qGnM2vbjJNBm0VZCkOkTIWm +V10okw7EPJrdL2mkre9NasghNXbE1y5zDshx5Nt3KsazKOxTT8d0Jwh/3KbaN+YY +tTCbKGW0pXDRBhwUHRcuRzScjli8Rih5UOCiZkhefUTcRb6xIhZJuQy71tjaSy0p +dHZRmYyBYO2YEQ8xoQJBAPrJPhMBkzmEYFtyIEqAxQ/o/A6E+E4w8i+KM7nQCK7q +K4JXzyXVAjLfyBZWHGM2uro/fjqPggGD6QH1qXCkI4MCQQDmdKeb2TrKRh5BY1LR +81aJGKcJ2XbcDu6wMZK4oqWbTX2KiYn9GB0woM6nSr/Y6iy1u145YzYxEV/iMwff +DJULAkB8B2MnyzOg0pNFJqBJuH29bKCcHa8gHJzqXhNO5lAlEbMK95p/P2Wi+4Hd +aiEIAF1BF326QJcvYKmwSmrORp85AkAlSNxRJ50OWrfMZnBgzVjDx3xG6KsFQVk2 +ol6VhqL6dFgKUORFUWBvnKSyhjJxurlPEahV6oo6+A+mPhFY8eUvAkAZQyTdupP3 +XEFQKctGz+9+gKkemDp7LBBMEMBXrGTLPhpEfcjv/7KPdnFHYmhYeBTBnuVmTVWe +F98XJ7tIFfJq +-----END PRIVATE KEY----- diff --git a/packages/grpc-native-core/test/data/server1.pem b/packages/grpc-native-core/test/data/server1.pem new file mode 100644 index 00000000..f3d43fcc --- /dev/null +++ b/packages/grpc-native-core/test/data/server1.pem @@ -0,0 +1,16 @@ +-----BEGIN CERTIFICATE----- +MIICnDCCAgWgAwIBAgIBBzANBgkqhkiG9w0BAQsFADBWMQswCQYDVQQGEwJBVTET +MBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50ZXJuZXQgV2lkZ2l0cyBQ +dHkgTHRkMQ8wDQYDVQQDEwZ0ZXN0Y2EwHhcNMTUxMTA0MDIyMDI0WhcNMjUxMTAx +MDIyMDI0WjBlMQswCQYDVQQGEwJVUzERMA8GA1UECBMISWxsaW5vaXMxEDAOBgNV +BAcTB0NoaWNhZ28xFTATBgNVBAoTDEV4YW1wbGUsIENvLjEaMBgGA1UEAxQRKi50 +ZXN0Lmdvb2dsZS5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAOHDFSco +LCVJpYDDM4HYtIdV6Ake/sMNaaKdODjDMsux/4tDydlumN+fm+AjPEK5GHhGn1Bg +zkWF+slf3BxhrA/8dNsnunstVA7ZBgA/5qQxMfGAq4wHNVX77fBZOgp9VlSMVfyd +9N8YwbBYAckOeUQadTi2X1S6OgJXgQ0m3MWhAgMBAAGjazBpMAkGA1UdEwQCMAAw +CwYDVR0PBAQDAgXgME8GA1UdEQRIMEaCECoudGVzdC5nb29nbGUuZnKCGHdhdGVy +em9vaS50ZXN0Lmdvb2dsZS5iZYISKi50ZXN0LnlvdXR1YmUuY29thwTAqAEDMA0G +CSqGSIb3DQEBCwUAA4GBAJFXVifQNub1LUP4JlnX5lXNlo8FxZ2a12AFQs+bzoJ6 +hM044EDjqyxUqSbVePK0ni3w1fHQB5rY9yYC5f8G7aqqTY1QOhoUk8ZTSTRpnkTh +y4jjdvTZeLDVBlueZUTDRmy2feY5aZIU18vFDK08dTG0A87pppuv1LNIR3loveU8 +-----END CERTIFICATE----- diff --git a/test/api/interop_sanity_test.js b/packages/grpc-native-core/test/interop_sanity_test.js similarity index 94% rename from test/api/interop_sanity_test.js rename to packages/grpc-native-core/test/interop_sanity_test.js index b3f65a03..0c413073 100644 --- a/test/api/interop_sanity_test.js +++ b/packages/grpc-native-core/test/interop_sanity_test.js @@ -18,8 +18,9 @@ 'use strict'; -var interop_server = require('../interop/interop_server.js'); -var interop_client = require('../interop/interop_client.js'); +require('../../../test/fixtures/native_native.js'); +var interop_server = require('../../../test/interop/interop_server.js'); +var interop_client = require('../../../test/interop/interop_client.js'); var server; diff --git a/test/api/math/math_grpc_pb.js b/packages/grpc-native-core/test/math/math_grpc_pb.js similarity index 97% rename from test/api/math/math_grpc_pb.js rename to packages/grpc-native-core/test/math/math_grpc_pb.js index 68001847..82105c0f 100644 --- a/test/api/math/math_grpc_pb.js +++ b/packages/grpc-native-core/test/math/math_grpc_pb.js @@ -16,8 +16,8 @@ // limitations under the License. // 'use strict'; -var grpc = require('../../any_grpc.js'); -var math_math_pb = require('../math/math_pb.js'); +var grpc = require('../..'); +var math_math_pb = require('./math_pb.js'); function serialize_DivArgs(arg) { if (!(arg instanceof math_math_pb.DivArgs)) { diff --git a/test/api/math/math_pb.js b/packages/grpc-native-core/test/math/math_pb.js similarity index 100% rename from test/api/math/math_pb.js rename to packages/grpc-native-core/test/math/math_pb.js diff --git a/test/api/math/math_server.js b/packages/grpc-native-core/test/math/math_server.js similarity index 98% rename from test/api/math/math_server.js rename to packages/grpc-native-core/test/math/math_server.js index 70ad2dc5..4291ae18 100644 --- a/test/api/math/math_server.js +++ b/packages/grpc-native-core/test/math/math_server.js @@ -18,7 +18,7 @@ 'use strict'; -var grpc = require('../../any_grpc.js'); +var grpc = require('../..'); var grpcMath = require('./math_grpc_pb'); var math = require('./math_pb'); diff --git a/test/api/math_client_test.js b/packages/grpc-native-core/test/math_client_test.js similarity index 99% rename from test/api/math_client_test.js rename to packages/grpc-native-core/test/math_client_test.js index f4ba0951..11deda34 100644 --- a/test/api/math_client_test.js +++ b/packages/grpc-native-core/test/math_client_test.js @@ -20,7 +20,7 @@ var assert = require('assert'); -var grpc = require('../any_grpc'); +var grpc = require('..'); var math = require('./math/math_pb'); var MathClient = require('./math/math_grpc_pb').MathClient; diff --git a/test/api/metadata_test.js b/packages/grpc-native-core/test/metadata_test.js similarity index 99% rename from test/api/metadata_test.js rename to packages/grpc-native-core/test/metadata_test.js index 7825383d..6063b31f 100644 --- a/test/api/metadata_test.js +++ b/packages/grpc-native-core/test/metadata_test.js @@ -18,7 +18,7 @@ 'use strict'; -var Metadata = require('../any_grpc').Metadata; +var Metadata = require('..').Metadata; var assert = require('assert'); diff --git a/test/api/numbers.txt b/packages/grpc-native-core/test/numbers.txt similarity index 100% rename from test/api/numbers.txt rename to packages/grpc-native-core/test/numbers.txt diff --git a/packages/grpc-native-core/test/server_test.js b/packages/grpc-native-core/test/server_test.js index c1b94194..5351c138 100644 --- a/packages/grpc-native-core/test/server_test.js +++ b/packages/grpc-native-core/test/server_test.js @@ -72,8 +72,8 @@ describe('server', function() { }); it('should bind to an unused port with ssl credentials', function() { var port; - var key_path = path.join(__dirname, '../../../test/data/server1.key'); - var pem_path = path.join(__dirname, '../../../test/data/server1.pem'); + var key_path = path.join(__dirname, '/data/server1.key'); + var pem_path = path.join(__dirname, '/data/server1.pem'); var key_data = fs.readFileSync(key_path); var pem_data = fs.readFileSync(pem_path); var creds = grpc.ServerCredentials.createSsl(null, diff --git a/test/api/surface_test.js b/packages/grpc-native-core/test/surface_test.js similarity index 99% rename from test/api/surface_test.js rename to packages/grpc-native-core/test/surface_test.js index 92802435..36179738 100644 --- a/test/api/surface_test.js +++ b/packages/grpc-native-core/test/surface_test.js @@ -21,10 +21,10 @@ var assert = require('assert'); var _ = require('lodash'); -var grpc = require('../any_grpc'); +var grpc = require('..'); var MathClient = grpc.load( - __dirname + '/../../packages/grpc-native-core/deps/grpc/src/proto/math/math.proto').math.Math; + __dirname + '/../deps/grpc/src/proto/math/math.proto').math.Math; var mathServiceAttrs = MathClient.service; /** @@ -485,7 +485,7 @@ describe('Echo metadata', function() { call.end(); }); it('shows the correct user-agent string', function(done) { - var version = require('../any_grpc')['$implementationInfo'].client.corePjson.version; + var version = require('../package.json').version; var call = client.unary({}, metadata, function(err, data) { assert.ifError(err); }); call.on('metadata', function(metadata) { diff --git a/test/api/test_service.json b/packages/grpc-native-core/test/test_service.json similarity index 100% rename from test/api/test_service.json rename to packages/grpc-native-core/test/test_service.json diff --git a/test/api/test_service.proto b/packages/grpc-native-core/test/test_service.proto similarity index 100% rename from test/api/test_service.proto rename to packages/grpc-native-core/test/test_service.proto diff --git a/test/api/credentials_api_test.js b/test/api/credentials_api_test.js deleted file mode 100644 index e79fca07..00000000 --- a/test/api/credentials_api_test.js +++ /dev/null @@ -1,165 +0,0 @@ -/* - * - * Copyright 2015 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -'use strict'; - -var assert = require('assert'); -var fs = require('fs'); -var path = require('path'); - -var grpc = require('../any_grpc'); - -var key_data, pem_data, ca_data; - -before(function() { - var key_path = path.join(__dirname, '../data/server1.key'); - var pem_path = path.join(__dirname, '../data/server1.pem'); - var ca_path = path.join(__dirname, '../data/ca.pem'); - key_data = fs.readFileSync(key_path); - pem_data = fs.readFileSync(pem_path); - ca_data = fs.readFileSync(ca_path); -}); - -describe('channel credentials', function() { - describe('#createSsl', function() { - it('works with no arguments', function() { - var creds; - assert.doesNotThrow(function() { - creds = grpc.credentials.createSsl(); - }); - assert.notEqual(creds, null); - }); - it('works with just one Buffer argument', function() { - var creds; - assert.doesNotThrow(function() { - creds = grpc.credentials.createSsl(ca_data); - }); - assert.notEqual(creds, null); - }); - it('works with 3 Buffer arguments', function() { - var creds; - assert.doesNotThrow(function() { - creds = grpc.credentials.createSsl(ca_data, key_data, pem_data); - }); - assert.notEqual(creds, null); - }); - it('works if the first argument is null', function() { - var creds; - assert.doesNotThrow(function() { - creds = grpc.credentials.createSsl(null, key_data, pem_data); - }); - assert.notEqual(creds, null); - }); - it('fails if the first argument is a non-Buffer value', function() { - assert.throws(function() { - grpc.credentials.createSsl('test'); - }, TypeError); - }); - it('fails if the second argument is a non-Buffer value', function() { - assert.throws(function() { - grpc.credentials.createSsl(null, 'test', pem_data); - }, TypeError); - }); - it('fails if the third argument is a non-Buffer value', function() { - assert.throws(function() { - grpc.credentials.createSsl(null, key_data, 'test'); - }, TypeError); - }); - it('fails if only 1 of the last 2 arguments is provided', function() { - assert.throws(function() { - grpc.credentials.createSsl(null, key_data); - }); - assert.throws(function() { - grpc.credentials.createSsl(null, null, pem_data); - }); - }); - }); -}); - -describe('server credentials', function() { - describe('#createSsl', function() { - it('accepts a buffer and array as the first 2 arguments', function() { - var creds; - assert.doesNotThrow(function() { - creds = grpc.ServerCredentials.createSsl(ca_data, []); - }); - assert.notEqual(creds, null); - }); - it('accepts a boolean as the third argument', function() { - var creds; - assert.doesNotThrow(function() { - creds = grpc.ServerCredentials.createSsl(ca_data, [], true); - }); - assert.notEqual(creds, null); - }); - it('accepts an object with two buffers in the second argument', function() { - var creds; - assert.doesNotThrow(function() { - creds = grpc.ServerCredentials.createSsl(null, - [{private_key: key_data, - cert_chain: pem_data}]); - }); - assert.notEqual(creds, null); - }); - it('accepts multiple objects in the second argument', function() { - var creds; - assert.doesNotThrow(function() { - creds = grpc.ServerCredentials.createSsl(null, - [{private_key: key_data, - cert_chain: pem_data}, - {private_key: key_data, - cert_chain: pem_data}]); - }); - assert.notEqual(creds, null); - }); - it('fails if the second argument is not an Array', function() { - assert.throws(function() { - grpc.ServerCredentials.createSsl(ca_data, 'test'); - }, TypeError); - }); - it('fails if the first argument is a non-Buffer value', function() { - assert.throws(function() { - grpc.ServerCredentials.createSsl('test', []); - }, TypeError); - }); - it('fails if the third argument is a non-boolean value', function() { - assert.throws(function() { - grpc.ServerCredentials.createSsl(ca_data, [], 'test'); - }, TypeError); - }); - it('fails if the array elements are not objects', function() { - assert.throws(function() { - grpc.ServerCredentials.createSsl(ca_data, 'test'); - }, TypeError); - }); - it('fails if the object does not have a Buffer private_key', function() { - assert.throws(function() { - grpc.ServerCredentials.createSsl(null, - [{private_key: 'test', - cert_chain: pem_data}]); - }, TypeError); - }); - it('fails if the object does not have a Buffer cert_chain', function() { - assert.throws(function() { - grpc.ServerCredentials.createSsl(null, - [{private_key: key_data, - cert_chain: 'test'}]); - }, TypeError); - }); - }); -}); \ No newline at end of file diff --git a/test/api/echo_service.proto b/test/api/echo_service.proto deleted file mode 100644 index 0b27c8b1..00000000 --- a/test/api/echo_service.proto +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2015 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -message EchoMessage { - string value = 1; - int32 value2 = 2; -} - -service EchoService { - rpc Echo (EchoMessage) returns (EchoMessage); -} diff --git a/test/api/file_load_test.js b/test/api/file_load_test.js deleted file mode 100644 index c24a1100..00000000 --- a/test/api/file_load_test.js +++ /dev/null @@ -1,40 +0,0 @@ -/* - * - * Copyright 2015 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -'use strict'; - -var assert = require('assert'); -var grpc = require('../any_grpc'); - -describe('File loader', function() { - it('Should load a proto file by default', function() { - assert.doesNotThrow(function() { - grpc.load(__dirname + '/test_service.proto'); - }); - }); - it('Should load a proto file with the proto format', function() { - assert.doesNotThrow(function() { - grpc.load(__dirname + '/test_service.proto', 'proto'); - }); - }); - it('Should load a json file with the json format', function() { - assert.doesNotThrow(function() { - grpc.load(__dirname + '/test_service.json', 'json'); - }); - }); -}); diff --git a/test/api/test_messages.proto b/test/api/test_messages.proto deleted file mode 100644 index da1ef565..00000000 --- a/test/api/test_messages.proto +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2015 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -message LongValues { - int64 int_64 = 1; - uint64 uint_64 = 2; - sint64 sint_64 = 3; - fixed64 fixed_64 = 4; - sfixed64 sfixed_64 = 5; -} - -message SequenceValues { - bytes bytes_field = 1; - repeated int32 repeated_field = 2; -} - -message OneOfValues { - oneof oneof_choice { - int32 int_choice = 1; - string string_choice = 2; - } -} - -enum TestEnum { - ZERO = 0; - ONE = 1; - TWO = 2; -} - -message EnumValues { - TestEnum enum_value = 1; -} diff --git a/test/gulpfile.js b/test/gulpfile.js index 70e05796..41c4b33c 100644 --- a/test/gulpfile.js +++ b/test/gulpfile.js @@ -35,29 +35,4 @@ gulp.task('install', 'Install test dependencies', () => { gulp.task('clean.all', 'Delete all files created by tasks', () => {}); -gulp.task('test', 'Run API-level tests', () => { - // run mocha tests matching a glob with a pre-required fixture, - // returning the associated gulp stream - const apiTestGlob = `${apiTestDir}/*.js`; - const runTestsWithFixture = (server, client) => new Promise((resolve, reject) => { - const fixture = `${server}_${client}`; - console.log(`Running ${apiTestGlob} with ${server} server + ${client} client`); - gulp.src(apiTestGlob) - .pipe(mocha({ - reporter: 'mocha-jenkins-reporter', - require: `${testDir}/fixtures/${fixture}.js` - })) - .resume() // put the stream in flowing mode - .on('end', resolve) - .on('error', reject); - }); - const runTestsArgPairs = [ - ['native', 'native'], - // ['native', 'js'], - // ['js', 'native'], - // ['js', 'js'] - ]; - return runTestsArgPairs.reduce((previousPromise, argPair) => { - return previousPromise.then(runTestsWithFixture.bind(null, argPair[0], argPair[1])); - }, Promise.resolve()); -}); +gulp.task('test', 'Run API-level tests', () => {}); diff --git a/test/package.json b/test/package.json index e3aa0eeb..306e3f73 100644 --- a/test/package.json +++ b/test/package.json @@ -14,13 +14,7 @@ } ], "dependencies": { - "async": "^2.0.1", - "body-parser": "^1.15.2", - "express": "^4.14.0", "google-auth-library": "^0.9.2", - "google-protobuf": "^3.0.0", - "lodash": "^4.17.4", - "minimist": "^1.1.0", - "poisson-process": "^0.2.1" + "lodash": "^4.17.4" } }