-
Notifications
You must be signed in to change notification settings - Fork 654
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
Tests: Filenames returned by wcmatch prefixed with ./ cause fails #1836
Labels
Comments
sebix
added a commit
to sebix/ansible-lint
that referenced
this issue
Jan 28, 2022
calling WcMatch('.', ...) causes the resulting file names to be prefixed with `./`. If the tests are run in a git-repository, this is not an issue, as git is preferred of WcMatch in the code. Therefore remove the `./` prefix from the WcMatch return value to get the identical expected output. fixes ansible#1836
sebix
added a commit
to sebix/ansible-lint
that referenced
this issue
Jan 28, 2022
calling WcMatch('.', ...) causes the resulting file names to be prefixed with `./`. If the tests are run in a git-repository, this is not an issue, as git is preferred of WcMatch in the code. Therefore remove the `./` prefix from the WcMatch return value to get the identical expected output. fixes ansible#1836
sebix
added a commit
to sebix/ansible-lint
that referenced
this issue
Jan 28, 2022
calling WcMatch('.', ...) causes the resulting file names to be prefixed with `./`. If the tests are run in a git-repository, this is not an issue, as git is preferred of WcMatch in the code. Therefore remove the `./` prefix from the WcMatch return value to get the identical expected output. fixes ansible#1836
sebix
added a commit
to sebix/ansible-lint
that referenced
this issue
Feb 1, 2022
calling WcMatch('.', ...) causes the resulting file names to be prefixed with `./`. If the tests are run in a git-repository, this is not an issue, as git is preferred of WcMatch in the code. Therefore remove the `./` prefix from the WcMatch return value to get the identical expected output. fixes ansible#1836
sebix
added a commit
to sebix/ansible-lint
that referenced
this issue
Feb 1, 2022
calling WcMatch('.', ...) causes the resulting file names to be prefixed with `./`. If the tests are run in a git-repository, this is not an issue, as git is preferred of WcMatch in the code. Therefore remove the `./` prefix from the WcMatch return value to get the identical expected output. fixes ansible#1836
sebix
added a commit
to sebix/ansible-lint
that referenced
this issue
Feb 1, 2022
calling WcMatch('.', ...) causes the resulting file names to be prefixed with `./`. If the tests are run in a git-repository, this is not an issue, as git is preferred of WcMatch in the code. Therefore remove the `./` prefix from the WcMatch return value to get the identical expected output. fixes ansible#1836
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary
It started with a test fail of this test case:
https://github.com/ansible-community/ansible-lint/blob/02de5a48b2a11f6305783d415e7117e41de05585/test/TestUtils.py#L329-L338
The stacktrace was:
In essence, the filenames returned by
file_utils.discover_lintables
are prefixed by./
which is not expected by the test case and causes the fail.The bug is in https://github.com/ansible-community/ansible-lint/blob/02de5a48b2a11f6305783d415e7117e41de05585/src/ansiblelint/file_utils.py#L223 because it assumes the output of git and the
WcMatch
is identical, but whenWcMatch
is called with.
, the output is./...
.Will open a Pull Request with a fix.
Issue Type
Ansible and Ansible Lint details
OS / ENVIRONMENT
openSUSE Tumbleweed
STEPS TO REPRODUCE
Desired Behaviour
Test succeed
Possible security bugs should be reported via email to
security@ansible.com
Actual Behaviour
Test fails, see above
The text was updated successfully, but these errors were encountered: