-
Notifications
You must be signed in to change notification settings - Fork 11
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
Add sanitization option to host outputs #191
base: develop
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #191 +/- ##
===========================================
+ Coverage 47.17% 48.01% +0.83%
===========================================
Files 44 44
Lines 5314 5353 +39
Branches 1164 1171 +7
===========================================
+ Hits 2507 2570 +63
+ Misses 2549 2517 -32
- Partials 258 266 +8
|
Probably both approaches would make sense? It would be straightforward to add some additional quota-like output on the integration tests (i.e. properly replicating the setup on clusters where it's done at the global bashrc level) but for debugging purposes a mocked unit test would be nice too -- the integration test with bashrc will have to wait until I've finished the other PR (which is close). |
a588834
to
991a17d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good to me!
Just one thing about what we discussed, to probably add a specific check test in jf project check that tells the user what to try (i.e. setting sanitize_command to True) in case there is such spurious echos.
991a17d
to
ef7e3a5
Compare
I changed the way the prepend and append strings are generated, in order to be more brodly compatible with different shells. For future reference, we may also consider executing the commands in the local worker through the I will wait for confirmation that this still works fine in a real case before mergin. Concerning the test, if in the meanwhile the PR with the update of the integration tests is merged we can consider adding specific tests for this feature. |
Ok great, I resolved the comment on a possible specific integration test for this (I'm not even sure it is really needed, but let's see anyway after it has been confirmed and the other PR merged). |
An issue was raised concerning the execution of commands through the Host objects. If some text is added to the output of a remote host when executing a command (e.g. the disk quota) the qtk parsers fail to extract the output of the commands.
This PR adds an option to sanitize the output by prepending and appending and
echo
of a string to the command execution, both in the stdout and stderr. The outputs are then filtered to only considere the text enclosed inside the occurrences of string.At the moment there is only an integration test checking that with the sanitization option enabled the standard execution still works. @ml-evs is there any easy way of adding a test that will actually check that if there are additional strings returned the command will still work fine? Otherwise I will just either mock the return of the function or test the sanitize method of
BaseHost
individually.