pavilion2
pavilion2 copied to clipboard
Added -f and --follow option to pav log command.
Usage: pav log -f/--follow <log_type> <test_id>
example: pav log -f build 72
You also need to make a unit test for this. I would:
- Add a 'FOLLOW_TEST' class variable, defaulted to false.
- Exit the follow loop after successfully reading data when FOLLOW_TEST is true.
- In the unit test:
- Set the follow sleep time to really short (0.1)
- Set FOLLOW_TEST to True
- Create a pav test that prints some stuff in test test run and run it.
- Grab the log command, and use the
silence()method on it. - Use threading to background the call to the log.run method.
- Wait 0.2 seconds
- Append something to the log.
- Wait for the log.run thread to finish.
- Check that the thing you appended is in the command output.
Let's work on this in the Pavilion meeting today as a group.
There is a bug where where build hash log doesn't change from the previous run and ends up not finding the new hash. I will fix it when I return.