Assert codes instead of text when using NeoFS CLI tools #328

Open
opened 2025-12-28 18:15:56 +00:00 by sami · 3 comments
Owner

Originally created by @cthulhu-rider on GitHub (Dec 25, 2024).

tests dealing with NeoFS via CLI expect particular text sometimes. For example, recently i accidentally changed neofs-cli container get output from container not found to not found, and corresponding test FAIL

this seems good in terms of testing for changes in behavior, and in this particular case. But globally I thought that strict text checking is not always convenient: any improvement of the text makes the test FAIL. For example, if command output will be changed to Container not found - test will FAIL. I wanna two things at the same time:

  1. do not recv FAIL on test if only text output has been changed
  2. still get a behavior change report from the test

Describe the solution you'd like

  1. check resulting codes instead. There are two of them available: NeoFS status and exit code. Checking the NeoFS code would still be a text check, but:
  • rest of the cmd output can be changed freely
  • code correctness is more important than debug message (do we check codes btw? @evgeniiz321)

NeoFS status codes are also mapped into CLI exit ones one way or another. We can develop this behavior reduce text checks even more

  1. report about text change in warning. As i can see, they are available in current toolchain === 95 passed, 1 warning in 2239.92s (0:37:19) ===
Originally created by @cthulhu-rider on GitHub (Dec 25, 2024). ## Is your feature request related to a problem? Please describe. tests dealing with NeoFS via CLI expect particular text sometimes. For example, recently i accidentally changed `neofs-cli container get` output from `container not found` to `not found`, and corresponding test FAIL this seems good in terms of testing for changes in behavior, and in this particular case. But globally I thought that strict text checking is not always convenient: any improvement of the text makes the test FAIL. For example, if command output will be changed to `Container not found` - test will FAIL. I wanna two things at the same time: 1. do not recv FAIL on test if only text output has been changed 2. still get a behavior change report from the test ## Describe the solution you'd like 1. check resulting codes instead. There are two of them available: NeoFS status and exit code. Checking the NeoFS code would still be a text check, but: * rest of the cmd output can be changed freely * code correctness is more important than debug message (do we check codes btw? @evgeniiz321) NeoFS status codes are also mapped into CLI exit ones one way or another. We can develop this behavior reduce text checks even more 2. report about text change in warning. As i can see, they are available in current toolchain `=== 95 passed, 1 warning in 2239.92s (0:37:19) ===`
Author
Owner

@roman-khimov commented on GitHub (Feb 10, 2025):

Depends on neofs-cli error codes.

@roman-khimov commented on GitHub (Feb 10, 2025): Depends on neofs-cli error codes.
Author
Owner

@roman-khimov commented on GitHub (Feb 10, 2025):

See https://github.com/nspcc-dev/neofs-testcases/issues/257 also.

@roman-khimov commented on GitHub (Feb 10, 2025): See https://github.com/nspcc-dev/neofs-testcases/issues/257 also.
Author
Owner

@cthulhu-rider commented on GitHub (Apr 1, 2025):

stepped on it again: https://rest.fs.neo.org/HXSaMJXk2g8C14ht8HSi7BBaiYZ1HeWh2xnWPGQCg4H6/2894-1743456527/index.html started to fail after errors text improvements from https://github.com/nspcc-dev/neofs-node/pull/3216

@cthulhu-rider commented on GitHub (Apr 1, 2025): stepped on it again: https://rest.fs.neo.org/HXSaMJXk2g8C14ht8HSi7BBaiYZ1HeWh2xnWPGQCg4H6/2894-1743456527/index.html started to fail after errors text improvements from https://github.com/nspcc-dev/neofs-node/pull/3216
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nspcc-dev/neofs-testcases#328
No description provided.