test: adjust flaky test which relies on filesystem permissions#481
Merged
Conversation
tromai
approved these changes
Sep 21, 2023
behnazh-w
reviewed
Sep 22, 2023
| """Test dumping the default values.""" | ||
| output_dir = os.path.dirname(os.path.abspath(__file__)) | ||
| assert create_defaults(output_dir, global_config.macaron_path) is True | ||
| assert create_defaults("/", "/") is False |
Member
There was a problem hiding this comment.
This particular test has been helpful in finding bugs related to permission issues in the past. Instead of removing it, please replace it by a testcase that raises OSError here.
Member
Author
There was a problem hiding this comment.
Do you have any suggestions for improving this test?
One solution I can think of now is to detect if the current user running tests is root, and disable the test if it is the case.
Member
Author
There was a problem hiding this comment.
I fixed the test in 2688398.
I set it to expect to fail in case the user is root.
Member
There was a problem hiding this comment.
The adjustment to the test looks good.
Signed-off-by: Nathan Nguyen <nathan.nguyen@oracle.com>
64770f7 to
2688398
Compare
behnazh-w
approved these changes
Sep 22, 2023
| """Test dumping the default values.""" | ||
| output_dir = os.path.dirname(os.path.abspath(__file__)) | ||
| assert create_defaults(output_dir, global_config.macaron_path) is True | ||
| assert create_defaults("/", "/") is False |
Member
There was a problem hiding this comment.
The adjustment to the test looks good.
art1f1c3R
pushed a commit
that referenced
this pull request
Nov 29, 2024
Signed-off-by: Nathan Nguyen <nathan.nguyen@oracle.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I am removing a test that fails in environments where the user running the test actually has write access to the
/directory.This may happen in, for example, a test environment inside a container where the user is
root, which is quite common in CI systems (e.g. GitLab Runner with docker executor, or Jenkins docker pipelines).