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
Integration of pytest #2550
Integration of pytest #2550
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2550 +/- ##
==========================================
+ Coverage 84.57% 87.49% +2.91%
==========================================
Files 296 267 -29
Lines 62137 55824 -6313
==========================================
- Hits 52555 48845 -3710
+ Misses 9582 6979 -2603
|
a283482
to
ceaf8c3
Compare
Please don't merge this as is. I'm still unsure whether it's best to move to pytest because of how massive the work will probably end up being.. |
This is absolutely not ready for merge. Sorry for not mentioning this.
The produced files will all need manual rework.
This is just a starting point. The use of pytest needs to be evaluated for the tests, in my opinion.
--
Viele Grüße
Nils Weiß
…On March 26, 2020 5:21:07 PM GMT+01:00, Gabriel ***@***.***> wrote:
Please don't merge this as is.
This is a great script but I'd like to see how well it works (a fully
converted file) before doing anything.
I'm still unsure whether it's best to move to pytest because of how
massive the work will probably end up being..
--
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#2550 (comment)
|
I've added pytest to tox (just for PoC, not added everywhere). What about supporting pytest and UTscapy in parallel? |
@gpotter2 @guedou @p-l- Would it make sense to open the unit test system to allow contributors to write tests in *.uts or pytest? |
This is a really cool PR. It its definitely worth finishing it and merging. If @gpotter2 and @p-l- are OK, I think that we should move to pytest and leave UTScapy behind us. After merging this PR, the next step will be to mandate that new unit tests are written with pytest while we migrate all tests. Did you try concurrent testing? I will be interested to know if moving to pytest will also make the testing time shorter. |
Thanks for your feedback. I will continue my work on this PR. I will probably start to port regression.uts to pytest, to see if this concept holds. |
I agree with @guedou that this is very cool, and it would be great to be able to migrate to pytest, but we must make sure everything works before doing that. Thé |
I totally agree, the UTscapy file is pretty much filled with stuff. I did a rough analysis of the current functionality.. in my opinion, some function might not be useful, some functions will be available in pytest. Most important is the tag system, which I could "somehow" port to pytest. |
Before converting moving to pytest, I think that it will make sense to split First, it will make your life easier when adding or looking for a unit test, then we will be able to convert to |
That is really great. Thanks a lot for this work. I agree with @guedou that we may want so split |
180aaff
to
862583f
Compare
435368a
to
691c0fe
Compare
Hi, I've updated this PR and would like to open it for your review. I made some first ports to pytest. I used the Co-Author tag to preserve the original authors ( I would suggest the enforcement of flake8 for unit tests. The possibility of pytest would help us to have much cleaner unit tests, in my opinion. |
691c0fe
to
4b23a90
Compare
And another question. Should there be a copyright notice on unit tests? |
Thanks for your answer. I can understand all your points. In terms of performance you are probably right. The main advantages I see in pytest compared to UTScapy are:
In my opinion, these additions to the test system will lead us to cleaner and more maintainable tests in the future. Furthermore, pytest comes with a whole bunch of extensions. A main problem, that you also mentioned, is the transition from UTScapy to pytest. If there is no way for you to have both systems coexisting for a certain period, for example one release cycle, I totally agree, that a huge effort is required to make a fast switch. Which is almost not affordable for a open source project. To summarize my opinions, if coexistence of two test systems for a certain time is a no go, we can stop here with pytest. |
92e3274
to
c28b9af
Compare
5be30f3
to
0aa5198
Compare
0aa5198
to
ab9c508
Compare
ab9c508
to
0dc7496
Compare
0dc7496
to
38e2a0f
Compare
38e2a0f
to
a86a628
Compare
A small utility in UTscapy should allow a fast porting of existing *.uts files
Co-Authored-By: Gabriel Potter <gabriel@potter.fr> Co-Authored-By: Pierre LALET <pierre.lalet@cea.fr> Co-Authored-By: Guillaume Valadon <guillaume@valadon.net>
Co-Authored-By: Gabriel Potter <gabriel@potter.fr>
Co-Authored-By: Gabriel Potter <gabriel@potter.fr> Co-Authored-By: Pierre LALET <pierre.lalet@cea.fr> Co-Authored-By: sebastien mainand <sebastien.mainand@ssi.gouv.fr>
Co-Authored-By: Gabriel Potter <gabriel@potter.fr> Co-Authored-By: Andreas Korb <Andreas.D.Korb@gmail.com>
…nsocket_python_can.py Co-Authored-By: Gabriel Potter <gabriel@potter.fr> Co-Authored-By: Andreas Korb <Andreas.D.Korb@gmail.com>
Co-Authored-By: Guillaume Valadon <guillaume@valadon.net> Co-authored-by: Phil <phil@secdev.org> Co-authored-by: gpotter2 <gabriel@potter.fr> Co-authored-by: Michael Farrell <micolous+git@gmail.com> Co-authored-by: Pierre Lalet <pierre@droids-corp.org>
Co-Authored-By: Guillaume Valadon <guillaume@valadon.net> Co-authored-by: Pierre Lalet <pierre@droids-corp.org>
…UTscapy" This reverts commit c28b9affa63ffbdc8f0bc2eb8770faa8a1455fb5.
a86a628
to
8e24fdf
Compare
closed, because its broken |
Honnestly I think it's a decent idea, and maybe one day we'll be happy to have it as a basis. |
I'd add that pytest should make it much easier to catch resource warnings like #3962 (comment) as well as other warnings produced by
I think it would be easier to switch to pytest if it was possible to convert the tests one by one. |
Hello together, I would like to come back to this issue. I'm wondering, if we could start supporting pytest, in order to have to opportunity to start a transition from UTScapy to pytest. |
I've made a few tests, apparently chatGPT is really useful to translate unit tests from UTScapy to pytest. This would allow a transition from UTScapy to pytest with a fraction of the effort, compared to doing everything manually. |
I still believe that it is a good idea to move to pytest. However, I am scared by the amount of work and review time as well as the fear that we will stop the migration before it is fully completed.We could start by splitting regression.uts into smaller pieces and use this opportunity to store uts files under the same architecture as scapy/Then, we could start the migration step by step by submitting small PR.What do you think?Sent from my iPhoneOn 6 Jun 2023, at 13:04, Nils Weiss ***@***.***> wrote:
I've made a few tests, apparently chatGPT is really useful to translate unit tests from UTScapy to pytest. This would allow a transition from UTScapy to pytest with a fraction of the effort, compared to doing everything manually.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
For me @guedou your idea makes sense. I will someday sit, reading tests/ folder contents, search for UTScapy specific behavior and start porting to pytest, folder by folder. Will take time, but I will step up to it :) |
This is just a PoC. A *.uts file will be transformed to a pytest like file. The exported file usually needs manual modifications, but this exporter can be a first step towards pytest