Skip to content

Commit

Permalink
OK I FEEL IT
Browse files Browse the repository at this point in the history
  • Loading branch information
Simyon264 committed Aug 26, 2024
1 parent db028ec commit 3a1527a
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions Tools/test_pages_for_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,14 @@

async def run_tests():
process = subprocess.Popen(
["dotnet", "run", "--no-build", "--project", "./ReplayBrowser/ReplayBrowser.csproj"],
["dotnet", "run", "--no-build", "--project", "./ReplayBrowser/ReplayBrowser.csproj", "--configuration", "Testing"],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
preexec_fn=os.setsid,
text=True
)

error_found = {"value": False}

def stream_output(pipe, stream_name):
while True:
line = pipe.readline()
if line:
print(f"{stream_name}: {line.strip()}")
else:
break

stdout_thread = asyncio.get_event_loop().run_in_executor(None, stream_output, process.stdout, "STDOUT")
stderr_thread = asyncio.get_event_loop().run_in_executor(None, stream_output, process.stderr, "STDERR")

try:
print("Waiting for the application to start...")
await asyncio.sleep(20)
Expand Down Expand Up @@ -79,10 +67,6 @@ def stream_output(pipe, stream_name):
except Exception as e:
print(f"Error stopping the application: {e}")

# Ensure all output streams are processed before exiting
await stdout_thread
await stderr_thread

def handle_console_message(msg, error_found):
if msg.type == 'error':
print(f"Console error: {msg.text}")
Expand Down

0 comments on commit 3a1527a

Please sign in to comment.