Skip to content

test: refactor inspect-test #176

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

Merged
merged 2 commits into from
Mar 18, 2018

Conversation

joyeecheung
Copy link
Member

  • Make the test messages more informative.
  • Refactor the test flow so that we could skip flaky properties
    (currently the potentially neutered typed array)
    and that one missing property does not stop later tests.

Refs: #150
We should now be able to skip #150 , it remains a question whether this should be fixed (or is it fixable?)

TAP output of inspect-test.js before this patch
TAP version 13
# v8 inspect
ok 1 undefined
ok 2 null
ok 3 method should have `this`
ok 4 null
ok 5 addr of `Class` should match
ok 6 null
ok 7 .x smi property
ok 8 .y heap number property
ok 9 .hashmap object property
ok 10 null
ok 11 addr of `Object` should match
ok 12 null
ok 13 [0] null element
ok 14 [4] undefined element
ok 15 [23] RegExp element
ok 16 [25] Arrow Function element
ok 17 .some-key property
ok 18 .other-key property
ok 19 .array JSArray property
ok 20 .array JSArray property
ok 21 .array-buffer JSArrayBuffer property
ok 22 .uint8-array JSArrayBufferView property
ok 23 .buffer JSArrayBufferView property
ok 24 .cons-string ConsString property
ok 25 .thin-string ThinString property
ok 26 .externalized-string ExternalString property
ok 27 .sliced-externalized-string Sliced ExternalString property
ok 28 null
ok 29 regexp.source
ok 30 null
ok 31 cons string content
ok 32 null
ok 33 --string-length truncates the string
ok 34 null
ok 35 thin string content
ok 36 null
ok 37 array length
ok 38 array content
ok 39 null
ok 40 long array length
ok 41 long array content
ok 42 null
ok 43 array buffer content
ok 44 null
ok 45 array buffer content with maximum length 1
ok 46 null
ok 47 typed array content
ok 48 null
ok 49 typed array content with maximum length 1
ok 50 null
ok 51 buffer content
ok 52 null
ok 53 buffer content with maximum length 1
ok 54 null
ok 55 arrow method source
ok 56 null
ok 57 method source found
ok 58 method.previous
ok 59 method.scopedValue
ok 60 `method` should have `scopedAPI`
ok 61 `method` should have `closure`
ok 62 null
ok 63 method.scopedAPI.internalFields
ok 64 null
ok 65 method.closure.outerVar

1..65
# tests 65
# pass  65

# ok
TAP output of inspect-test.js after this patch (removed a few redundant `t.error(err) in callbacks`)
# v8 inspect
ok 1 method should have `this` and `fn`
ok 2 method[[context]].(previous) should exist 
ok 3 method[[context]].(closure) should exist 
ok 4 method[[context]].scopedVar should exist 
ok 5 method[[context]].scopedAPI should exist 
ok 6 method[[context]].scopedArray should exist 
ok 7 method[[context]].closure.outerVar should exist
ok 8 method[[context]].(closure) validator should complete
ok 9 method[[context]].closure.scopedAPI should have internal fields
ok 10 method[[context]].scopedAPI validator should complete
ok 11 method[[context]].scopedArray[0] should be `<Smi: 0>`
ok 12 method[[context]].scopedArray[1] should be a Zlib
ok 13 method[[context]].scopedArray validator should complete
ok 14 v8 inspect -s <method> should return output
ok 15 method source should match
ok 16 address in the detailed view of Class should match the address in the parent's view
ok 17 this.x should be <Smi: 1>
ok 18 this.y should be 123.456
ok 19 this.hashmap should be an object
ok 20 address in the detailed view of Object should match the address in the parent's view
ok 21 hashmap[0] null element should exist 
ok 22 hashmap[4] undefined element should exist 
ok 23 hashmap[23] RegExp element should exist 
ok 24 hashmap[25] Arrow Function element should exist 
ok 25 hashmap.some-key property should exist 
ok 26 hashmap.other-key property should exist 
ok 27 hashmap.cons-string ConsString property should exist 
ok 28 hashmap.internalized-string Internalized String property should exist 
ok 29 hashmap.thin-string ThinString property should exist 
ok 30 hashmap.externalized-string ExternalString property should exist 
ok 31 hashmap.sliced-externalized-string Sliced ExternalString property should exist 
ok 32 hashmap.array JSArray property should exist 
ok 33 hashmap.long-array JSArray property should exist 
ok 34 hashmap.array-buffer JSArrayBuffer property should exist 
ok 35 hashmap.uint8-array JSArrayBufferView property should exist 
ok 36 hashmap.buffer JSArrayBufferView property should exist 
ok 37 hashmap[23] should have the correct regexp.source
ok 38 hashmap[23] RegExp element validator should complete
ok 39 hashmap[25] should have the correct function source
ok 40 hashmap[25] Arrow Function element validator should complete
ok 41 hashmap.cons-string should have the right content
ok 42 hashmap.cons-string ConsString property validator #0 should complete
ok 43 --string-length should truncate the string
ok 44 hashmap.cons-string ConsString property validator #1 should complete
ok 45 hashmap.thin-string should have the right content
ok 46 hashmap.thin-string ThinString property validator should complete
ok 47 length of hashmap.array should be 6
ok 48 hashmap.array JSArray property validator should complete
ok 49 length of hashmap.long-array should be 6
ok 50 hashmap.long-array should have the right content
ok 51 hashmap.long-array JSArray property validator should complete
ok 52 hashmap.array-buffer should have the right content
ok 53 hashmap.array-buffer JSArrayBuffer property validator #0 should complete
ok 54 hashmap.array-buffer should have the right content with --array-length 1
ok 55 hashmap.array-buffer JSArrayBuffer property validator #1 should complete
ok 56 hashmap.uint8-array should have the right content
ok 57 hashmap.uint8-array JSArrayBufferView property validator #0 should complete
ok 58 hashmap.uint8-array should have the right content with --array-length 1
ok 59 hashmap.uint8-array JSArrayBufferView property validator #1 should complete
ok 60 hashmap.uint8-array should have the right content
ok 61 hashmap.buffer JSArrayBufferView property validator #0 should complete
ok 62 hashmap.buffer should have the right content with --array-length 1
ok 63 hashmap.buffer JSArrayBufferView property validator #1 should complete

1..63
# tests 63
# pass  63

# ok

- Make the test messages more informative.
- Refactor the test flow so that we could skip flaky properties
  (currently the potentially neutered typed array)
  and that one missing property does not stop later tests.
joyeecheung

This comment was marked as off-topic.

@joyeecheung
Copy link
Member Author

joyeecheung commented Mar 16, 2018

CI now skips the neutered typed array

https://travis-ci.org/nodejs/llnode/jobs/354456004

[TEST][6231] [LINE][6256]     .uint8-array=0x000038eb04b67eb9:<ArrayBufferView [neutered]>,
.....
ok 44 .uint8-array JSArrayBufferView property: might be neutered # SKIP

bnoordhuis

This comment was marked as off-topic.

@joyeecheung
Copy link
Member Author

Updated the optional regexp per suggestion by @bnoordhuis .

@joyeecheung joyeecheung merged commit 9eae8d7 into nodejs:master Mar 18, 2018
@joyeecheung joyeecheung mentioned this pull request Mar 31, 2018
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.

2 participants