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

Fix #144 #147

Closed
wants to merge 9 commits into from
Closed

Fix #144 #147

wants to merge 9 commits into from

Conversation

rbeagrie
Copy link
Contributor

Fix for issue #144

Catch the exception thrown when dependencies and targets are both missing. Also added regression test for this issue.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.0005%) to 99.79% when pulling 84ad212 on rbeagrie:fix-144-reset-dep into 234d9bd on pydoit:master.

try:
self.dep_manager.save_success(task, result_hash=result)
except OSError as e:
write("failed {} ({})\n".format(task.name, e))
Copy link
Member

Choose a reason for hiding this comment

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

This the Error message will be different than the your use-case when you removed only line_3.txt.

I would prefer if we explicitly check all file_deps exist. So we wont even need to check for res.status == "error".

@coveralls
Copy link

Coverage Status

Coverage increased (+0.0007%) to 99.79% when pulling d94e172 on rbeagrie:fix-144-reset-dep into 234d9bd on pydoit:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.0007%) to 99.79% when pulling 2ae417d on rbeagrie:fix-144-reset-dep into 234d9bd on pydoit:master.

@rbeagrie
Copy link
Contributor Author

Sorry about the commit spam - tests are passing on my local PC but not on Appveyor so I'm having trouble debugging. I'm still not sure what the problem is, one test is complaining that the database is in use by another process...?

@schettino72
Copy link
Member

no worries about spam 😁

Looks like the error is not caused by you. just ignore it.

@schettino72
Copy link
Member

i just re-run an old commit (that was successful), it now fails. So the problem must be some change on appveyor...

Of course you are welcome to fix the issue. But better do this in another PR.

@rbeagrie
Copy link
Contributor Author

OK great! Let me know if you're OK with this PR and I'll squash the commits.

On 16 Sep 2016 5:32 p.m., "eduardo naufel schettino" <
notifications@github.com> wrote:

i just re-run an old commit (that was successful), it now fails. So the
problem must be some change on appveyor...

Of course you are welcome to fix the issue. But better do this in another
PR.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#147 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAgsac4dXhkcqX9nIwZmoOtcdNDiVYB4ks5qqsSmgaJpZM4JkkJy
.

Copy link
Member

@schettino72 schettino72 left a comment

Choose a reason for hiding this comment

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

Thanks for working again on this.

I would prefer that you do NOT squash commits. I will squash it myself when merging.

@@ -65,7 +71,9 @@ def _execute(self, pos_args=None):
continue

task.values = values

Copy link
Member

Choose a reason for hiding this comment

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

i like a lot of blank lines but this seems excessive.

@@ -31,6 +31,22 @@ def remove_dependency():

# fixture to create a sample file to be used as file_dep
@pytest.fixture
def dependency2(request):
Copy link
Member

@schettino72 schettino72 Sep 16, 2016

Choose a reason for hiding this comment

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

Copy and paste here is not acceptable.
Note that removing copy and paste here will NOT increase the complexity in the test itself (this code is on conftest).
Hopefully it will not sound contradictory or arbitrary comparing to my previous review.

# Skip exception when a depencency file is missing, and force
# the state computation
write("failed {} ({})\n".format(task.name, res.get_error_message()))
missing_deps = []
Copy link
Member

Choose a reason for hiding this comment

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

i guess this is a good candidate for a single line list-comprehension.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.0004%) to 99.79% when pulling 002102d on rbeagrie:fix-144-reset-dep into 234d9bd on pydoit:master.

@rbeagrie
Copy link
Contributor Author

I'm guessing that this sort of factory approach is the kind of thing you were thinking about for generating multiple similar fixtures? I couldn't find much documentation about how to do this with pytest so not sure if I'm missing a more obvious solution here...

@schettino72
Copy link
Member

merged thanks. sorry for delay. i forgot this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants