PyFixate / Fixate

Framework for hardware test fixtures and automatic test environments
MIT License
22 stars 17 forks source link

Fix encoding errors in csv-writer and logger #217

Closed Jasper-Harvey0 closed 4 days ago

Jasper-Harvey0 commented 1 week ago

When I was testing the MEC jig, I noticed the csv writer thread was crashing. The crash is caused by encoding errors from attempting to write "Ω" to the file. This is the same story for the debug log.

Explicitly setting the encoding of UTF-8 in both the test log file and the fixate log file seems to fix the problem.

Jasper-Harvey0 commented 1 week ago

Draft for now as I need to do a little more testing. I also want to have test scripts error if the logging thread falls over.

Jasper-Harvey0 commented 1 week ago

So I have moved a few things around to get the sequencer checking the health of the csv thread. The csv thread is now started from within the sequencer run_sequence() function.

I did a bit of a rejig of the classes in csv.py. I didn't really see the point of having both CSVWriter and CSVReporting, and it does away with the global stuff. Happy to revisit if there is actually a reason to have those classes separate.