diff --git a/scripts/gha/desktop_tester.py b/scripts/gha/desktop_tester.py index ad8003cf04..53d0e959b3 100644 --- a/scripts/gha/desktop_tester.py +++ b/scripts/gha/desktop_tester.py @@ -94,19 +94,27 @@ class Test(object): # them as fields so they can be accessed from the main thread. def run(self): """Executes this testapp.""" - result = subprocess.run( - args=[self.testapp_path], - cwd=os.path.dirname(self.testapp_path), # Testapp checks CWD for config - stdout=subprocess.PIPE, - stderr=subprocess.STDOUT, - text=True, - check=False, - timeout=300) + result = None # Ensures this var is defined if timeout occurs. + try: + result = subprocess.run( + args=[self.testapp_path], + cwd=os.path.dirname(self.testapp_path), # Testapp uses CWD for config + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT, + text=True, + check=False, + timeout=300) + except subprocess.TimeoutExpired as e: + logging.error("Testapp timed out!") + # e.output will sometimes be bytes, sometimes string. Decode if needed. + try: + self.logs = e.output.decode() + except AttributeError: # This will happen if it's already a string. + self.logs = e.output + if result: + self.logs = result.stdout logging.info("Finished running %s", self.testapp_path) - self.logs = result.stdout - self.return_code = result.returncode - if __name__ == "__main__": app.run(main) diff --git a/testing/test_framework/src/firebase_test_framework.cc b/testing/test_framework/src/firebase_test_framework.cc index d34f0bc2c6..3271be54e5 100644 --- a/testing/test_framework/src/firebase_test_framework.cc +++ b/testing/test_framework/src/firebase_test_framework.cc @@ -208,7 +208,7 @@ std::ostream& operator<<(std::ostream& os, const Variant& v) { extern "C" int common_main(int argc, char* argv[]) { ::testing::InitGoogleTest(&argc, argv); firebase_test_framework::FirebaseTest::SetArgs(argc, argv); - app_framework::SetLogLevel(app_framework::kInfo); + app_framework::SetLogLevel(app_framework::kDebug); // Anything below the given log level will be preserved, and printed out in // the event of test failure. app_framework::SetPreserveFullLog(true);