Skip to content
This repository has been archived by the owner on Mar 28, 2022. It is now read-only.

fix: incorrect assertion func and json number parse rule #83

Merged
merged 12 commits into from Feb 15, 2022

Conversation

bbx-winner
Copy link
Collaborator

@bbx-winner bbx-winner commented Feb 11, 2022

Main Changes

  1. fix incorrect assertion functions: greater_than, less_than, greater_or_equals, less_or_equals, adjust the sequence of parameters (actual and expected) of assertion function proto.
  2. fix incorrect json number parse rule.

Ref: json.Unmarshal

To unmarshal JSON into an interface value, Unmarshal stores one of these in the interface value:
bool, for JSON booleans
float64, for JSON numbers
string, for JSON strings
[]interface{}, for JSON arrays
map[string]interface{}, for JSON objects
nil for JSON null

  1. fix panic when Assertions map key not found.
  2. fix unittest bad cases.

Change-Id: I68a811b803631ef78b6b12fe548f98b676a10eb3
Change-Id: I66f25fcf00e36e83308e820b859b4a94907833fc
Change-Id: I41911d2a723ac64d5aa0cdf6b3f99b2554c6a196
@bbx-winner bbx-winner linked an issue Feb 11, 2022 that may be closed by this pull request
Change-Id: I12bc6425e098b62b08bd5ca2fb7a9cc0482e1910
Change-Id: I1e475e8187f6e793cd9f9029af93a7d80603b26d
Change-Id: I3989c88355fe3d70f4753e737e0d0dd4c059c9eb
Change-Id: Ifb364a943351f3762f5784fb8d84d9eb385a383f
Change-Id: Ieae673e12c7baabe231d7f3509bba18624d80431
@codecov-commenter
Copy link

codecov-commenter commented Feb 14, 2022

Codecov Report

Merging #83 (76cb479) into main (5ede366) will decrease coverage by 0.05%.
The diff coverage is 50.98%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #83      +/-   ##
==========================================
- Coverage   55.73%   55.67%   -0.06%     
==========================================
  Files          29       28       -1     
  Lines        3628     3630       +2     
==========================================
- Hits         2022     2021       -1     
  Misses       1461     1461              
- Partials      145      148       +3     
Flag Coverage Δ
unittests 55.67% <50.98%> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
response.go 69.23% <28.57%> (-2.33%) ⬇️
runner.go 59.40% <41.17%> (-0.36%) ⬇️
internal/builtin/assertion.go 33.85% <60.00%> (+4.93%) ⬆️
parser.go 84.89% <100.00%> (-0.23%) ⬇️
internal/boomer/ulimit_windows.go

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c57e32e...76cb479. Read the comment docs.

Change-Id: I583aa6344fff967285b024fddef9f45ac8ee2baf
Change-Id: I85d477f85844eee2d98f6231c16b57803a41aba7
docs/BUILTIN.md Outdated
| `startswith` | starts with | A.startswith(B) is True | 'abc' startswith 'ab' |
| `endswith` | ends with | A.endswith(B) is True | 'abc' endswith 'bc' |
| `regex_match` | regex matches | re.match(B, A) | 'abcdef' regex_match 'a\w+d' |
| `starts_with` | starts with | A.starts_with(B) is True | 'abc' starts_with 'ab' |
Copy link
Member

Choose a reason for hiding this comment

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

还是保留 startswith/endswith 吧;更自然些,而且跟 Python 版本保持一致

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed

{
"config": {
"name": "request methods testcase: validate with parameters",
"base_url": "https://httpbingo.bytedance.net"
Copy link
Member

Choose a reason for hiding this comment

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

代码中不要带字节的内网域名。示例代码还是使用 postman echo 的吧

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed

Change-Id: I3e1c6fd82812d13b4e23ecd6b23c4d57170852e1
Change-Id: I6fdf2291bdf953f19ee6e9474020a2ab72186acf
@debugtalk debugtalk merged commit 57519be into httprunner:main Feb 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants