Closed jhughesbiot closed 1 month ago
I cannot seem to run these unit tests. This is the error I get:
/usr/bin/python3: can't find 'main' module in '/testing/unit/conn/module_test.py' /usr/bin/python3: can't find 'main' module in '/testing/unit/dns/module_test.py' /usr/bin/python3: can't find 'main' module in '/testing/unit/ntp/module_test.py' /usr/bin/python3: can't find 'main' module in '/testing/unit/protocol/module_test.py' /usr/bin/python3: can't find 'main' module in '/testing/unit/services/module_test.py' ^Cdocker: Error response from daemon: OCI runtime start failed: cannot start a container that has stopped: unknown. testing/unit/run.sh: line 64: venv/bin/activate: No such file or directory
Could you quickly document in testing/unit/README.md how to run the unit tests?
I'll add some docs around it's usage. Were you running the unit test from the testing/unit directory? That's currently required so might be a pathing issue if it was run from somewhere else.
I'm still getting some errors when running from the correct path: https://paste.googleplex.com/6099375204073472 Also, could we modify the run script to default from running from the root directory?
Based on the last error for the TLS tests, it looks like you didn't' rebuild the containers since it's missing a new dependency added in the tls test module used for testing.
The other errors appear to be because the binary files are corrected during normal test module startup which is short circuited in testing. Had to move line endings and executable command into test module docker files for consistency to correct this.
Unit test run.sh script is now designed to be executed from the Testrun root directory as well.
Unit tests were not guaranteed to run within the same environment as they would in runtime so this updates the unit test structure to use containers as much as possible as well as the venv runtime for all non containerized tests.