-
Notifications
You must be signed in to change notification settings - Fork 57
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
HTTP Distributor Tutorial is Broken on Windows #515
Comments
I'll have a look at it. The HTTP distributor is pretty new, so there may well be problems in the implementation, tutorial, or anywhere. |
The only accurate record of that is in the badges of the README right now. I'll update |
My guess right now is that the problem is running on Windows. I'm able to work through the HTTP Distributor tutorial on python 3.9 / macos with no problems, so a platform difference seems like the most likely culprit. I think I have a windows VM I can try this on, but it may take some time to get to it. |
Actually, I think I see what's going on. The call to I think the error is on lines 68-69 where we remove a task from @FloatingSunfish If you're feeling adventurous, could you swap lines 68 and 69 in |
Thanks for looking into this, @abingham. I've been looking for any Python mutation testing tool and Cosmic Ray looks very promising. I've looked at >@FloatingSunfish If you're feeling adventurous, could you swap lines 68 and 69 in |
I'm happy to help support you as much as I can, though my time is a bit limited right now. CR does work well when all of the stars align; as you're finding, though, I struggle to keep the documentation up to date, and I don't do any testing on Windows. |
@abingham >I don't do any testing on Windows |
@abingham Perhaps it's not yet there? |
From the root directory (the one containing |
@abingham I'll let you know the results as soon as I can. 🙂 |
@abingham As for the solution you suggested, swapping those two lines didn't work and it also made the baseline constantly fail:
No idea why it can't find Also, when I ran Perhaps it is a race condition as you said. Testing on a Windows VM on your end might be the best way to investigate this issue, but feel free to toss some easy code edits my way and I'll try to see what I can check on my side as well. 🙂 |
I see that the baseline is using a HTTP Distributor. This should be fine, but are you sure you've started the |
@abingham You might want to add this detail in the docs that you must only start the worker in the directory where you will be running CR. 🙂 In the meantime, I'll try again and see what happens. |
I've updated the docs to add a note that effect. |
@abingham The good news is that baseline testing is now working as expected and mutation testing passes with workers on the first try. The bad news is that on the second and subsequent tries, mutation testing constantly fails with the error in the OP. |
@abingham Note that your worker must be running in the same directory as you would normally run the tests from. |
Ok, then there's something more mysterious going on. I'll have to try it out on windows. We may have to add some sort of check that |
@abingham Best of luck to you then! 🙂 |
@abingham |
You need to re-init when you make changes. |
@abingham I think you should add this detail in the Oh, and some more quick questions:
|
CR is designed to be robust against interrupts and crashes. To a large degree, we rely on sqlite to handle that. When you run |
Good day, @abingham. 🙂
|
CR tries hard to avoid this possibility, but it might still be possible. Tests are run in a subprocess, so even if they die horribly, the CR worker process should be able to undo the mutations. Generally speaking, though, I'd recommend committing everything prior to testing; this will be important, for example, if you're using the
This isn't always strictly necessary. For example, changing your distributor won't require a re-initialization. Changing your test-command or excluded-modules generally would necessitate a re-init since this would effect which tests are run (thus potentially invalidating existing results).
Not currently, though that should be straightforward to implement if you're so inclined. On a *nix system you could do something like:
It looks like this feature doesn't work right now. I've create #517 as a reminder to reimplement this as a filter.
Yes, that looks correct. Regular expressions are an option, not a requirement. In your case of excluding a single operator, what you've done is fine.
Our pragma filter only works on lines of code, not code blocks. It's quite a crude filter, really, but sufficient for many purposes. |
Noted. Thanks for the answers, @abingham! 🙂 Below are some follow-up questions:
|
Could you bundle these documentation issues up into another issue? That'll make it easier for me to keep track of them. Or, if you're feeling energetic, you could update the docs yourself; I'm always happy to get these kinds of contributions because they almost always deal with my particular blind spots.
Not right now. Something like this would presumably require syntactic analysis of the code, so it wouldn't be trivial (though I don't think it would be terribly complicated either). There may even be an existing library we could leverage that helps us process the pragmas. If this is something you'd like, it would be helpful to create another issue for it. |
@abingham I also renamed this issue so it will be focused on the HTTP Distributor issue on Windows. By the way, any updates on this issue? Thanks! 🙂 |
Thanks for doing that. It really helps me keep track of what's going on. I'm actually ready to close this issue. I'm nearly certain that #516 addresses your initial problems. It's not an issue on windows, just an issue with my logic in the HTTP distributor. So I'll close this issue and sort things out over there. |
I'm on Python 3.9.6 and following the HTTP Distributor tutorial produces the following error:
Where can I find the latest Python version that Cosmic Ray supports?
Also, I am not sure if the problem is with the tutorial, with Cosmic Ray itself, or an incompatibility with the version of Python on my system.
Any advice?
The text was updated successfully, but these errors were encountered: