Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing localtest.me #886

Merged
merged 4 commits into from
Apr 13, 2021
Merged
Show file tree
Hide file tree
Changes from 3 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
13 changes: 6 additions & 7 deletions openwpm/browser_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
from typing import TYPE_CHECKING, Optional, Tuple, Union

import psutil
import tblib
from multiprocess import Queue
from selenium.common.exceptions import WebDriverException
from tblib import Traceback, pickling_support

from .command_sequence import CommandSequence
from .commands.browser_commands import FinalizeCommand
Expand All @@ -29,18 +29,17 @@
from .errors import BrowserConfigError, BrowserCrashError, ProfileLoadError
from .socket_interface import ClientSocket
from .storage.storage_providers import TableName

if TYPE_CHECKING:
from .task_manager import TaskManager

from .types import BrowserId, VisitId
from .utilities.multiprocess_utils import (
Process,
kill_process_and_children,
parse_traceback_for_sentry,
)

tblib.pickling_support.install()
pickling_support.install()
vringar marked this conversation as resolved.
Show resolved Hide resolved

if TYPE_CHECKING:
from .task_manager import TaskManager


class BrowserManagerHandle:
Expand Down Expand Up @@ -517,7 +516,7 @@ def _unpack_pickled_error(self, pickled_error: bytes) -> Tuple[str, str]:
"""Unpacks `pickled_error` into an error `message` and `tb` string."""
exc = pickle.loads(pickled_error)
message = traceback.format_exception(*exc)[-1]
tb = json.dumps(tblib.Traceback(exc[2]).to_dict())
tb = json.dumps(Traceback(exc[2]).to_dict())
return message, tb

def kill_browser_manager(self):
Expand Down
2 changes: 1 addition & 1 deletion openwpm/utilities/db_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

def query_db(
db: Path, query: str, params: Iterable = None, as_tuple: bool = False
) -> List[Union[sqlite3.Row, tuple]]:
) -> List[Union[sqlite3.Row, Tuple[Any, ...]]]:
"""Run a query against the given db.

If params is not None, securely construct a query from the given
Expand Down
2 changes: 1 addition & 1 deletion openwpm/utilities/platform_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def get_configuration_string(manager_params, browser_params, versions):
config_str += tabulate(table_input, headers=key_dict)

config_str += "\n\n========== JS Instrument Settings ==========\n"
config_str += json.dumps(js_config, indent=2, separators=(",", ": "))
config_str += json.dumps(js_config, indent=None, separators=(",", ":"))
vringar marked this conversation as resolved.
Show resolved Hide resolved

config_str += "\n\n========== Input profile tar files ==========\n"
if profile_all_none:
Expand Down
12 changes: 6 additions & 6 deletions test/test_custom_function_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@

PAGE_LINKS = {
(
u"http://localtest.me:8000/test_pages/simple_a.html",
u"http://localtest.me:8000/test_pages/simple_c.html",
f"{utilities.BASE_TEST_URL}/simple_a.html",
f"{utilities.BASE_TEST_URL}/simple_c.html",
),
(
u"http://localtest.me:8000/test_pages/simple_a.html",
u"http://localtest.me:8000/test_pages/simple_d.html",
f"{utilities.BASE_TEST_URL}/simple_a.html",
f"{utilities.BASE_TEST_URL}/simple_d.html",
),
(
u"http://localtest.me:8000/test_pages/simple_a.html",
u"http://example.com/test.html?localtest.me",
f"{utilities.BASE_TEST_URL}/simple_a.html",
"http://example.com/test.html?localtest.me",
),
}

Expand Down
8 changes: 8 additions & 0 deletions test/test_dns_instrument.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
import os

import pytest

from openwpm.utilities import db_utils


@pytest.mark.skipif(
"CI" not in os.environ or os.environ["CI"] == "false",
reason="Makes remote connections",
)
def test_name_resolution(default_params, task_manager_creator):
vringar marked this conversation as resolved.
Show resolved Hide resolved
manager_params, browser_params = default_params
for browser_param in browser_params:
Expand Down
Loading