Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 19 additions & 11 deletions scripts/gha/desktop_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion testing/test_framework/src/firebase_test_framework.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down