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

Investigate inconsistencies in tests #187

Closed
ganning127 opened this issue Aug 8, 2023 · 6 comments
Closed

Investigate inconsistencies in tests #187

ganning127 opened this issue Aug 8, 2023 · 6 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@ganning127
Copy link
Contributor

ganning127 commented Aug 8, 2023

create, list, rename, copy, move, and remove file should be (to account for linux vs macOS)

# error code 1 on mac, error code 2 on linux
[ ! $status -eq 0 ]
# [[ "${output}" == *"ls: cannot access"* ]] # this line doesn't hold true on mac
[[ "${output}" == *"${FILENAME}"* ]]
[[ "${output}" == *"No such file or directory"* ]]

failing on linux, but not on macOS (on 46.main.restart branch)

  • listing directory with large number of entries prints all entries
  • rename directory

ocasionally failing on macOS (on main), but can't re-produce. it's happened once or twice out of all the times I've ran these tests

  • move file into directory
@korydraughn korydraughn added the bug Something isn't working label Aug 8, 2023
@trel
Copy link
Member

trel commented Aug 8, 2023

so we need a little switch/case statement for the two OSs that exhibit different behavior.

NFSRODS is fine, this is just capturing the correct expectations in the testing.

@korydraughn
Copy link
Collaborator

I don't think we even need to detect the difference between the OSs.

The test only needs to confirm that a non-zero error code is returned and the common part of the error message exists. Essentially, what's already reported in the BATs sample.

@trel
Copy link
Member

trel commented Aug 8, 2023

that's fair - if we just want to assert non-zero.

@korydraughn
Copy link
Collaborator

I think this may be due to the BATS (the test framework) rather than NFSRODS. For example:

  • Running the tests, rename file and rename directory together results in rename directory failing
  • Running rename directory by itself results in it succeeding
  • Passing the current directory to /bin/ls in the rename directory test results in the test passing in either of the cases previously mentioned

Executing the commands manually succeed too, so this makes me think we may have written a bad test.

@korydraughn
Copy link
Collaborator

This situation turned out to NOT be BATS.

This was an actual bug in the implementation where we weren't clearing some caches at the correct moments.

With the recent commits, the tests pass consistently.

@trel
Copy link
Member

trel commented Oct 25, 2023

Wild. Thanks tests!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

3 participants