TritonDataCenter / TritonDataCenter/sdc-cloudapi

Tests failing due to changed tape behaviour

Open
#90 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
8
Forks
22
Avg merge
3d 9h
Merged PRs (30d)
1

Description

package.json uses tape 5.0.0 and above, but tape switched deep-equal library versions between 4.x and 5.x, and the new deep-equal has some strange behaviour: deepEqual() failing with objects that are semantically identical, but have a different ordering of attributes. For example:

    operator: deepEqual
    expected: |-
      { jse_info: {}, jse_shortmsg: '', message: 'Role(s) asdasdasdasd not found', statusCode: 409, restCode: 'InvalidArgument', name: 'InvalidArgumentError', body: { code: 'InvalidArgument', message: 'Role(s) asdasdasdasd not found' } }
    actual: |-
      { jse_shortmsg: '', jse_info: {}, message: 'Role(s) asdasdasdasd not found', statusCode: 409, body: { code: 'InvalidArgument', message: 'Role(s) asdasdasdasd not found' }, restCode: 'InvalidArgument', name: 'InvalidArgumentError' }
    at: <anonymous> (/opt/smartdc/cloudapi/test/auth.test.js:467:11)
    stack: |-
      InvalidArgumentError: Role(s) asdasdasdasd not found
          at parseResponse (/opt/smartdc/cloudapi/node_modules/restify/lib/clients/json_client.js:71:23)
          at IncomingMessage.done (/opt/smartdc/cloudapi/node_modules/restify/lib/clients/string_client.js:167:13)
          at IncomingMessage.g (events.js:292:16)
          at emitNone (events.js:91:20)
          at IncomingMessage.emit (events.js:185:7)
          at endReadableNT (_stream_readable.js:978:12)
          at _combinedTickCallback (internal/process/next_tick.js:80:11)
          at process._tickCallback (internal/process/next_tick.js:104:9)

I could fix the tests themselves, but since this new deepEqual() behaviour is nonsense, switch to using the older tape 4.13.2 instead.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the tape dependency in package.json and the failing assertion in test/auth.test.js at line 467. Verify the deep-equal behavior with tape 5.0.0 or above, then use tape 4.13.2 as requested and run the affected tests. Done means the tests pass without changing their expected object ordering.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
testing
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.