Skip to content

Conversation

@Voamorim
Copy link

No description provided.

Copy link
Member

@cunha cunha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Main points:

  • Tests don't match expected behavior; we need to define a number of domain and path levels beyond which we start "anonymization"
  • Need tests to cover URL query parameters
  • Need tests to cover special domains and CC TLDs

Copy link
Member

@cunha cunha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot to mention CC TLDs in the previous review.

Copy link
Member

@cunha cunha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another round of comments. I think we should focus on comparing the URL identity keys (after we "erase" subdomains, path levels, and query parameter values). The filter is just taking one URL for each distinct identity key.

"""Testing a single URL identity key."""
url = "http://example.com/unique"
result = filter_instance.anonymize_url(url)
expected = "n1/unique"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be http://example.com/unique, no? Why the n1?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the other tests, it seems like we are really anonymizing the URLs, but we do not need to (and should not) anonymize in this project, as we need to know exactly what the URL is to crawl it later.

"http://sub.example.com/page",
"http://another.example.com/page"
]
result = filter_instance.filter_urls(urls)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should focus our tests on anonymize_urls, to check what URL identity keys are being generated. The filter is then just running set() on the list of anonymized URLs.


def test_special_cctld(self, filter_instance):
"""Test URL with special ccTLD identity key."""
url = "http://example.co/page"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need tests for long subdomains like a.b.c.d.com.br to make sure we're erasing the correct subdomains according to the config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants