Relative profile path should be valid for creation commands - #8685
Conversation
Signed-off-by: Uilian Ries <uilianries@gmail.com>
Signed-off-by: Uilian Ries <uilianries@gmail.com>
Signed-off-by: Uilian Ries <uilianries@gmail.com>
Signed-off-by: Uilian Ries <uilianries@gmail.com>
Signed-off-by: Uilian Ries <uilianries@gmail.com>
Signed-off-by: Uilian Ries <uilianries@gmail.com>
Signed-off-by: Uilian Ries <uilianries@gmail.com>
Signed-off-by: Uilian Ries <uilianries@gmail.com>
Signed-off-by: Uilian Ries <uilianries@gmail.com>
memsharded
left a comment
There was a problem hiding this comment.
It is great the modernizing of tests to pytest, thanks for taking the time!,
But on the other hand it is practically impossible to see if something might be breaking. Could you please split this into 2 PRs, one pure-refactor of tests, nothing else changing, and then the new fix with the new tests covering it?
Thanks!
|
Yes, totally. Indeed is terrify for review. |
Signed-off-by: Uilian Ries <uilianries@gmail.com>
|
@memsharded Done |
|
Second PR: #8729 |
memsharded
left a comment
There was a problem hiding this comment.
This is quite risky:
- I have reverted the changes to
profile_loader.py, and the new tests are green! This means the tests are not testing this change, but just the previous existing functionality. - It is likely that we are breaking something, the condition might change for paths like
relative/path/to/profile.txtthat do not start with. - It is clear that the different paths functionality is not sufficiently covered by tests, we would need more thorough testing to make sure we are not breaking.
So I think we cannot merge these changes as-is.
Signed-off-by: Uilian Ries <uilianries@gmail.com>
Indeed is tricky, I needed to add
The fragility is because we need to follow not equal profile names, but also profiles folder. |
|
Okay, unit test working as spectated: https://ci.conan.io/blue/organizations/jenkins/ConanTestSuite/detail/PR-8685/8/pipeline/#step-278-log-1537 |
Signed-off-by: Uilian Ries <uilianries@gmail.com>
Signed-off-by: Uilian Ries <uilianries@gmail.com>
| os=Windows"""), self.client.out) | ||
|
|
||
|
|
||
| def test_profile_from_cache_path(): |
There was a problem hiding this comment.
@uilianries please check this new test that I have provided. This would be proving that the previous fix was breaking, very likely massively breaking many users (all of them that manages profiles in subfolders in the cache).
The new proposed fix is more conservative and passes your new tests, please check if there is some other case to take into account.
There was a problem hiding this comment.
There was a problem hiding this comment.
Actually this should go to integration, not functional (as they don't depend on external tools), but until this is fixed, yes, it can co here.
Yes, it makes sense to have a few more tests here to cover better this functionality, please add some. Try to keep them simple, as the proposed one. Thanks!
Signed-off-by: Uilian Ries <uilianries@gmail.com>
memsharded
left a comment
There was a problem hiding this comment.
Please try the proposed simplification to tests.
Signed-off-by: Uilian Ries <uilianries@gmail.com>
|
I have fixed the broken test in 8295aef. It was incorrectly managing paths, and it was creating folders in the code folder repo, making it dirty (and with risk to commit them accidentally) |
Conan accepts absolute and relative paths for profiles, that's well documented.
We know the main recommendation is absolute, but relative path is not working well when is associated to same tree level, and profile names is same from default profile folder. If a default profile doesn't exist, it works well, but when duplicated, Conan prefers default profiles folder instead.
fixes #8678
Changelog: Fix: Accept relative profile path when folder is on same tree level.
Docs: conan-io/docs#2049
developbranch, documenting this one.Note: By default this PR will skip the slower tests and will use a limited set of python versions. Check here how to increase the testing level by writing some tags in the current PR body text.