Skip to content
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 a test for bluechictl monitor <node> <service> #776

Merged
merged 2 commits into from
Mar 6, 2024

Conversation

mwperina
Copy link
Member

@mwperina mwperina commented Mar 5, 2024

  • Flush stdout in bluechictl monitor after each output to stdout
  • Add a test for bluechictl monitor

Fixes: #777

@coveralls
Copy link

coveralls commented Mar 5, 2024

Coverage Status

coverage: 77.871% (+1.6%) from 76.26%
when pulling 76da056 on mwperina:test-bluechictl-monitor
into 68d893c on eclipse-bluechi:main.

stdout is by default buffered stream, so in order to be able to parse
output from bluechictl in real time in integration tests we need to
explicitely call flush.

Signed-off-by: Martin Perina <mperina@redhat.com>
@mkemel
Copy link
Member

mkemel commented Mar 6, 2024

I was thinking about another solution for that, that would also test bluechictl metrics listen
Add a class in bluechictl.py that would run bluechictl in another thread, having start and stop methods, with stop returning the output, which you can check for anticipated output. That would be a more general and reusable solution. WDYT?

@mwperina mwperina force-pushed the test-bluechictl-monitor branch 3 times, most recently from 6e94aea to a10ace3 Compare March 6, 2024 10:16
@mwperina
Copy link
Member Author

mwperina commented Mar 6, 2024

Switched to use temporary file for parsing bluechictl monitor results, so we cleanup properly after the test finishes

Adds a test if a restarted service on a node> is properly monitored
by bluechictl monitor command.

Fixes: eclipse-bluechi#777
Signed-off-by: Martin Perina <mperina@redhat.com>
@engelmi
Copy link
Member

engelmi commented Mar 6, 2024

I was thinking about another solution for that, that would also test bluechictl metrics listen Add a class in bluechictl.py that would run bluechictl in another thread, having start and stop methods, with stop returning the output, which you can check for anticipated output. That would be a more general and reusable solution. WDYT?

In general, there is probably a lot of optimization potential in the current tests - this could be one. Lets focus on the 100% function coverage first and optimize after that :)

@engelmi engelmi merged commit 21479b4 into eclipse-bluechi:main Mar 6, 2024
20 checks passed
@mwperina mwperina deleted the test-bluechictl-monitor branch March 6, 2024 14:32
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.

Add integration test for bluechictl monitor <node> <service>
4 participants