Skip to content

Re-add Common Crawl tests with skips #579

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

Merged
merged 2 commits into from
Apr 8, 2025
Merged
Changes from all 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
54 changes: 54 additions & 0 deletions tests/test_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,24 @@ def test_imports(self):

assert True

@pytest.mark.skip(
reason="This test is flaky due to calling out to an external service and should be fixed."
)
def test_common_crawl_urls(self):
start_snapshot = "2021-04"
end_snapshot = "2021-10"
urls = get_common_crawl_urls(start_snapshot, end_snapshot)

assert (
urls[0]
== "https://data.commoncrawl.org/crawl-data/CC-MAIN-2021-10/segments/1614178347293.1/warc/CC-MAIN-20210224165708-20210224195708-00000.warc.gz"
)
assert (
urls[-1]
== "https://data.commoncrawl.org/crawl-data/CC-MAIN-2021-04/segments/1610704847953.98/warc/CC-MAIN-20210128134124-20210128164124-00799.warc.gz"
)
assert len(urls) == 143840

@pytest.mark.skip(
reason="This test is flaky due to calling out to an external service and should be fixed."
)
Expand All @@ -130,6 +148,24 @@ def test_incorrect_snapshot_order(self):
start_snapshot = "2021-10"
urls = get_common_crawl_urls(start_snapshot, end_snapshot)

@pytest.mark.skip(
reason="This test is flaky due to calling out to an external service and should be fixed."
)
def test_common_crawl_news_urls(self):
start_snapshot = "2021-04"
end_snapshot = "2021-10"
urls = get_common_crawl_urls(start_snapshot, end_snapshot, news=True)

assert (
urls[0]
== "https://data.commoncrawl.org/crawl-data/CC-NEWS/2021/04/CC-NEWS-20210401004522-01022.warc.gz"
)
assert (
urls[-1]
== "https://data.commoncrawl.org/crawl-data/CC-NEWS/2021/10/CC-NEWS-20211031225258-00089.warc.gz"
)
assert len(urls) == 3838

@pytest.mark.skip(
reason="This test is flaky due to calling out to an external service and should be fixed."
)
Expand All @@ -139,6 +175,24 @@ def test_incorrect_snapshot_order_news(self):
start_snapshot = "2021-10"
urls = get_common_crawl_urls(start_snapshot, end_snapshot, news=True)

@pytest.mark.skip(
reason="This test is flaky due to calling out to an external service and should be fixed."
)
def test_uneven_common_crawl_range(self):
start_snapshot = "2021-03"
end_snapshot = "2021-11"
urls = get_common_crawl_urls(start_snapshot, end_snapshot)

assert (
urls[0]
== "https://data.commoncrawl.org/crawl-data/CC-MAIN-2021-10/segments/1614178347293.1/warc/CC-MAIN-20210224165708-20210224195708-00000.warc.gz"
)
assert (
urls[-1]
== "https://data.commoncrawl.org/crawl-data/CC-MAIN-2021-04/segments/1610704847953.98/warc/CC-MAIN-20210128134124-20210128164124-00799.warc.gz"
)
assert len(urls) == 143840

def test_no_urls(self):
with pytest.raises(ValueError):
output_format = {
Expand Down