Closed Jacob-Stevens-Haas closed 10 months ago
Hi @Jacob-Stevens-Haas, my name is Kan, and I belong to the software team of Ocean Networks Canada. It is decided within the organization that we will continue supporting this repo. Your ideas and suggestions are very valuable for improving the library, and we plan to address those issues in the new future.
Currently I will be the main maintainer for this library. Would you like to be part of the reviewer list for this repo?
Yes, I think I volunteered a while back and Martin Heesemann added me as a contributor, I believe? Unfortunately this has dropped off my radar for a while and I don't have the bandwidth this week to work on the repo, but hearing ONC is looking to support this module, I'll give it more attention :)
I would like to add test instructions to README.md including how to set
${token}
for the robotests. I can do it from the command line, but I need to hard code it somewhere to be able to debug (and hardcoding it in general.robot counts as a git diff). Do you also want me to setup CI for Github actions (you may need to enable it, but I can add the .yaml file that sets up the runs)?Running tests with
onc
installed locally results in anImportError
:Error in file '/home/jmsh/github/onc-python-client/tests/resources/general.robot' on line 2: Importing library '/home/jmsh/github/onc-python-client/tests/libraries/common.py' failed: ImportError: cannot import name 'ONC' from 'onc' (/home/jmsh/github/onc-python-client/onc/init.py)
What I think
common.py
is trying to do: add theonc
folder tosys.path
, then import theonc
subpackage. The problem is that appending the folder adds it to the end, meaning that any installed version ofonc
takes priority. It's common when working in git repos to install the current package in editable mode (pip install -e .
) so it's not necessary to manipulate sys.path in testing. Solutions:sys.path.append(os.path.join(Path(__file__).parents[2], 'onc'))
tosys.path.insert(0, os.path.join(Path(__file__).parents[2], 'onc'))
from onc import ONC
tofrom onc.onc import ONC
and removesys.path
line.I can PR either, but I favor the latter because it respects the installed package structure. Caveat, if your internal testing workflow doesn't involve
onc
installed in editable mode (first test is "ONC pip package is NOT installed", but that could probably be safely removed) , this change would require changing that workflow. Could also be fixed by addingfrom onc import *
to__init__.py
, so nobody ever needs to haveonc.onc
in their code.The test output files (log.html, output.xml, report.html) aren't gitignored. I can PR this.
7 other failed tests:
Filter deviceName | FAIL | ('The request failed with HTTP status 400.', {'errors': [{'errorCode': 127, 'errorMessage': 'Invalid parameter value', 'parameter': 'deviceName'}]})
Onc-Python-Client.Tests.Suites.Realtime :: 08. Real-Time Test Suite
Get scalar data by location with 1 page | FAIL | density != Sensor8_Voltage
Get scalar data by location with 3 pages | FAIL | density != Sensor8_Voltage
Onc-Python-Client.Tests.Suites.Archivefiles :: 09. Archive Files Test Suite
Get list by location, 1 page | FAIL | 13 != 15
Get list by location, 3 pages | FAIL | 13 != 15
Get list by location, 3 pages, return archiveLocations | FAIL | 4 != 15
Get list by device, 3 pages, filter extension, return all meta... | FAIL | 1 != 2