• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mozilla / fx-private-relay / 63ad679c-7c70-4935-8fd6-bc0176e80b72

15 Dec 2023 07:08PM CUT coverage: 73.514%. Remained the same
63ad679c-7c70-4935-8fd6-bc0176e80b72

push

circleci

jwhitlock
Use branch database with production tests

Previously, migrations tests were run with production code, branch
requirements, and branch migrations. Now they run with production
requirements, so that third-party migrations are tested as well.

This uses pytest --reuse-db to create a test database with the branch's
migrations, and then a pip install with the production code. This more
closely emulates the mixed environment during a deploy.

1962 of 2913 branches covered (0.0%)

Branch coverage included in aggregate %.

6273 of 8289 relevant lines covered (75.68%)

19.91 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/emails/management/commands/get_latest_email_tracker_lists.py
1
import json
×
2
import pathlib
×
3

4
from django.core.management.base import BaseCommand
×
5

6
from emails.utils import download_trackers, shavar_prod_lists_url, store_trackers
×
7

8
EMAILS_FOLDER_PATH = pathlib.Path(__file__).parents[2]
×
9
TRACKER_FOLDER_PATH = EMAILS_FOLDER_PATH / "tracker_lists"
×
10

11

12
class Command(BaseCommand):
×
13
    help = "Fetch and store email tracker lists from Shavar Prod List repository"
×
14

15
    def add_arguments(self, parser):
×
16
        parser.add_argument(
×
17
            "--repo-url",
18
            default=shavar_prod_lists_url,
19
            help="Set url that the email tracker lists will be pulled from",
20
        )
21
        parser.add_argument(
×
22
            "--tracker-level",
23
            default=1,
24
            type=int,
25
            choices=[1, 2],
26
            help="Choose the level of tracker list desired",
27
        )
28

29
    def handle(self, *args, **options):
×
30
        repo_url = options["repo_url"]
×
31
        tracker_level = options["tracker_level"]
×
32

33
        category = "Email"
×
34
        tracker_list_name = "level-one-trackers"
×
35
        if tracker_level == 2:
×
36
            category = "EmailAggressive"
×
37
            tracker_list_name = "level-two-trackers"
×
38

39
        trackers = download_trackers(repo_url, category)
×
40
        file_name = f"{tracker_list_name}.json"
×
41

42
        store_trackers(trackers, TRACKER_FOLDER_PATH, file_name)
×
43
        print(f"Added {file_name} in {TRACKER_FOLDER_PATH}")
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc