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

[RAC-6232]Node 6/8 unit test fix #535

Merged
merged 1 commit into from
Nov 3, 2017
Merged

[RAC-6232]Node 6/8 unit test fix #535

merged 1 commit into from
Nov 3, 2017

Conversation

mcgG
Copy link
Contributor

@mcgG mcgG commented Oct 26, 2017

Background

Currently, unit test will fail in Nodejs 6 and Nodejs 8.
https://rackhd.atlassian.net/browse/RAC-6232

AC:

  • Paired with @PengTian0
  • Fix nodejs6 unit test failures in local machine
  • Don’t break nodejs 4 unit test
  • Pilot run in travisci environment(don’t commit the fix, because further FIT test should pass before submitting

Detail

on-tasks

Three failures all caused by 'AssertionError', in node4,6 only returns 'AssertionError' but in node8 it returns more information /AssertionError.*/

Solution
Change

  • spec/lib/jobs/ipmi-catalog-spec.js:L62, L84,
  • spec/lib/jobs/local-catalog-spec.js:L65,
  • spec/lib/jobs/obm-control-spec.js:L91, L112, L134

expect(e).to.have.property('name').that.equals('AssertionError');
to
expect(e).to.have.property('name').to.match(/AssertionError.*/);

Bug fix:
For spec/lib/jobs/obm-control-spec.js:L81
At line 96 should call
done(e)
Instead of
done()
Because only call done() will finish the case without any failure, so this case will be always passed, doen(e) can catch the error and return the error message

It's better to update module supertest from 0.15.0 to 1.12.0 in every repos, because if use npm link to install modules, it may fail the unittest, the reason is supertest@0.15.0 doesn't support.end()

@iceiilin @anhou @pengz1 @bbcyyb @PengTian0

@JenkinsRHD
Copy link
Contributor

BUILD on-tasks #281 : FAILURE

@anhou anhou added the run-test label Oct 31, 2017
@anhou anhou merged commit 3d8e061 into RackHD:master Nov 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants