From f8bd21f17cade08a12626972fee27c711bfa1cdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20P=C5=99evr=C3=A1til?= Date: Mon, 9 Dec 2024 15:17:16 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20Firebase=20tokens=20doc=20?= =?UTF-8?q?name?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pytest_plugin_multiprocess_server.py | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/wake/testing/pytest_plugin_multiprocess_server.py b/wake/testing/pytest_plugin_multiprocess_server.py index 6a9dec88..32f62f86 100644 --- a/wake/testing/pytest_plugin_multiprocess_server.py +++ b/wake/testing/pytest_plugin_multiprocess_server.py @@ -1,10 +1,10 @@ +import logging import multiprocessing import multiprocessing.connection import os import pickle import shutil import signal -import logging from contextlib import nullcontext from pathlib import Path from typing import Dict, List, Optional, Tuple, Union @@ -16,6 +16,7 @@ from wake.cli.console import console from wake.config import WakeConfig +from wake.core import get_logger from wake.testing.coverage import ( CoverageHandler, IdeFunctionCoverageRecord, @@ -23,13 +24,12 @@ export_merged_ide_coverage, write_coverage, ) -from wake.core import get_logger logger = get_logger(__name__) -from .pytest_plugin_multiprocess import PytestWakePluginMultiprocess +from firebase_admin import credentials, db, initialize_app, messaging -from firebase_admin import credentials, messaging, initialize_app, db +from .pytest_plugin_multiprocess import PytestWakePluginMultiprocess class PytestWakePluginMultiprocessServer: @@ -77,17 +77,21 @@ def __init__( self._session_id = str(uuid4()) if remote and config.api_keys.get("wake_remote") is not None: - cred = credentials.Certificate(config.global_config_path.parent / "fuzz-firebase-adminsdk.json") + cred = credentials.Certificate( + config.global_config_path.parent / "fuzz-firebase-adminsdk.json" + ) initialize_app( cred, { "databaseURL": "https://wake-remote-default-rtdb.europe-west1.firebasedatabase.app/" - } + }, ) x = db.reference("/") try: - self._firebase_token = x.child("tokens").child(config.api_keys["wake_remote"]).get() + self._firebase_token = ( + x.child("token").child(config.api_keys["wake_remote"]).get() + ) if self._firebase_token is None: logger.warning("No Firebase token found for remote server.") except Exception as e: @@ -143,7 +147,7 @@ def pytest_sessionstart(self, session: pytest.Session): notification=messaging.Notification( title="New fuzzing session started", body=f"{self._proc_count} tasks", - ) + ), ) messaging.send(message) @@ -268,7 +272,7 @@ def pytest_runtestloop(self, session: pytest.Session): notification=messaging.Notification( title=f"Exception {exception_info[0]}", body=f"Process #{index}", - ) + ), ) messaging.send(message) @@ -307,7 +311,7 @@ def pytest_runtestloop(self, session: pytest.Session): notification=messaging.Notification( title="Breakpoint reached", body=f"Process #{index}", - ) + ), ) messaging.send(message) @@ -381,7 +385,7 @@ def pytest_runtestloop(self, session: pytest.Session): notification=messaging.Notification( title="Internal pytest error", body=f"Process #{index}", - ) + ), ) messaging.send(message)