Commit 4c984df1 authored by Joanne Hugé's avatar Joanne Hugé

promise/plugin: improve check-rx-saturated messages

parent 453dce5f
Pipeline #30406 failed with stage
in 0 seconds
...@@ -36,9 +36,13 @@ class RunPromise(JSONPromise): ...@@ -36,9 +36,13 @@ class RunPromise(JSONPromise):
if not max_rx_list: if not max_rx_list:
self.logger.error("No RX samples data available") self.logger.error("No RX samples data available")
elif saturated: elif saturated:
self.logger.error("RX antenna saturated, please lower rx_gain") self.logger.error(
"RX Max dBFS: {} (RX antennas saturated, please lower rx_gain)".format(
", ".join(max_rx_list)))
else: else:
self.logger.info("No saturation detected on RX antenna") self.logger.info(
"RX Max dBFS: {} (No saturation detected on RX antennas)".format(
", ".join(max_rx_list)))
def test(self): def test(self):
""" """
......
  • @jhuge, FYI, I've started to get the following test failure after this commit:

    (py3.venv) kirr@deca:~/src/wendelin/slapos/slapos.toolbox$ python -m unittest discover -v   -s slapos/test/promise/plugin/ -t . -k TestCheckRXSaturated
    test_promise_fail (slapos.test.promise.plugin.test_check_rx_saturated.TestCheckRXSaturated.test_promise_fail) ... 2023-10-11 17:10:02,357 - slapos.grid.promise - INFO - Checking promise check-rx-saturated.py...
    2023-10-11 17:10:02,408 - slapos.grid.promise - ERROR - sequence item 0: expected str instance, float found
    Traceback (most recent call last):
      File "/home/kirr/src/wendelin/slapos/slapos.core/slapos/grid/promise/generic.py", line 500, in run
        self.sense()
      File "/home/kirr/src/wendelin/slapos/slapos.toolbox/slapos/promise/plugin/check_rx_saturated.py", line 41, in sense
        ", ".join(max_rx_list)))
        ^^^^^^^^^^^^^^^^^^^^^^
    TypeError: sequence item 0: expected str instance, float found
    ok
    test_promise_success (slapos.test.promise.plugin.test_check_rx_saturated.TestCheckRXSaturated.test_promise_success) ... 2023-10-11 17:10:02,416 - slapos.grid.promise - INFO - Checking promise check-rx-saturated.py...
    2023-10-11 17:10:02,467 - slapos.grid.promise - ERROR - sequence item 0: expected str instance, float found
    Traceback (most recent call last):
      File "/home/kirr/src/wendelin/slapos/slapos.core/slapos/grid/promise/generic.py", line 500, in run
        self.sense()
      File "/home/kirr/src/wendelin/slapos/slapos.toolbox/slapos/promise/plugin/check_rx_saturated.py", line 45, in sense
        ", ".join(max_rx_list)))
        ^^^^^^^^^^^^^^^^^^^^^^
    TypeError: sequence item 0: expected str instance, float found
    ERROR
    
    ======================================================================
    ERROR: test_promise_success (slapos.test.promise.plugin.test_check_rx_saturated.TestCheckRXSaturated.test_promise_success)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/home/kirr/src/wendelin/slapos/slapos.toolbox/slapos/test/promise/plugin/test_check_rx_saturated.py", line 64, in test_promise_success
        self.launcher.run()
      File "/home/kirr/src/wendelin/slapos/slapos.core/slapos/grid/promise/__init__.py", line 879, in run
        raise PromiseError("Promise %r failed with output: %s" % (
    slapos.grid.promise.PromiseError: Promise 'check-rx-saturated.py' failed with output: sequence item 0: expected str instance, float found
    Traceback (most recent call last):
      File "/home/kirr/src/wendelin/slapos/slapos.core/slapos/grid/promise/generic.py", line 500, in run
        self.sense()
      File "/home/kirr/src/wendelin/slapos/slapos.toolbox/slapos/promise/plugin/check_rx_saturated.py", line 45, in sense
        ", ".join(max_rx_list)))
        ^^^^^^^^^^^^^^^^^^^^^^
    TypeError: sequence item 0: expected str instance, float found
    
    ----------------------------------------------------------------------
    Ran 2 tests in 0.122s
    
    FAILED (errors=1)
    
  • Hi, strange I remember seeing the tests passed when I ran them, I think I forgot to run the tests after I rebased with master. Anyway this reminded me that it is better for the user to format the floats with less decimal places. I pushed the fix.

  • Good day, Joanne. Thanks for feedback and for the correction.

Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment