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

fix(test): file.spec.131 moveTo may fail due to read order assumption #643

Merged

Conversation

breautek
Copy link
Contributor

Platforms affected

tests

Motivation and Context

On iOS (and I think any file api I've ever used), reading directories does not define any particular order of files. The iOS implementation uses contentsOfDirectoryAtPath:error: which states:

The order of the files in the returned array is undefined.

While this test does not appear to be failing actively on GH actions, it was failing for me locally due to the expectation assuming that they will be in a particular order.

Description

Reworked the test so that it will scan for each expected value and keep track which ones it has found.
Assertions of the expected item count remains.
Asserts that each item is found.

Testing

Ran mobilespec locally on iOS.

Checklist

  • I've run the tests to see all new and existing tests pass
  • I added automated test coverage as appropriate for this change
  • Commit is prefixed with (platform) if this change only applies to one platform (e.g. (android))
  • If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct keyword to close issues using keywords)
  • I've updated the documentation if necessary

@breautek breautek requested a review from erisu October 30, 2024 03:40
tests/tests.js Outdated Show resolved Hide resolved
@breautek breautek modified the milestone: 8.1.3 Nov 2, 2024
@breautek breautek force-pushed the fix/tests/intermediate-failure-on-test-131 branch from 30f3457 to 1a4e3d9 Compare November 3, 2024 13:48
@breautek breautek force-pushed the fix/tests/intermediate-failure-on-test-131 branch from 1a4e3d9 to 6f7b06e Compare November 3, 2024 13:54
@breautek breautek requested a review from dpogue November 3, 2024 14:04
@dpogue dpogue merged commit 42b5e8f into apache:master Nov 3, 2024
15 of 16 checks passed
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