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

Add tests for import_tasks and include_tasks target lookup #1445

Merged
merged 1 commit into from
Mar 9, 2021

Conversation

europ
Copy link
Contributor

@europ europ commented Mar 8, 2021

Ansible-lint incorrectly evaluates the file path when import_tasks or include_tasks is used because of a bug that was reported in the following issue #1446.

test/TestImportTasks.py Outdated Show resolved Hide resolved
test/TestImportTasks.py Outdated Show resolved Hide resolved
test/TestImportTasks.py Outdated Show resolved Hide resolved
test/TestImportTasks.py Outdated Show resolved Hide resolved
@webknjaz
Copy link
Member

webknjaz commented Mar 8, 2021

simple test for #540

Please adjust the explanation and the title to mention what this test is about.

test/TestImportTasks.py Outdated Show resolved Hide resolved
@webknjaz webknjaz added the skip-changelog Can be missed from the changelog. label Mar 8, 2021
test/TestImportTasks.py Outdated Show resolved Hide resolved
test/TestImportTasks.py Outdated Show resolved Hide resolved
@webknjaz webknjaz changed the title new test for 'import_tasks' Add tests for import_tasks and include_tasks target lookup Mar 8, 2021
@europ europ force-pushed the test_for_import_tasks branch 3 times, most recently from 1a2da16 to 7024149 Compare March 8, 2021 21:30
Regression tests for issue number 1446
Copy link
Member

@webknjaz webknjaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it looks great now. But I'll leave it to @ssbarnea to merge this.

@pytest.mark.parametrize(
'ansible_project_layout',
(
pytest.param(LAYOUT_IMPORTS, id='using only import_tasks'),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usually I prefer test ids that do not have spaces or special chars, so I can use them with -k without trouble but I will likely fix it next time we need to touch the test, hopefully soon for removal of xfail.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW spaced ids work with -k just fine. But I prefer concrete specifiers like tox -- 'test/TestFilePathEvaluation.py::test_file_path_evaluation[using only include_tasks]'

@ssbarnea ssbarnea merged commit 57aa3b8 into ansible:master Mar 9, 2021
@europ europ deleted the test_for_import_tasks branch March 9, 2021 12:45
This was referenced Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip-changelog Can be missed from the changelog.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants