Skip to content

Commit

Permalink
Merge branch 'master' into dns_instrument_fix
Browse files Browse the repository at this point in the history
  • Loading branch information
vringar committed Feb 8, 2024
2 parents 628e3f3 + 7b8cf99 commit 8a855a4
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 55 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/build-container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ on:
- "v*.*.*"
workflow_dispatch:


jobs:
build_and_publish:
runs-on: ubuntu-latest
Expand All @@ -26,30 +25,30 @@ jobs:
if [[ $GITHUB_REF == refs/heads/master ]]; then
TAGS="$TAGS,${DOCKER_IMAGE}:latest"
fi
echo ::set-output name=tags::${TAGS}
echo tags="${TAGS}" >> "$GITHUB_OUTPUT"
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3
- name: Cache Docker layers
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Log into Dockerhub
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USER_NAME }}
password: ${{ secrets.DOCKERHUB_USER_PASSWORD }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
context: ./
context: ./
file: ./Dockerfile
builder: ${{ steps.buildx.outputs.name }}
push: true
Expand Down
58 changes: 29 additions & 29 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ name: "CodeQL"

on:
push:
branches: [ master ]
branches: [master]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
branches: [master]
schedule:
- cron: '33 19 * * 6'
- cron: "33 19 * * 6"

jobs:
analyze:
Expand All @@ -32,39 +32,39 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'javascript', 'python' ]
language: ["javascript", "python"]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://git.io/codeql-language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release
#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
14 changes: 7 additions & 7 deletions .github/workflows/run-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ jobs:
runs-on: ubuntu-latest
steps:
# All of these steps are just setup
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setting MAMBA_PATH
run: echo "MAMBA_PATH=$HOME/mamba" >> $GITHUB_ENV
- name: Setting OPENWPM_MAMBA_PATH
run: echo "OPENWPM_MAMBA_PATH=$MAMBA_PATH/envs/openwpm" >> $GITHUB_ENV
# If the environment.yaml hasn't changed we just reuse the entire conda install
- id: cache
uses: actions/cache@v3
uses: actions/cache@v4
env:
cache-name: conda-cache
with:
Expand Down Expand Up @@ -49,14 +49,14 @@ jobs:
runs-on: ubuntu-latest
steps:
# All of these steps are just setup
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setting MAMBA_PATH
run: echo "MAMBA_PATH=$HOME/mamba" >> $GITHUB_ENV
- name: Setting OPENWPM_MAMBA_PATH
run: echo "OPENWPM_MAMBA_PATH=$MAMBA_PATH/envs/openwpm" >> $GITHUB_ENV
# If the environment.yaml hasn't changed we just reuse the entire conda install
- id: cache
uses: actions/cache@v3
uses: actions/cache@v4
env:
cache-name: conda-cache
with:
Expand Down Expand Up @@ -96,9 +96,9 @@ jobs:
fail-fast: false
steps:
# All of these steps are just setup, maybe we should wrap them in an action
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Cache node modules
uses: actions/cache@v3
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
Expand All @@ -113,7 +113,7 @@ jobs:

# If the environment.yaml hasn't changed we just reuse the entire conda install
- id: conda-cache
uses: actions/cache@v3
uses: actions/cache@v4
env:
cache-name: conda-cache
with:
Expand Down
Binary file modified test/profile.tar.gz
Binary file not shown.
25 changes: 14 additions & 11 deletions test/test_profile.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import logging
import tarfile
import time
from pathlib import Path
Expand All @@ -13,6 +14,7 @@
from openwpm.errors import CommandExecutionError, ProfileLoadError
from openwpm.utilities import db_utils

from . import openwpmtest
from .utilities import BASE_TEST_URL

# TODO update these tests to make use of blocking commands
Expand Down Expand Up @@ -117,17 +119,16 @@ def test_seed_persistence(default_params, task_manager_creator):
for browser_param in browser_params:
browser_param.seed_tar = p
manager, db = task_manager_creator(default_params)

command_sequences = []
for _ in range(2):
cs = CommandSequence(url=BASE_TEST_URL)
cs.get()
cs.append_command(AssertConfigSetCommand("test_pref", True))
command_sequences.append(cs)

for cs in command_sequences:
manager.execute_command_sequence(cs)
manager.close()
with manager:
command_sequences = []
for _ in range(openwpmtest.NUM_BROWSERS):
cs = CommandSequence(url=BASE_TEST_URL)
cs.get()
cs.append_command(AssertConfigSetCommand("test_pref", True))
command_sequences.append(cs)

for cs in command_sequences:
manager.execute_command_sequence(cs)
query_result = db_utils.query_db(
db,
"SELECT * FROM crawl_history;",
Expand All @@ -141,6 +142,7 @@ class AssertConfigSetCommand(BaseCommand):
def __init__(self, pref_name: str, expected_value: Any) -> None:
self.pref_name = pref_name
self.expected_value = expected_value
self.logger = logging.getLogger("openwpm")

def execute(
self,
Expand All @@ -162,6 +164,7 @@ def execute(
}}
"""
)
self.logger.error(f"Got result: {result}")
assert result == self.expected_value


Expand Down

0 comments on commit 8a855a4

Please sign in to comment.