-
Notifications
You must be signed in to change notification settings - Fork 147
Wrap different ways of IResource read-only property access in tests #2379
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
base: master
Are you sure you want to change the base?
Wrap different ways of IResource read-only property access in tests #2379
Conversation
Some tests still access the deprecated IResource#isReadyOnly() and IResource#setReadOnly(). Some do that by intent to test the deprecated functionality, some have not been adapted to (also) test the new way of accessing that property. This leads to potentially missed test paths and also produces useless warnings. This change parameterizes the existing callers in tests to test both the legacy API as well as the recommended one..
Test Results 1 899 files - 54 1 899 suites - 54 1h 31m 11s ⏱️ + 5m 34s For more details on these failures and errors, see this check. Results for commit 89790cb. ± Comparison against base commit 341ca64. This pull request removes 5 and adds 9 tests. Note that renamed tests count towards both.This pull request removes 1 skipped test and adds 1 skipped test. Note that renamed tests count towards both. |
| assertThat(folder).matches(res -> isReadOnly(res, apiVersion), "is read only"); | ||
| CoreException exception = assertThrows(CoreException.class, | ||
| () -> file.create(createRandomContentsStream(), true, createTestMonitor())); | ||
| assertEquals(IResourceStatus.PARENT_READ_ONLY, exception.getStatus().getCode()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test failure caused by this test extension indicates that the behavior on Linux expected by the test is not given when setting the read-only property for a folder via ResourceAttributes instead of using the deprecated setReadOnly() method:
AutomatedResourceTests AllRegressionTests IFileTest.testBug25662(ReadOnlyApi)[1] CURRENT
expected: <277> but was: <273>
The test is about expecting a failure with status IResourceStatus.PARENT_READ_ONLY when creating a file in a folder that was marked as read only. But this only seems to happen when the folder was marked as read only via IResource#setReadOnly() and not via IResource#setResourceAttributes().
@akurtakov do you think this is something that should be fixed for the Linux implementation or should I just revert the test extension here and keep it limited to the deprecated method IResource#setReadOnly() as it was before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to fix the Linux implementation
Some tests still access the deprecated IResource#isReadyOnly() and IResource#setReadOnly(). Some do that by intent to test the deprecated functionality, some have not been adapted to (also) test the new way of accessing that property. This leads to potentially missed test paths and also produces useless warnings.
This change parameterizes the existing callers in tests to test both the legacy API as well as the recommended one..