Conversation
9d15563 to
3b8e132
Compare
|
Markled as ready for review to see which PRs are being actively worked on for now. Please ignore that update |
0244796 to
8160dba
Compare
|
Latest changes are up, I think they are janky but thats the downside of using logs. With more time, I can get it better but for now they work in most circumstances. I would advice against putting this in any default integtests though, at least until monday when I reverify everything. It also depends on Kurt's branch, kbiery/temp_branch_drunc_output_capture, on integtests TODO for monday
|
|
Thank you @emmuhamm, I am about to start reviewing. Before I start, some questions
What is the motivation for needing this? |
|
Thanks Pawel. Regarding
Honestly there's not much motivation, it stems from me not fully understanding how strict the pythoncode v sourcecode distinction is. I've understood the need for it but not 'how strict do we want it to be' kinda deal. Anyways, this was a minor change and whipped it up in no time. Can undo it by reverting this one commit for that specific file 7149dbf. I'm not too attached to the idea so if you want me to get rid of it I'd be happy to |
|
Integration test passed, nice work :) |
a058fb7 to
1af1850
Compare
|
Reverting back to draft so it doesnt accidentally get merged. It now depends on #824 |
1af1850 to
f6a8066
Compare
[TO SQUASH] Some more notes and minor cleanup; move to new nightly Update name, fix tests
36a9fea to
e57c098
Compare
|
Only major change I can think of is this commit This is built off Aurash's PR with the flush crash thing, so that should work as expected |
emmuhamm
left a comment
There was a problem hiding this comment.
Since technically you are the author of this PR you may not be able to approve it. In which case I'll approve it now but keep it mark as draft so you can 'approve' by undrafting and merging ;)
Description
Fixes issue #728
Also fixes issue #819
Depends on DUNE-DAQ/integrationtest#151
Adds some test for the Process Manager based on the DUNE DAQ integ test framework.
The relevant changes in the user workflow have been documented in the doc changes thing see the file change its an md
TODO:
Discuss with Kurt to remove dependency on terminal width. When terminal window is too small, the ps table concatenates. Since the current test is incredibly dependent on obtaining the stdout of the drunc process, it would be nice if the terminal window dependency can be removedMiruna has done a bit of development on this front: https://github.com/DUNE-DAQ/drunc/tree/miruuna%2Ffeature-base-sequence-tests-for-ssh-shell-pm---integration-testing-framework. See if we can integrate any of the changes here.Type of change
List of required branches from other repositories
A new PR in
integrationtestrepo. Currently, the test requires the branchkbiery/temp_branch_drunc_output_capture, of which a PR has not been made yet.Change log
An integtest-like set of tests have been written for the SSH Process Manager. It also includes several helper functions which may come in handy for other sort of tests, which is done in the
integ_test_utils.pyfile.The current testing framework is a bit janky. Its entirely dependent on reading the terminal output of the drunc process, which is saved into an stdout object that can be read by DUNE DAQ's integtesting framework.
With the echo command (see below), this PR also adds a bunch of testing utility that allows the integtest to process the stdout of the drunc session. This lets us parse the logs directly, checking if specific processes exist in the
pscommand, or if specific log lines are found with specific numbers. This lets us test if, for example, the wait command waits for the correct amount of time, or if the mlt process exists or not depending on if we've killed it.Echo
To help with this, an
echofunction is added in drunc, which lets you 'echo' stuff in the terminal like in bashThis echo command is liberally used when setting up the testing framework. For now, there are discrete blocks of code that tests a particular command, and the echo command is used by the test to identify which line the tests happen in the log file. Further processing is done to perform the required tests, which should be documented in code and easy to follows.
Comment
A
commentfunction is also added in drunc. It lets you write 'comments' in the terminal if required, and nothing will come outIt could come in handy. Note that we cannot bind
#or//or similar as a function for comments, because the click parsing relies on the characters being ascii and alphanumeric.pythoncode vs sourcecode
A slight change in the drunc integtest bundle also lets the drunc repo exist in either the pythoncode folder or the sourcecode folder. The sourcecode folder was not supported before
Fix width dependnecy on logs
A slight change in the
logsunified shell command,k in which we add asoft_wrap. The logs command usesConsole.print()(from the Rich library) to get the logs to terminal, but that command is a 'print it once' output, so with this there is no mechanism to re-render those lines at a new width. This effectively single log lines can be split into two, which breaks the current testing framework.soft-wrapfixes this.Fix width dependency on ps tables (and other tables from the PM)
We now introduce an optional parameter for eg.
ps -w [int]. If parmater is not used, follow usual procedure.If parameter is included, it will expand to the desired width and correctly wraps around. Very useful for the integ tests :)
Suggested manual testing checklist
From the drunc folder, run
./scripts/drunc_integtest_bundle.shFollow up
Two issues were discovered when writing the tests for these (as intended!!)
#819 <- also being fixed in this PR
#821
Developer checklist
Prior to marking this as "Ready for Review"
Tests ran on: np04-srv-028 from release NFD_DEV_260313_A9.
Unit tests - some tests can't be ran on the CI. This is documented. If this PR checks a feature that can't be tested with CI, this has been marked appropriately.
Integration tests - the
daqsystemtest_integtest_bundlerequires a lot of resources, and connections to the EHN1 infrastructure. Check the cross referenced list if you can't run these. The developer needs to run at least the .pytest --marker) passeddaqsystemtest_integtest_bundle.sh -k minimal_system_quick_test.pydaqsystemtest_integtest_bundle.shFinal checklist prior to marking this as "Ready for Review"
Reviewer checklist
druncare in the log filesdruncfailure appears:Once the features are validated and both the unit and integration tests pass, the PRs is ready to be merged.
Choose one of the following an complete all substepsPrior to merging
Once completed, the reviewer can merge the PR.
Notification message for #daq-sw-librarians Slack channel
For an single merge that changes the user workflow
For co-ordinated merge