-
-
Notifications
You must be signed in to change notification settings - Fork 198
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
Tasks run from wrong folder on update with 6.0.0a6 #377
Comments
Thanks for testing the alpha and for reporting, I'll add this to the v6 roadmap. |
I've been looking at this more and I've now triggered it on the v5 aslo. But I think I see what's actually happening. As part of the update process the template is cloned into an empty directory and then diffed against the actual final directory. During the initial copy into the tmp directory it's running the tasks and I have tasks which expect files in the destination directory which fail. I'm not sure how to best handle that. I can catch the errors and just exit clean, but I actually wanted to fail if the destination folder doesn't match expectation. I'm applying this template as a delta on top of another folder structure and If the structure doesn't match what I expect I would like it to fail. |
There are a couple of ideas that come to my mind.
|
Tests fail with something that doesn't seem related to copier:
So I ran the test manually:
The interesting part is:
Which shows clearly that invoke finds the Also, the failure:
Is correct:
So, AFAICS, all these are bugs in the template itself, not something related to copier. Regarding the issue at hand, our CI asserts that the tasks are executed in the dst directory always. You can check the test here, and see that it's passing. Unless there's a bug in the test, this issue is fixed in our side: Lines 8 to 43 in 93d95a6
Feel free to reopen if needed 😊 |
I switched from using copier 5.1.0 to the latest 6.0.0a6 to avoid copier deleting a folder that it didn't create. However with the v6 version I'm having an issue with tasks getting executed by invoke during a copier update.
With version 5 the tasks run as expected, but with v6 during an update tasks that call invoke don't run from the destination folder but from the template sub-folder, where it can't find the expected files.
The template can be found at the v6 branch here: https://github.com/charmed-kubernetes/pytest-operator-template/tree/v6
You can run the
tox -e integration
and you'll see that it fails when it invokes one of the scripts because it can't find the file, which is in the destination folder the task is just not being run in the correct location.The text was updated successfully, but these errors were encountered: