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

Test Record is not JSON Serializable #970

Open
ashesman opened this issue Nov 24, 2020 · 0 comments
Open

Test Record is not JSON Serializable #970

ashesman opened this issue Nov 24, 2020 · 0 comments

Comments

@ashesman
Copy link

ashesman commented Nov 24, 2020

Using the "all_the_things.py" example, if manufacturing inspector output is enabled, an exception is thrown due to the test record not able to be serialised. Running on Windows 10 not that it probably is applicable.

The error occurs on line 168 of mfg_event_converter.py:

attachment.value_binary = _convert_object_to_json(test_record_dict)

Example of how to reproduce:

  # Example of how to output to testrun protobuf format and save to disk then
  # upload.  Replace json_file with your JSON-formatted private key downloaded
  # from Google Developers Console when you created the Service Account you
  # intend to use, or name it 'my_private_key.json'.
  import json
  from openhtf.output.proto.mfg_event_converter import mfg_event_from_test_record
  inspector = (mfg_inspector.MfgInspector.from_json(json.load(open('test.json')))).set_converter(mfg_event_from_test_record)
  test.add_output_callbacks(inspector.save_to_disk('mfg_event_{dut_id}_{start_time_millis}.pb'))

  test.execute(test_start=user_input.prompt_for_test_start())

Note that I am only mucking around with manufacturing inspector files as want to get the file history display in the web gui working. Although I cannot see any use of protobufs in the web gui. Just the station server supplying .pb files.

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

No branches or pull requests

1 participant