Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test fixes #718

Merged
merged 5 commits into from
Apr 29, 2016
Merged

Test fixes #718

merged 5 commits into from
Apr 29, 2016

Conversation

rwaldron
Copy link
Contributor

@rwaldron rwaldron commented Apr 28, 2016

  • don't use NodeRSA in tests
  • stub fs operations whenever possible
  • stub public key operations whenever possible
  • interval until activeSeeker is available

A complete run should look like:

$ grunt
Running "jshint:all" (jshint) task
>> 27 files lint free.

Running "jshint:tests" (jshint) task
>> 64 files lint free.

Running "jscs:all" (jscs) task
>> 91 files without code style errors.

Running "jsbeautifier:all" (jsbeautifier) task
Beautified 103 files, changed 1 files...OK

Running "nodeunit:tests" (nodeunit) task
Testing access-point.js.........OK
Testing bin-tessel-2.js....................................OK
Testing constructor.js......OK
Testing controller.js..................................OK
Testing crash-reporter.js.............OK
Testing daemon.js.....OK
Testing deploy-lists.js..OK
Testing deploy.js..........................................................................OK
Testing discover.js...............OK
Testing erase.js..OK
Testing index.js....OK
Testing key.js....OK
Testing lan-connection.js..........OK
Testing menu.js..OK
Testing name.js........OK
Testing preferences.js.......OK
Testing provision.js.................OK
Testing root.js..OK
Testing tessel.js................OK
Testing update.js......................OK
Testing usb-connection.js.............OK
Testing usb-process.js..OK
Testing version.js.OK
Testing wifi.js..............OK
>> 1065 assertions passed (6838ms)

Specifically, it ends with 1065 assertions

Signed-off-by: Rick Waldron waldron.rick@gmail.com


MockRSA.prototype.exportKey = function() {};

module.exports = global.IS_TEST_ENV ? MockRSA : require('node-rsa');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This allows us to mock RSA key creation in the tests. Previously, new NodeRSA(...) was the longest running operation in the test suite, and was run several times by the provision and key tests

@rwaldron
Copy link
Contributor Author

Note that the run time I included above is 6838ms. I just ran on master and it took 33224ms.

- don't use NodeRSA in tests
- stub fs operations whenever possible
- stub public key operations whenever possible
- interval until activeSeeker is available

Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
@rwaldron
Copy link
Contributor Author

I'm still working on that appveyor nonsense

Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
@rwaldron rwaldron merged commit 557bcc3 into tessel:master Apr 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant