Skip to content
This repository has been archived by the owner on Apr 3, 2024. It is now read-only.

Use mocha for end-to-end tests #212

Merged
merged 13 commits into from
Jan 5, 2017
Merged

Use mocha for end-to-end tests #212

merged 13 commits into from
Jan 5, 2017

Conversation

kjin
Copy link
Contributor

@kjin kjin commented Dec 23, 2016

Turned test-breakpoints.js and test-log-throttling.js into mocha tests in a new file test-e2e.js. This involved splitting off the debuggee into a separate file (fib.js).

Changes to the tests themselves are:

  • Spawned children now each have their own log object in the test, and each log is individually checked (whereas before, there was a single object that contained logs from all children).
  • The log throttling test now also spawns three children (instead of one), since it uses common initialization logic.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Dec 23, 2016
process.send([errorMessage]);
}
};
sendErrorIfNotOk(debug.private_, 'debuglet has initialized');

This comment was marked as spam.

This comment was marked as spam.

});
};

describe('@google-cloud/debug end-to-end behavior (allow 60s)', function () {

This comment was marked as spam.

This comment was marked as spam.

sendErrorIfNotOk(debuggee.id, 'debuggee should have registered');
if (ok) {
// The parent process needs to know the debuggeeId and project.
process.send(['', debuggee.id, debuggee.project]);

This comment was marked as spam.

This comment was marked as spam.

assert.equal(debuggeeId, a[1]);
assert.equal(projectId, a[2]);
if (debuggeeId !== a[1] || projectId !== a[2]) {
reject(new Error('Child debuggee ID and/or project ID' +

This comment was marked as spam.

This comment was marked as spam.


afterEach(function() {
children.forEach(function (child) {
child.process.kill();

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

Copy link
Contributor

@matthewloring matthewloring left a comment

Choose a reason for hiding this comment

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

LGTM once things are passing for 0.12

@kjin kjin force-pushed the mocha-e3e branch 2 times, most recently from a22178c to de9172a Compare December 28, 2016 22:37
@kjin
Copy link
Contributor Author

kjin commented Dec 29, 2016

Still fixing tests - since E2E tests fail.

@kjin
Copy link
Contributor Author

kjin commented Jan 4, 2017

@@ -0,0 +1,109 @@
// /**

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@kjin kjin merged commit a28d719 into googleapis:master Jan 5, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants