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-6176] add unit test for wsman-tool and wsman base job #530

Merged
merged 1 commit into from
Oct 27, 2017

Conversation

lanchongyizu
Copy link
Member

Background

As the RACADM replacement work squad, we need to work on common wsman-tools functionality, so that everyone can focus on their own tasks.

Details

  1. add unit test for wsman-tool and wsman base job
  2. refine JobUtils.WsmanTool
  3. refine DellWsmanBaseJob

Reviewers

@RackHD/corecommitters @nortonluo @yaolingling

@JenkinsRHD
Copy link
Contributor

BUILD on-tasks #285 : FAILURE

BUILD on-tasks #285 Error Logs ▼Test Name: Should send request to smi service successfully Error Details: undefined (string) is required Stack Trace: AssertionError: undefined (string) is required at AssertService.(anonymous function) [as string] (node_modules/on-core/lib/common/assert.js:30:28) at new WsmanTool (lib/utils/job-utils/wsman-tool.js:9:689) at Context.<anonymous> (spec/lib/jobs/dell-wsman-bios-spec.js:130:25)

Test Name: Should fail to get respone from smi service
Error Details: undefined (string) is required
Stack Trace: AssertionError: undefined (string) is required
at AssertService.(anonymous function) [as string] (node_modules/on-core/lib/common/assert.js:30:28)
at new WsmanTool (lib/utils/job-utils/wsman-tool.js:9:689)
at Context.<anonymous> (spec/lib/jobs/dell-wsman-bios-spec.js:150:25)

httpStatusCode: 200,
body: '{"a":1,"b":2}'
});
setupRequest = sandbox.stub(HttpTool.prototype, 'setupRequest').resolves();
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggest use different variable name eg. MockRequest。

port: parsed.port,
protocol: parsed.protocol.replace(':','').trim(),
verifySSL: options.verifySSL,
recvTimeoutMs: options.recvTimeoutMs
Copy link
Contributor

Choose a reason for hiding this comment

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

add || 30000?As default timeout setting

Copy link
Member Author

Choose a reason for hiding this comment

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

It is set in clientRequest.

@anhou anhou merged commit 7617392 into RackHD:master Oct 27, 2017
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.

4 participants