diff --git a/source/io/module_eggShell.js b/source/io/module_eggShell.js index 00c3e8664..979e3c453 100644 --- a/source/io/module_eggShell.js +++ b/source/io/module_eggShell.js @@ -110,6 +110,8 @@ var assignEggShell; }; Module.eggShell.reboot = publicAPI.eggShell.reboot = function () { + // TODO abort all http requests + // TODO reset internal jsli functions Module.eggShell.delete(Module.eggShell.v_userShell); Module.eggShell.delete(Module.eggShell.v_root); Module.eggShell.v_root = Module.eggShell.create(0); diff --git a/test-it/ViaTests/ByValueFunctions.via b/test-it/ViaTests/ByValueFunctions.via index 6d738de33..613501f16 100644 --- a/test-it/ViaTests/ByValueFunctions.via +++ b/test-it/ViaTests/ByValueFunctions.via @@ -1,4 +1,4 @@ -define(HelloWorld dv(.VirtualInstrument ( +start( VI<( c( // e(obj(e(.Int32)) v0) e(a(.* ) v0DGeneric) @@ -80,11 +80,4 @@ define(HelloWorld dv(.VirtualInstrument ( */ ) -) ) ) -enqueue(HelloWorld) - - - - - - +) > ) diff --git a/test-it/karma/events/ControlEvents.Test.js b/test-it/karma/events/ControlEvents.Test.js index 29536d8f9..f8feaef7d 100644 --- a/test-it/karma/events/ControlEvents.Test.js +++ b/test-it/karma/events/ControlEvents.Test.js @@ -85,6 +85,10 @@ describe('The Vireo Control Event', function () { }); }); + afterEach(function () { + vireo = undefined; + }); + it('registration callback is called on parse and unregister callback on exit', function (done) { var registerCallbackExecuted = false; var unregisterCallbackExecuted = false; diff --git a/test-it/karma/http/HttpDelete.Test.js b/test-it/karma/http/HttpDelete.Test.js index 759bbfdf5..1e3439341 100644 --- a/test-it/karma/http/HttpDelete.Test.js +++ b/test-it/karma/http/HttpDelete.Test.js @@ -34,12 +34,15 @@ describe('Performing a DELETE request', function () { httpBinHelpers.queryHttpBinStatus(done); }); - beforeEach(async function () { + beforeAll(async function () { httpBinHelpers.makeTestPendingIfHttpBinOffline(); - // TODO mraj create shared vireo instances to improve test perf https://github.com/ni/VireoSDK/issues/163 vireo = await vireoHelpers.createInstance(); }); + afterAll(function () { + vireo = undefined; + }); + it('with a simple 200 response', function (done) { var runSlicesAsync = vireoRunner.rebootAndLoadVia(vireo, httpDeleteMethodViaUrl); var viPathParser = vireoRunner.createVIPathParser(vireo, 'MyVI'); diff --git a/test-it/karma/http/HttpGet.Test.js b/test-it/karma/http/HttpGet.Test.js index 2affff51e..1d20fb0d8 100644 --- a/test-it/karma/http/HttpGet.Test.js +++ b/test-it/karma/http/HttpGet.Test.js @@ -40,12 +40,15 @@ describe('Performing a GET request', function () { httpBinHelpers.queryHttpBinStatus(done); }); - beforeEach(async function () { + beforeAll(async function () { httpBinHelpers.makeTestPendingIfHttpBinOffline(); - // TODO mraj create shared vireo instances to improve test perf https://github.com/ni/VireoSDK/issues/163 vireo = await vireoHelpers.createInstance(); }); + afterAll(function () { + vireo = undefined; + }); + it('with a simple 200 response', function (done) { var runSlicesAsync = vireoRunner.rebootAndLoadVia(vireo, httpGetMethodViaUrl); var viPathParser = vireoRunner.createVIPathParser(vireo, 'MyVI'); diff --git a/test-it/karma/http/HttpHead.Test.js b/test-it/karma/http/HttpHead.Test.js index 6e76112f5..3d45b8c0b 100644 --- a/test-it/karma/http/HttpHead.Test.js +++ b/test-it/karma/http/HttpHead.Test.js @@ -33,12 +33,15 @@ describe('Performing a HEAD request', function () { httpBinHelpers.queryHttpBinStatus(done); }); - beforeEach(async function () { + beforeAll(async function () { httpBinHelpers.makeTestPendingIfHttpBinOffline(); - // TODO mraj create shared vireo instances to improve test perf https://github.com/ni/VireoSDK/issues/163 vireo = await vireoHelpers.createInstance(); }); + afterAll(function () { + vireo = undefined; + }); + it('with a simple 200 response', function (done) { var runSlicesAsync = vireoRunner.rebootAndLoadVia(vireo, httpHeadMethodViaUrl); var viPathParser = vireoRunner.createVIPathParser(vireo, 'MyVI'); diff --git a/test-it/karma/http/HttpPost.Test.js b/test-it/karma/http/HttpPost.Test.js index d95733d31..067e68758 100644 --- a/test-it/karma/http/HttpPost.Test.js +++ b/test-it/karma/http/HttpPost.Test.js @@ -34,12 +34,15 @@ describe('Performing a POST request', function () { httpBinHelpers.queryHttpBinStatus(done); }); - beforeEach(async function () { + beforeAll(async function () { httpBinHelpers.makeTestPendingIfHttpBinOffline(); - // TODO mraj create shared vireo instances to improve test perf https://github.com/ni/VireoSDK/issues/163 vireo = await vireoHelpers.createInstance(); }); + afterAll(function () { + vireo = undefined; + }); + it('with a simple 200 response', function (done) { var runSlicesAsync = vireoRunner.rebootAndLoadVia(vireo, httpPostMethodViaUrl); var viPathParser = vireoRunner.createVIPathParser(vireo, 'MyVI'); diff --git a/test-it/karma/http/HttpPut.Test.js b/test-it/karma/http/HttpPut.Test.js index 10d804e60..852def929 100644 --- a/test-it/karma/http/HttpPut.Test.js +++ b/test-it/karma/http/HttpPut.Test.js @@ -34,12 +34,15 @@ describe('Performing a PUT request', function () { httpBinHelpers.queryHttpBinStatus(done); }); - beforeEach(async function () { + beforeAll(async function () { httpBinHelpers.makeTestPendingIfHttpBinOffline(); - // TODO mraj create shared vireo instances to improve test perf https://github.com/ni/VireoSDK/issues/163 vireo = await vireoHelpers.createInstance(); }); + afterAll(function () { + vireo = undefined; + }); + it('with a simple 200 response', function (done) { var runSlicesAsync = vireoRunner.rebootAndLoadVia(vireo, httpPutMethodViaUrl); var viPathParser = vireoRunner.createVIPathParser(vireo, 'MyVI'); diff --git a/test-it/karma/http/OpenHandle.Test.js b/test-it/karma/http/OpenHandle.Test.js index 9a3434c08..846dfcfe5 100644 --- a/test-it/karma/http/OpenHandle.Test.js +++ b/test-it/karma/http/OpenHandle.Test.js @@ -17,11 +17,14 @@ describe('Running an Open Handle call', function () { ], done); }); - beforeEach(async function () { - // TODO mraj create shared vireo instances to improve test perf https://github.com/ni/VireoSDK/issues/163 + beforeAll(async function () { vireo = await vireoHelpers.createInstance(); }); + afterAll(function () { + vireo = undefined; + }); + it('with simple inputs', function (done) { var runSlicesAsync = vireoRunner.rebootAndLoadVia(vireo, httpOpenHandleViaUrl); var viPathParser = vireoRunner.createVIPathParser(vireo, 'MyVI'); diff --git a/test-it/karma/http/Timeout.Test.js b/test-it/karma/http/Timeout.Test.js index 378ff71b0..3fa6f103f 100644 --- a/test-it/karma/http/Timeout.Test.js +++ b/test-it/karma/http/Timeout.Test.js @@ -28,12 +28,15 @@ describe('Timeout test suite #Slow', function () { httpBinHelpers.forceHttpBinQuery('get?show_env=1', done); }); - beforeEach(async function () { + beforeAll(async function () { httpBinHelpers.makeTestPendingIfHttpBinOffline(); - // TODO mraj create shared vireo instances to improve test perf https://github.com/ni/VireoSDK/issues/163 vireo = await vireoHelpers.createInstance(); }); + afterAll(function () { + vireo = undefined; + }); + it('GET method with timeout 0s times out with httpbin delay of 10s', function (done) { var timeout = 0; var timeoutEpsilon = 1000; diff --git a/test-it/karma/javascriptinvoke/Complex.Test.js b/test-it/karma/javascriptinvoke/Complex.Test.js index d1692a698..4758023dc 100644 --- a/test-it/karma/javascriptinvoke/Complex.Test.js +++ b/test-it/karma/javascriptinvoke/Complex.Test.js @@ -15,10 +15,15 @@ describe('A JavaScript function invoke', function () { ], done); }); - beforeEach(async function () { - // TODO mraj create shared vireo instances to improve test perf https://github.com/ni/VireoSDK/issues/163 + beforeAll(async function () { vireo = await vireoHelpers.createInstance(); + }); + afterAll(function () { + vireo = undefined; + }); + + beforeEach(async function () { // Add functions to exercise JavaScriptInvoke behavior window.NI_ConcatenateValue = function (fieldName, value) { var returnString = fieldName + value; diff --git a/test-it/karma/javascriptinvoke/ReturnDataTypes.Test.js b/test-it/karma/javascriptinvoke/ReturnDataTypes.Test.js index 44196e40b..e40548068 100644 --- a/test-it/karma/javascriptinvoke/ReturnDataTypes.Test.js +++ b/test-it/karma/javascriptinvoke/ReturnDataTypes.Test.js @@ -23,10 +23,15 @@ describe('A JavaScript function invoke', function () { ], done); }); - beforeEach(async function () { - // TODO mraj create shared vireo instances to improve test perf https://github.com/ni/VireoSDK/issues/163 + beforeAll(async function () { vireo = await vireoHelpers.createInstance(); + }); + afterAll(function () { + vireo = undefined; + }); + + beforeEach(async function () { // Add functions to exercise JavaScriptInvoke behavior with parameters of different types window.NI_TrueBooleanFunction = function () { return true; diff --git a/test-it/karma/javascriptinvoke/Simple.Test.js b/test-it/karma/javascriptinvoke/Simple.Test.js index 4e9067a16..98a7ff5d2 100644 --- a/test-it/karma/javascriptinvoke/Simple.Test.js +++ b/test-it/karma/javascriptinvoke/Simple.Test.js @@ -34,10 +34,15 @@ describe('A JavaScript function invoke', function () { ], done); }); - beforeEach(async function () { - // TODO mraj create shared vireo instances to improve test perf https://github.com/ni/VireoSDK/issues/163 + beforeAll(async function () { vireo = await vireoHelpers.createInstance(); + }); + afterAll(function () { + vireo = undefined; + }); + + beforeEach(async function () { // Add functions to exercise JavaScriptInvoke behavior window.NI_SimpleFunction = function () { return undefined; diff --git a/test-it/karma/systemlogging/SystemLogging.Test.js b/test-it/karma/systemlogging/SystemLogging.Test.js index ce08d02c7..877cab12d 100644 --- a/test-it/karma/systemlogging/SystemLogging.Test.js +++ b/test-it/karma/systemlogging/SystemLogging.Test.js @@ -14,9 +14,15 @@ describe('Performing a system log', function () { ], done); }); - beforeEach(async function () { - // TODO mraj create shared vireo instances to improve test perf https://github.com/ni/VireoSDK/issues/163 + beforeAll(async function () { vireo = await vireoHelpers.createInstance(); + }); + + afterAll(function () { + vireo = undefined; + }); + + beforeEach(async function () { spyOn(console, 'error'); spyOn(console, 'warn'); spyOn(console, 'info'); diff --git a/test-it/karma/vtrsuite/VtrTestSuite.Test.js b/test-it/karma/vtrsuite/VtrTestSuite.Test.js index 6d68080b7..56ecb726c 100644 --- a/test-it/karma/vtrsuite/VtrTestSuite.Test.js +++ b/test-it/karma/vtrsuite/VtrTestSuite.Test.js @@ -39,7 +39,6 @@ describe('The Vireo VTR test suite', function () { var focusTests = { }; var disabledTests = { - ByValueFunctions: true // causes hang?, }; viaTestConfigs.forEach(function (viaTestConfig) {