• Wez Furlong's avatar
    getdeps: improve debugging when failing to query tests from ctest · 032369f9
    Wez Furlong authored
    Summary:
    We're seeing a failure on macOS in a CI environment but don't have much context:
    
    ```
    Stderr:
    + GETDEPS=opensource/fbcode_builder/getdeps.py
    + opensource/fbcode_builder/getdeps.py test --facebook-internal watchman
    Traceback (most recent call last):
      File "opensource/fbcode_builder/getdeps.py", line 436, in <module>
        sys.exit(main())
      File "opensource/fbcode_builder/getdeps.py", line 422, in main
        return args.func(args)
      File "opensource/fbcode_builder/getdeps.py", line 342, in run
        builder.run_tests(install_dirs, schedule_type=args.schedule_type)
      File "/data/sandcastle/boxes/trunk-hg-fbcode-fbsource/fbcode/opensource/fbcode_builder/getdeps/builder.py", line 372, in run_tests
        buck_test_info = list_tests()
      File "/data/sandcastle/boxes/trunk-hg-fbcode-fbsource/fbcode/opensource/fbcode_builder/getdeps/builder.py", line 352, in list_tests
        data = json.loads(output.decode("utf-8"))
      File "/opt/homebrew/Cellar/python27/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 338, in loads
        return _default_decoder.decode(s)
      File "/opt/homebrew/Cellar/python27/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 366, in decode
        obj, end = self.raw_decode(s, idx=_w(s, 0).end())
      File "/opt/homebrew/Cellar/python27/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 384, in raw_decode
        raise ValueError("No JSON object could be decoded")
    ValueError: No JSON object could be decoded
    ```
    
    Add some more context to that error message so we can learn more.
    
    Reviewed By: pkaush
    
    Differential Revision: D16061528
    
    fbshipit-source-id: 23603a5d18651d20641ef1987b7094e73a9b1dbe
    032369f9
builder.py 23.9 KB