Skip to content

Commit

Permalink
Cleanup vireo after test run
Browse files Browse the repository at this point in the history
  • Loading branch information
rajsite committed Jun 1, 2019
1 parent b66ae13 commit 9b0b57e
Show file tree
Hide file tree
Showing 15 changed files with 72 additions and 32 deletions.
2 changes: 2 additions & 0 deletions source/io/module_eggShell.js
Expand Up @@ -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);
Expand Down
11 changes: 2 additions & 9 deletions test-it/ViaTests/ByValueFunctions.via
@@ -1,4 +1,4 @@
define(HelloWorld dv(.VirtualInstrument (
start( VI<(
c(
// e(obj(e(.Int32)) v0)
e(a(.* ) v0DGeneric)
Expand Down Expand Up @@ -80,11 +80,4 @@ define(HelloWorld dv(.VirtualInstrument (
*/

)
) ) )
enqueue(HelloWorld)






) > )
4 changes: 4 additions & 0 deletions test-it/karma/events/ControlEvents.Test.js
Expand Up @@ -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;
Expand Down
7 changes: 5 additions & 2 deletions test-it/karma/http/HttpDelete.Test.js
Expand Up @@ -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');
Expand Down
7 changes: 5 additions & 2 deletions test-it/karma/http/HttpGet.Test.js
Expand Up @@ -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');
Expand Down
7 changes: 5 additions & 2 deletions test-it/karma/http/HttpHead.Test.js
Expand Up @@ -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');
Expand Down
7 changes: 5 additions & 2 deletions test-it/karma/http/HttpPost.Test.js
Expand Up @@ -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');
Expand Down
7 changes: 5 additions & 2 deletions test-it/karma/http/HttpPut.Test.js
Expand Up @@ -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');
Expand Down
7 changes: 5 additions & 2 deletions test-it/karma/http/OpenHandle.Test.js
Expand Up @@ -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');
Expand Down
7 changes: 5 additions & 2 deletions test-it/karma/http/Timeout.Test.js
Expand Up @@ -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;
Expand Down
9 changes: 7 additions & 2 deletions test-it/karma/javascriptinvoke/Complex.Test.js
Expand Up @@ -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;
Expand Down
9 changes: 7 additions & 2 deletions test-it/karma/javascriptinvoke/ReturnDataTypes.Test.js
Expand Up @@ -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;
Expand Down
9 changes: 7 additions & 2 deletions test-it/karma/javascriptinvoke/Simple.Test.js
Expand Up @@ -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;
Expand Down
10 changes: 8 additions & 2 deletions test-it/karma/systemlogging/SystemLogging.Test.js
Expand Up @@ -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');
Expand Down
1 change: 0 additions & 1 deletion test-it/karma/vtrsuite/VtrTestSuite.Test.js
Expand Up @@ -39,7 +39,6 @@ describe('The Vireo VTR test suite', function () {
var focusTests = {
};
var disabledTests = {
ByValueFunctions: true // causes hang?,
};

viaTestConfigs.forEach(function (viaTestConfig) {
Expand Down

0 comments on commit 9b0b57e

Please sign in to comment.