Skip to content

Convert existing tests from xml to yaml, and use the yaml2xml converter in the test cases#972

Merged
stevenengler merged 65 commits intoshadow:devfrom
florian-vuillemot:transform_xml_test_to_yaml
Sep 28, 2020
Merged

Convert existing tests from xml to yaml, and use the yaml2xml converter in the test cases#972
stevenengler merged 65 commits intoshadow:devfrom
florian-vuillemot:transform_xml_test_to_yaml

Conversation

@florian-vuillemot
Copy link
Copy Markdown
Contributor

@codecov
Copy link
Copy Markdown

codecov bot commented Sep 10, 2020

Codecov Report

Merging #972 into dev will decrease coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev     #972      +/-   ##
==========================================
- Coverage   53.58%   53.56%   -0.02%     
==========================================
  Files         129      129              
  Lines       18383    18383              
  Branches     4407     4407              
==========================================
- Hits         9850     9847       -3     
  Misses       5822     5822              
- Partials     2711     2714       +3     
Flag Coverage Δ
#tests 53.56% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/main/core/support/configuration.c 47.17% <0.00%> (-0.50%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b979704...728c818. Read the comment docs.

@robgjansen
Copy link
Copy Markdown
Member

FYI, @stevenengler from our dev team will be helping move this along :)

@stevenengler
Copy link
Copy Markdown
Contributor

Once you're ready for me to take a look, just mark me as a reviewer (I'm not sure if you're still making changes).

@florian-vuillemot
Copy link
Copy Markdown
Contributor Author

@stevenengler yes please, you could. Don't hesitate to check the recent comment of @robgjansen on the #773 to be sure we all follow the same idea.
I let the "WIP", because I will work on other tests once you will have validated this first step.

Copy link
Copy Markdown
Contributor

@stevenengler stevenengler left a comment

Choose a reason for hiding this comment

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

Looks good, just added a few changes, and after those feel free to convert the other test cases.

@florian-vuillemot
Copy link
Copy Markdown
Contributor Author

@stevenengler everything looks good to you ? Can I spread this method on others tests ?

@stevenengler
Copy link
Copy Markdown
Contributor

@stevenengler everything looks good to you ? Can I spread this method on others tests ?

Looks good to me, thanks for making the changes! And yep, adding this to the other tests sounds good.

@stevenengler
Copy link
Copy Markdown
Contributor

If you haven't started on the src/test/socket/* tests, you can leave those and I can do them later since I'm currently modifying them. (If you've already started them that's fine too.)

@florian-vuillemot
Copy link
Copy Markdown
Contributor Author

@stevenengler ok I will ignore them

@florian-vuillemot florian-vuillemot force-pushed the transform_xml_test_to_yaml branch from 86f618e to ab173d1 Compare September 19, 2020 09:17
@florian-vuillemot
Copy link
Copy Markdown
Contributor Author

@sporksmith I let src/test/phold/phold.test.shadow.config.xml and src/test/file/file.test.shadow.config.xml because there is a commentary in them. Should I update the script to take care of the comment or should I remove them or put them in another place ?

@florian-vuillemot
Copy link
Copy Markdown
Contributor Author

@stevenengler , could you give me a hand with the centos7 error ?

@stevenengler
Copy link
Copy Markdown
Contributor

@florian-vuillemot: it looks like the xml2yaml script isn't converting the environment attribute on the shadow element.

<!--
The LD_LIBRARY_PATH here points to where we put the patched libc binaries in
our CI, to work around https://github.com/shadow/shadow/issues/892. It should
have no effect in environments where that directory doesn't exist.
-->
<shadow stoptime="5" environment="LD_LIBRARY_PATH=/opt/libc-interpose-centos7">

@florian-vuillemot
Copy link
Copy Markdown
Contributor Author

Well, I will pay more attention the next time I will check the conversion.. Thank you !

@stevenengler
Copy link
Copy Markdown
Contributor

No problem, is this a bug in the script that we should fix? I took a quick look but I don't see an obvious reason why it would skip that attribute.

@sporksmith
Copy link
Copy Markdown
Contributor

@sporksmith I let src/test/phold/phold.test.shadow.config.xml and src/test/file/file.test.shadow.config.xml because there is a commentary in them. Should I update the script to take care of the comment or should I remove them or put them in another place ?

Updating the script to preserve comments would be a nice feature, though manually recreating the comments would also be ok.

@florian-vuillemot
Copy link
Copy Markdown
Contributor Author

@stevenengler after having tested the convert.py script I think I might have forgotten to run the script on the new (merged) XML file with the environment option ^^

@florian-vuillemot
Copy link
Copy Markdown
Contributor Author

@sporksmith I let src/test/phold/phold.test.shadow.config.xml and src/test/file/file.test.shadow.config.xml because there is a commentary in them. Should I update the script to take care of the comment or should I remove them or put them in another place ?

Updating the script to preserve comments would be a nice feature, though manually recreating the comments would also be ok.

I just copy/past commentaries because it is quick, simple and I don't think we will have a huge amount of files with commentaries, so automation does not look mandatory. If I'm wrong, don't hesitate to open an issue and assign it to me.

@florian-vuillemot florian-vuillemot changed the title [WIP] Convert existing tests from xml to yaml, and use the yaml2xml converter in the test cases Convert existing tests from xml to yaml, and use the yaml2xml converter in the test cases Sep 21, 2020
@florian-vuillemot florian-vuillemot force-pushed the transform_xml_test_to_yaml branch from d10df79 to 43e94f0 Compare September 23, 2020 07:22
Copy link
Copy Markdown
Contributor

@stevenengler stevenengler left a comment

Choose a reason for hiding this comment

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

Other than the indentation, looks good to me. I'll take another look for typos in a final review, but I didn't see any on this pass.

@robgjansen
Copy link
Copy Markdown
Member

FYI, yesterday I merged another test in src/test/futex that should probably also be converted. Sorry!

@florian-vuillemot florian-vuillemot force-pushed the transform_xml_test_to_yaml branch from 43e94f0 to 56e247e Compare September 24, 2020 09:02
Copy link
Copy Markdown
Contributor

@stevenengler stevenengler left a comment

Choose a reason for hiding this comment

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

Almost there!

@stevenengler
Copy link
Copy Markdown
Contributor

I also just noticed that there are two other directories that need to be converted, src/test/tcp and src/test/poll. Some of these are currently commented out, but I hope to re-enable them soon, so they would be good to convert.

@stevenengler stevenengler merged commit 2bde4a1 into shadow:dev Sep 28, 2020
@stevenengler
Copy link
Copy Markdown
Contributor

Thanks @florian-vuillemot for the changes! It's great to be another step closer to full yaml support. I've checked the box at #773 (comment) since I'm not sure which accounts are allowed to edit comments by other accounts.

@robgjansen
Copy link
Copy Markdown
Member

Woo! Thanks for all the work to get this merged! 🥇

@florian-vuillemot florian-vuillemot deleted the transform_xml_test_to_yaml branch September 28, 2020 19:37
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.

4 participants